HD wallet BIP-32 related key derivation utilities.

Overview

HDWallet

Crates.io MIT licensed Build Status Docs

HD wallet(BIP-32) key derivation utilities.

This crate is build upon secp256k1 crate, this crate only provides BIP-32 related features, for signature features see the secp256k1 documentation.

  • [ChainPath] and [KeyChain] are used to derive HD wallet keys.
  • [Derivation] describes key derivation info.
  • [ExtendedPrivKey] and [ExtendedPubKey] represent extended keys according to BIP-32, which can derives child keys.
  • [KeyIndex] indicates child key's index and type(Normal key or Hardened key).
  • [Error] errors.

hdwallet itself is a key derivation framework. Check hdwallet-bitcoin if you want to derive bitcoin keys; you can find or submit other crypto currencies on hdwallet homepage.

Documentation

License

MIT

Comments
  • Replace the `rand` dependency with `rand_core` & update dependency versions.

    Replace the `rand` dependency with `rand_core` & update dependency versions.

    By replacing the direct rand::thread_rng() calls with an explicitly provided RngCore + CryptoRng source of randomness, this allows others to reuse this code without being tied to the rand crate directly.

    This also updates the secp256k1 dependency to a more current version.

    If backward compatibility is a concern, how would you feel about the un-parameterized version of ExtendedPrivKey::random to be available via a feature flag, so that the dependency on rand can be optional?

    opened by nuttycom 1
  • `random_with_seed_size` is producing an empty seed

    `random_with_seed_size` is producing an empty seed

    seed in:

    https://github.com/jjyr/hdwallet/blob/c86ed6a2e35090cc8ca405bf26fd04fec89925ba/src/key.rs#L46-L55

    is a 0-lenght Vec, rng.fill(seed.as_mut_slice()); is a noop (you get a mutable 0-size slice).

    Proper approach is to use a zero-ed vector (vec![0; len]) or after creating a Vec with capacity to use the unsafe set_len (although you have to make sure the bytes aren't being read, as it opens you up to potential memory exploits if they are).

    opened by maciejhirsz 1
  • Updating crates

    Updating crates

    • I'm updating secp256k1 to "0.16" cause some other crates (such as https://crates.io/crates/bitcoin) use it and secp256k1 has c compiled code, so if I add distinct ones it fails linking them;
    • I've removed the minor versions on Cargo.toml cause cargo can manage to get the last version.
    opened by rodoufu 0
  • Updating ring version due to vulnerability problem.

    Updating ring version due to vulnerability problem.

    Closes: #8

    The actual version of the project is pointing to ring = "0.14.0" which has a dependency to spin = "0.5.0" and this version has a vulnerability problem. https://github.com/jjyr/hdwallet/blob/master/Cargo.toml#L20

    It's possible to update the ring to ring = "0.16.9" which is using the spin = "0.5.2" https://github.com/briansmith/ring/blob/master/Cargo.toml#L307

    error: Vulnerable crates found!
    
    ID:	 RUSTSEC-2019-0013
    Crate:	 spin
    Version: 0.5.0
    Date:	 2019-08-27
    URL:	 https://github.com/mvdnes/spin-rs/issues/65
    Title:	 Wrong memory orderings in RwLock potentially violates mutual exclusion
    Solution: upgrade to: >= 0.5.2
    
    opened by rodoufu 0
  • Update ring version due to vulnerability problem

    Update ring version due to vulnerability problem

    The actual version of the project is pointing to ring = "0.14.0" which has a dependency to spin = "0.5.0" and this version has a vulnerability problem. https://github.com/jjyr/hdwallet/blob/master/Cargo.toml#L20

    It's possible to update the ring to ring = "0.16.9" which is using the spin = "0.5.2" https://github.com/briansmith/ring/blob/master/Cargo.toml#L307

    error: Vulnerable crates found!
    
    ID:	 RUSTSEC-2019-0013
    Crate:	 spin
    Version: 0.5.0
    Date:	 2019-08-27
    URL:	 https://github.com/mvdnes/spin-rs/issues/65
    Title:	 Wrong memory orderings in RwLock potentially violates mutual exclusion
    Solution: upgrade to: >= 0.5.2
    
    opened by rodoufu 0
  • bitcoin_hdwallet example error

    bitcoin_hdwallet example error

    The key should be changed to extended_key. Otherwise, it will fail to compile. let (extended_key, derivation) = key_chain.derive_private_key("m/1H/0".into()).expect("derive ExtendedPrivKey"); let key = BitcoinPrivKey { network: BitcoinNetwork::MainNet, derivation, extended_key, };

    opened by yhyuan 0
  • Update secp256k1 to 0.23?

    Update secp256k1 to 0.23?

    The secp256k1 crate updated and has some more developed features, including using a much newer version of the rand crate. It would be nice if we could switch to that to avoid duplicating dependencies.

    opened by wadagso-trey 0
Owner
jjy
Yet another coffee to code compiler
jjy
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
HD wallet BIP-32 related key derivation utilities.

HDWallet Docs HD wallet(BIP-32) key derivation utilities. This crate is build upon secp256k1 crate, this crate only provides BIP-32 related features,

jjy 23 Nov 27, 2022
Collection of Key Derivation Functions written in pure Rust

RustCrypto: Key Derivation Functions Collection of Key Derivation Functions (KDF) written in pure Rust. Supported Algorithms Algorithm Crate Crates.io

Rust Crypto 44 Dec 25, 2022
Key derivation and cryptographic signing functionality for Ethereum applications (ethers-rs)

ethers-signer-factory ethers-signer-factory is a Rust crate that provides functions for key derivation and signing of Ethereum transactions and messag

Ilia 3 Sep 27, 2023
A Bitcoin wallet collider that brute forces random wallet addresses written in Rust.

Plutus-Rustus Bitcoin Brute Forcer A Bitcoin wallet collider that brute forces random wallet addresses written in Rust. This is a straight port of Plu

null 46 Dec 23, 2022
Complete Ethereum and Celo wallet implementation and utilities in Rust

ethers.rs Complete Ethereum and Celo wallet implementation and utilities in Rust Documentation Extensive documentation and examples are available here

Georgios Konstantopoulos 1.5k Jan 8, 2023
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
Kalker (or "kalk") is a calculator program/website that supports user-defined variables, functions, derivation, and integration

Kalker (or "kalk") is a calculator program/website that supports user-defined variables, functions, derivation, and integration. It runs on Windows, macOS, Linux, Android, and in web browsers (with WebAssembly).

null 1.2k Dec 27, 2022
nix2sbom extracts the SBOM (Software Bill of Materials) from a Nix derivation

nix2sbom nix2sbom extracts the SBOM (Software Bill of Materials) from a Nix derivation ?? Documentation for using nix2sbom is here Warning This repo i

null 6 Aug 30, 2023
General basic key-value structs for Key-Value based storages

General basic key-value structs for Key-Value based storages

Al Liu 0 Dec 3, 2022
Key-value cache RESP server with support for key expirations ⌛

BADER-DB (بادِر) Key-value cache RESP server with support for key expirations ⌛ Supported Features • Getting Started • Basic Usage • Cache Eviction •

Mahmoud Salem 7 Apr 21, 2023
⋰·⋰ Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate.

⋰·⋰ Feeless What is Feeless? Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate. This is not the official project for Nano, only an

null 127 Dec 5, 2022
Core Rust-C FFI for Stackmate Wallet.

STACKMATE-CORE A Rust-C FFI library exposing composite functionality from rust-bitcoin & bdk; to create cross-platform descriptor wallets. Currently u

Vishal Menon 5 May 31, 2022
A wallet library for Elements / Liquid written in Rust!

EDK Elements Dev Kit A modern, lightweight, descriptor-based wallet library for Elements / Liquid written in Rust! Inspired by BDK for Elements & Liqu

luca vaccaro 11 Dec 11, 2021
CLI for the Goki Smart Wallet system.

goki-cli CLI for the Goki Smart Wallet system. Installation First, make sure you have the Solana CLI tools installed. Follow the instructions here. Ne

Goki Protocol 18 Jul 18, 2022
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

The Witnet Project 155 Nov 21, 2022
Vectis - Smart Contract Wallet

A smart contract wallet project to add functionality for users of DApps to manage their keys by allowing for recovery and account freeze, whilst preserving user control, and enabling relayer capability for gas provisioning

Nymlab 27 Dec 29, 2022
An example bdk + yew single page web wallet

bdk-yew-example This project builds a simple bdk-wasm based testnet wallet as a single page web app. The page can be hosted locally or automatically d

Steve Myers 2 May 21, 2022
An open source desktop wallet for nano and banano with end-to-end encrypted, on chain messaging using the dagchat protocol.

An open source wallet with end-to-end encrypted, on chain messaging for nano and banano using the dagchat protocol.

derfarctor 22 Nov 6, 2022