Skip to content

btc(#744): gentx_coinbase SSOT assembler -- reconstructor slice 2/7 - #835

Merged
frstrtr merged 1 commit into
masterfrom
btc/gentx-coinbase-ssot
Jul 25, 2026
Merged

btc(#744): gentx_coinbase SSOT assembler -- reconstructor slice 2/7#835
frstrtr merged 1 commit into
masterfrom
btc/gentx-coinbase-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Reconstructor slice 2/7 (faithful BTC share->block, mirrors DGB leaf-first). Follows #822 (slice 1, gentx_unpack).

What

Adds btc::coin::assemble_gentx_coinbase() (src/impl/btc/coin/gentx_coinbase.hpp): the single non-witness coinbase (gentx) wire layout -- version | vin(coinbase) | [segwit_commitment?] ++ payouts ++ donation ++ op_return | locktime -- returning {bytes, txid=SHA256d(bytes)}. Byte-identical to the inline emitter in generate_share_transaction() (share_check.hpp:965, the verification SSOT), but pure (no tracker/template deps) so it is directly KAT-able and reusable by won-block as_block reconstruction (later slices).

Tests

gentx_coinbase_test.cpp -- 3 KATs riding the allowlisted btc_share_test (no build.yml change):

  • no-segwit + witness-commitment-first layouts locked against coin-agnostic oracle (bytes,txid) vectors, shared verbatim with dgb/test/gentx_coinbase_test.cpp (assembler is byte-identical, so a PASS proves emission==oracle);
  • segwit-predicate isolation guard.

Local btc_share_test 75/75 green (72 + 3).

Scope

Single-purpose, confined to the btc tree -- no src/core/ or src/impl/bitcoin_family/ changes. Additive: does not rewire the consensus verification path this slice.

Mirror reference: src/impl/dgb/coin/gentx_coinbase.hpp.

…s+txid

Reconstructor slice 2/7. Adds btc::coin::assemble_gentx_coinbase()
(src/impl/btc/coin/gentx_coinbase.hpp): the single non-witness coinbase
(gentx) wire layout -- version|vin(coinbase)|[segwit_commitment?]++payouts
++donation++op_return|locktime -- returning {bytes, txid=SHA256d(bytes)}.
Byte-identical to the inline emitter in generate_share_transaction()
(share_check.hpp:965); pure (no tracker/template deps) so it is directly
KAT-able and reusable by won-block as_block reconstruction.

gentx_coinbase_test.cpp (3 KATs, ride allowlisted btc_share_test): no-segwit
+ witness-commitment-first layouts locked against coin-agnostic oracle
(bytes,txid) vectors, shared verbatim with dgb gentx_coinbase_test; plus the
segwit-predicate isolation guard. btc_share_test 75/75 local.
@frstrtr
frstrtr merged commit 3fc1213 into master Jul 25, 2026
26 checks passed
frstrtr added a commit that referenced this pull request Jul 25, 2026
Resolve btc test CMakeLists conflict by unioning the btc_share_test source
list: keep both gentx_coinbase_test.cpp (slice 2/7, landed via #835) and
block_assembly_test.cpp (slice 4/7, this branch).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant