Tone Engel (tone@projectbabbage.com)
The BEEF serialization format (as defined in BRC-62) is essentially two things:
- An array of mined transaction proof validation data (BUMPS BRC-74)
- An array serialized Bitcoin transactions
In practical use, BEEFs are exchanged between parties to build and process new transactions as well as validate arbitrary data recorded on the blockchain.
The extension proposed here is to allow for "agreed upon transactions" to be represented in the array of transactions as just their transaction hash (txid),
This avoids the need to include potentially significant amounts of data already known to the parties exchanging BEEFs.
In addition, this extension formally acknowledges that a BEEF may contain mulitple transaction "roots".
Consider when two parties cooperate over a short amount of time to construct one or more transactions.
Inputs may be added by either party. New inputs may come from unmined and mined transactions.
At each exchange of information along this process, one party sends a BEEF to the other to validate the new inputs or transaction(s) they originate.
The BEEF standard is well suited to this with two extensions:
- In the general case, a BEEF does not need to be a single transaction tree.
- A method of referencing what the process has previously validated.
For example, when adding new inputs to an incomplete transaction, the set of source transactions for these inputs may need to be transmitted to a second party. A BEEF of this validation information might include multiple trees of unmined transactions.
Furthermore, some of these inputs might be from transactions created earlier in the process for which complete validation data - back to mined transactions - has already been shared.
Consider in particular if some of these transactions are truly large or if the rate of linked transaction generation is high.
The serialized format for the transaction array is updated and the BEEF version number is incremented to 0200BEEF
.
For each serialized transaction, the byte previously used to indicate BUMP (01
) or no BUMP (00
) is renamed the Tx Data Format,
it is now the first thing written for each transaction,
and the value of (02
) is now used when only a 32 byte txid is serialized.
Field | Description | Size |
---|---|---|
Version no | Version number starts at 4022206466, encoded Uint32LE => 0200BEEF |
4 bytes |
nBUMPs | VarInt number of BSV Unified Merkle Paths which follow | 1-9 bytes |
BUMP data | All of the BUMPs required to prove inclusion of inputs in longest chain of blocks BRC-74 | many bytes x nBUMPs |
nTransactions | VarInt number of transactions which follow | 1-9 bytes |
Tx Data Format | 00 raw transaction without BUMP index; 01 raw transaction followed by BUMP index; 02 txid only |
1 byte |
BUMP index | Format 01 : VarInt index number indicating the BUMP to which Raw Transaction belongs. |
1-9 bytes |
Raw Transaction | Format 00 or 01 : RawTx bytes as in standard format BRC-12 |
many bytes |
txid only | Format 02 : 32 byte transaction hash in reverse byte order |
32 bytes |
A txid only transaction is treated as implicitly valid, no raw transaction or BUMP index is included and no BUMP data is required.
Additional transactions that consume outputs from a txid only transaction treat those inputs as fully validated.
The ordering of transactions obeys the V1 rules: Parents, including txid only, must occur before children.
The essential function of the BEEF format is to efficiently represent transaction validation data.
When multiple beefs are merged, all common BUMPS, merkle paths, and parent transactions are collapsed to a single copy.