Module revault_tx::transactions[][src]

Revault transactions

Typesafe routines to create Revault-specific Bitcoin transactions.

We use PSBTs as defined in bip-0174 for data structure as well as roles distribution.

Structs

CancelTransaction

The transaction “revaulting” a spend attempt, i.e. spending the unvaulting transaction back to a deposit txo.

DepositTransaction

The funding transaction, we don’t create nor sign it.

EmergencyTransaction

The transaction spending a deposit output to The Emergency Script.

FeeBumpTransaction

The fee-bumping transaction, we don’t create nor sign it.

SpendTransaction

The transaction spending the unvaulting transaction, paying to one or multiple externally-controlled addresses, and possibly to a new deposit txo for the change.

UnvaultEmergencyTransaction

The transaction spending an unvault output to The Emergency Script.

UnvaultTransaction

The unvaulting transaction, spending a deposit and being eventually spent by a spend transaction (if not revaulted).

Constants

DUST_LIMIT

We refuse to create a stakeholder-pre-signed transaction that would create an output worth less than this amount of sats. This is worth 30€ for 15k€/btc.

INSANE_FEES

We can’t safely error for insane fees on revaulting transactions, but we can for the unvault and the spend. This is 0.2BTC, or 3k€ currently.

REVAULTING_TX_FEERATE

The feerate, in sat / W, to create the revaulting transactions (both emergency and the cancel) with.

TX_VERSION

This enables CSV and is easier to apply to all transactions anyways.

UNVAULT_CPFP_VALUE

The value of the CPFP output in the Unvault transaction. See https://github.com/revault/practical-revault/blob/master/transactions.md#unvault_tx

UNVAULT_TX_FEERATE

The feerate, in sat / W, to create the unvaulting transactions with.

Traits

RevaultTransaction

A Revault transaction.

Functions

spend_tx_from_deposits

Get a spend transaction out of a list of deposits and derivation indexes. The unvault_descriptor will be derived for each and should not be beforehand.

transaction_chain

Get the entire chain of pre-signed transaction out of a deposit. No feebump input.

transaction_chain_manager

Get the chain of pre-signed transaction out of a deposit available for a manager. No feebump input.