#transaction #bitcoin #replace #rbf #state #protocols #fee

bitcoin-rbf

replace-by-fee state, enforcement, and utilities

2 releases

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

#34 in #fee

Download history 111/week @ 2024-08-31 79/week @ 2024-09-07 62/week @ 2024-09-14 108/week @ 2024-09-21 93/week @ 2024-09-28 62/week @ 2024-10-12 54/week @ 2024-10-19 68/week @ 2024-10-26 67/week @ 2024-11-02 23/week @ 2024-11-09 33/week @ 2024-11-16 91/week @ 2024-11-23 107/week @ 2024-11-30 161/week @ 2024-12-07 98/week @ 2024-12-14

457 downloads per month
Used in 49 crates (4 directly)

MIT license

740KB
1.5K SLoC

bitcoin-rbf

Bitcoin-RBF is a Rust crate that provides support for the Replace-By-Fee (RBF) transaction protocol in the Bitcoin system. This crate is part of a direct translation of the Bitcoin codebase from C++ to Rust, and is currently in the process of translation. It is possible that some function bodies are still being translated.

The RBF protocol is a mechanism that allows Bitcoin transactions to be replaced with new versions that pay higher fees. This can be useful in situations where a transaction is not being confirmed quickly enough due to low fees, and the sender wishes to speed up the process by paying a higher fee. The RBF protocol allows the sender to create a new version of the transaction with a higher fee, and signal to the network that the new version should replace the old one.

The RBFTransactionState struct provided by this crate represents the current state of an RBF-enabled Bitcoin transaction. The is_rbf_opt_in function can be used to determine whether a transaction is eligible for RBF replacement, and the pays_forrbf function can be used to determine whether a transaction pays for its own RBF replacement. The signals_opt_inrbf function can be used to determine whether a transaction signals that it is willing to be replaced by a later version that pays a higher fee.

While there may not be any specific mathematical equations or concepts involved in the bitcoin-rbf crate, the RBF protocol is an important aspect of the Bitcoin system and relies on various cryptographic techniques to ensure the security and integrity of the network. The ability to replace transactions with new versions that pay higher fees requires careful handling of private keys and digital signatures to ensure that the replacement transaction is legitimate and not the result of a malicious attack.

Dependencies

~95MB
~870K SLoC