2 releases
0.1.16-alpha.0 | Apr 2, 2023 |
---|---|
0.1.12-alpha.0 | Jan 19, 2023 |
#19 in #particular
378 downloads per month
Used in 40 crates
(4 directly)
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:
-
Multi-signature support: Wallets can support the use of multiple signatures to authorize transactions, which can add an extra layer of security.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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:
-
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.
-
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.
-
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.
-
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.
-
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
~99MB
~881K SLoC