btc(#744): gentx_coinbase SSOT assembler -- reconstructor slice 2/7 - #835
Merged
Conversation
…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.
This was referenced Jul 24, 2026
Merged
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ingenerate_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-blockas_blockreconstruction (later slices).Tests
gentx_coinbase_test.cpp-- 3 KATs riding the allowlistedbtc_share_test(no build.yml change):dgb/test/gentx_coinbase_test.cpp(assembler is byte-identical, so a PASS proves emission==oracle);Local
btc_share_test75/75 green (72 + 3).Scope
Single-purpose, confined to the btc tree -- no
src/core/orsrc/impl/bitcoin_family/changes. Additive: does not rewire the consensus verification path this slice.Mirror reference:
src/impl/dgb/coin/gentx_coinbase.hpp.