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 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
⋰·⋰ 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
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 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
MyCitadel Wallet app for Linux, Windows & MacOS desktop made with GTK+

MyCitadel Desktop Bitcoin, Lightning and RGB wallet MyCitadel is a wallet for bitcoin, digital assets and bitcoin finance (#BiFi) smart contracts. It

My Citadel 88 Jan 2, 2023
MevWallet is a smart contract wallet that allows the user to capture MEV from Searchers, or create MEV on purpose.

MevWallet MevWallet is a smart contract wallet that allows the user to capture MEV from Searchers, or create MEV on purpose. This repo contains the so

Blunt Instruments 94 Jan 26, 2023
Minimal Bitcoin wallet intended for teaching rust-bitcoin

Insanely minimal Bitcoin wallet intended for demonstration of Rust Bitcoin ecosystem Absolutely DO NOT use with mainnet funds!!! No privacy - address

Martin Habovštiak 4 May 5, 2023
Modern, lightweight & standard-compliant bitcoin wallet runtime & cli without rust-bitcoin dependencies

Bitcoin protocol command-line wallet & tools Modern, minimalistic & standard-compliant cold wallet from LNP/BP Standards Association. Contributing Con

BP: Bitcoin protocol 3 Jul 31, 2023
Radix Babylon vanity address finder allowing easy import into Radix mobile Wallet.

Rad Vanity address finder for Radix Babylon which you can import directly into your Radix Wallet using QR scanner using Import from a Legacy Wallet fe

Alexander Cyon 6 Nov 13, 2023
Automated Solana tool for quick arbitrage, customizable, with real-time data and wallet integration. Trade responsibly.

Solana Arbitrage Trading Tool The Solana Arbitrage Trading Tool is an automated solution crafted to spot and capitalize on arbitrage opportunities wit

null 43 Mar 12, 2024
🧩Creating a blockchain wallet and integrating a couple of cryptographic algorithms to securely save the secrets.🧩

Rust Library For Cryptocurrency Wallet Folder Structure src : contains the source code of the library examples : contains some examples of the library

rstkey 3 Aug 12, 2024
Prototype: ORAM and related for Intel SGX enclaves

mc-oblivious Traits and implementations for Oblivious RAM inside of Intel SGX enclaves. The scope of this repository is: Traits for fast constant-time

MobileCoin 37 Nov 23, 2022
Cryptography-related format encoders/decoders: PKCS, PKIX

RustCrypto: Formats Cryptography-related format encoders/decoders: PKCS, PKIX. Crates Name crates.io Docs Description base64ct Constant-time encoder a

Rust Crypto 112 Dec 20, 2022
Traits - Collection of cryptography-related traits

RustCrypto: Traits Collection of traits which describe functionality of cryptographic primitives. Crates Name Algorithm Crates.io Docs MSRV aead Authe

Rust Crypto 401 Dec 27, 2022