#wallet #bitcoin #descriptor #features #particular #metadata #flags

bitcoinwallet-feature

tools for managing particular wallet features -- descriptors can contain wallet metadata

2 releases

0.1.16-alpha.0 Apr 2, 2023
0.1.12-alpha.0 Jan 19, 2023

#15 in #particular

Download history 76/week @ 2024-06-26 39/week @ 2024-07-03 78/week @ 2024-07-10 123/week @ 2024-07-17 76/week @ 2024-07-24 80/week @ 2024-07-31 99/week @ 2024-08-07 67/week @ 2024-08-14 65/week @ 2024-08-21 73/week @ 2024-08-28 66/week @ 2024-09-04 68/week @ 2024-09-11 70/week @ 2024-09-18 97/week @ 2024-09-25 27/week @ 2024-10-02 13/week @ 2024-10-09

208 downloads per month
Used in 40 crates (4 directly)

MIT license

525KB
2K SLoC

WalletFeature

This Rust crate provides functionality for working with Bitcoin wallet features. Wallet features are a way for wallets to communicate which capabilities they support, and for other components of the Bitcoin system to query and respond to these capabilities.

The WalletFeature struct represents a wallet feature and provides methods for checking if the feature is supported and for obtaining the closest supported feature. The WalletFlags struct is used to represent the set of supported features in a wallet.

The is_feature_supported function can be used to check if a particular wallet feature is supported by a given set of flags.

The get_closest_wallet_feature function can be used to obtain the closest supported feature to a given feature. This can be useful for negotiating capabilities between different components of the Bitcoin system.

WalletDescriptor

The WalletDescriptor struct represents a descriptor for a Bitcoin wallet. It provides methods for serializing and deserializing the descriptor.

The descriptor contains information about the wallet's keys, such as the public key and the derivation path, and can be used to generate Bitcoin addresses and to sign transactions.

Notice

This crate is part of a direct translation from C++ to Rust of the Bitcoin Core. As such, some of the function bodies may still be in the process of translation. Please note that this system will become testable once the translation process is complete.

45> which features distinguish wallets?

Wallets can differ in various ways, such as:

  1. Multi-signature support: Wallets can support the use of multiple signatures to authorize transactions, which can add an extra layer of security.

  2. Hierarchical Deterministic (HD) keys: HD wallets use a deterministic algorithm to generate a sequence of public/private key pairs from a single master seed. This allows for more convenient and secure key management, as well as easier backup and restoration of a wallet.

  3. Payment Protocol support: Payment Protocol is a system for securely transmitting payment requests and verifying payment details. Wallets that support this feature can offer more secure and reliable payments.

  4. Custom transaction fee settings: Wallets can allow users to customize the transaction fees they pay for sending bitcoin, allowing for faster confirmation times or lower fees.

  5. Privacy features: Some wallets prioritize privacy by implementing features such as coin control (allowing users to choose which specific coins are used in transactions) and support for privacy-focused cryptocurrencies like Monero.

  6. Lightning Network support: The Lightning Network is a second-layer protocol on top of the Bitcoin network that allows for near-instant, low-cost transactions. Wallets that support Lightning Network can offer faster and cheaper transactions.

  7. Script support: Bitcoin scripting allows for more complex and programmable transactions, enabling more advanced use cases and smart contracts. Wallets that support more advanced scripts can enable more complex transactions.

These are just a few examples of the features that can distinguish different bitcoin wallets.

46> what are some others?

There are many other features that distinguish wallets, depending on the specific use case and implementation. Here are a few examples:

  1. Multi-signature support: A wallet with multi-signature support allows for multiple parties to sign a transaction, increasing security by requiring a consensus among multiple parties.

  2. Hierarchical Deterministic (HD) wallets: An HD wallet is a type of wallet that generates a tree-like structure of key pairs from a single root key, providing a convenient and secure way to manage multiple accounts or addresses.

  3. Coin control: Coin control allows the user to specify which specific inputs to use when sending a transaction, giving the user more control over the transaction and potentially reducing fees.

  4. Segregated Witness (SegWit) support: SegWit is a soft fork upgrade to the Bitcoin protocol that improves transaction throughput and reduces transaction fees. A wallet that supports SegWit can take advantage of these benefits.

  5. Lightning Network support: The Lightning Network is a layer 2 payment protocol built on top of the Bitcoin blockchain that allows for fast, cheap, and scalable transactions. A wallet that supports the Lightning Network can utilize this technology to send and receive Bitcoin more efficiently.

Dependencies

~100MB
~873K SLoC