#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

#32 in #fee

Download history 104/week @ 2024-07-21 96/week @ 2024-07-28 95/week @ 2024-08-04 103/week @ 2024-08-11 79/week @ 2024-08-18 85/week @ 2024-08-25 80/week @ 2024-09-01 80/week @ 2024-09-08 91/week @ 2024-09-15 78/week @ 2024-09-22 93/week @ 2024-09-29 63/week @ 2024-10-13 53/week @ 2024-10-20 70/week @ 2024-10-27 66/week @ 2024-11-03

252 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
~869K SLoC