#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

#31 in #fee

Download history 255/week @ 2024-03-28 78/week @ 2024-04-04 149/week @ 2024-04-11 120/week @ 2024-04-18 126/week @ 2024-04-25 112/week @ 2024-05-02 115/week @ 2024-05-09 114/week @ 2024-05-16 116/week @ 2024-05-23 108/week @ 2024-05-30 68/week @ 2024-06-06 90/week @ 2024-06-13 139/week @ 2024-06-20 57/week @ 2024-06-27 58/week @ 2024-07-04 101/week @ 2024-07-11

355 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

~96MB
~867K SLoC