#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 83/week @ 2024-01-02 110/week @ 2024-01-09 93/week @ 2024-01-16 63/week @ 2024-01-23 21/week @ 2024-01-30 68/week @ 2024-02-06 108/week @ 2024-02-13 124/week @ 2024-02-20 103/week @ 2024-02-27 93/week @ 2024-03-05 130/week @ 2024-03-12 121/week @ 2024-03-19 224/week @ 2024-03-26 153/week @ 2024-04-02 88/week @ 2024-04-09 133/week @ 2024-04-16

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

MIT license

1MB
3K 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
~859K SLoC