Documentation
¶
Overview ¶
Package encode builds the push frames the bridge sends back up the tunnel.
These are the exact inverse of what the retrieval plane decodes, and the two directions are deliberately kept in one repo so they cannot drift: a subtree that arrives as BRC-143 and one this cluster produced must be byte-identical on the wire.
Every frame is self-verified against the shared codec before it is returned. The lanes carry bare objects — no length prefix, no sync marker — so a frame that sizes wrong would not merely be rejected, it would desynchronise the stream and cost every object behind it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CoinbasePlaceholder = [32]byte{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
}
CoinbasePlaceholder is node 0 of a block's first subtree: 32 bytes of 0xFF standing in for the coinbase, which is carried in-band in the block frame instead. Detected by value, so it must be exact.
Functions ¶
Types ¶
type Block ¶
type Block struct {
Header []byte // 80 bytes, consensus layout
TxCount uint64 // transactions in the block, including the coinbase
SizeInBytes uint64 // serialized block size
SubtreeRoots [][32]byte // ordered, internal byte order
Coinbase []byte // full coinbase transaction, carried in-band
Height uint64
CoinbaseBUMP []byte // BRC-74 merkle path for the coinbase; may be empty
}
Block describes a BRC-144 block push frame.