Repository navigation
4.1: derive PoX-5 sBTC recipient from the taproot multisig set in 4.1 - #7833
Open
aaronb-stacks wants to merge 3 commits into
Open
aaronb-stacks wants to merge 3 commits into
aaronb-stacks wants to merge 3 commits into
Conversation
From Epoch 4.1, PoX-5 signer-set computation derives the per-cycle sBTC waterfall recipient from the sBTC registry's `current-signer-set` and `current-signature-threshold` (via `get-current-signer-data`) as an sBTC v2 Taproot script-path multisig deposit, instead of from the registry's WSTS aggregate public key (`get-current-aggregate-pubkey`), which stops being a public key once sBTC rotates to v2 signing (stacks-sbtc/sbtc#2138). The epoch of the block computing the reward set selects the format, so the block-commit output switches at the first reward cycle whose prepare phase begins in Epoch 4.1. The Epoch 4.0 path is unchanged. Adds the BIP-32 signer-key derivation, `multi_a` script, v2 deposit prefix and v2 NUMS constant to `chainstate::stacks::sbtc`, with fixtures pinned to sBTC's published signer-UTXO scriptPubKeys; a consensus test walking the reward sets across the 4.0 -> 4.1 boundary; and a bitcoind integration test for the block-commit switch. This includes a contrib binary for generating test fixtures from the sbtc crate directly, as well as a CI job for verifying that the committed test fixtures match the output of the generator exactly.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The lockfile lacks the newly required hmac 0.12 package entry, so CI and release builds using --locked will fail until the complete workspace lockfile is regenerated and committed.
No open issues 🎉
What changed in this PR
This PR updates PoX-5 reward-set computation to derive sBTC recipients from Taproot multisig signer data in Epoch 4.1, while preserving the Epoch 4.0 aggregate-key path.
Changes:
- Adds epoch-selected v2 deposit derivation, including signer-key derivation and multisig scripts.
- Adds reference fixtures, property tests, and consensus and bitcoind transition tests.
- Adds a pinned upstream fixture generator and CI reproducibility checks.
| File | Description |
|---|---|
stackslib/src/net/api/getpoxinfo.rs |
Updates registry-method comments only. |
stackslib/src/core/mod.rs |
Adds v2 internal-key and signer-limit constants. |
stackslib/src/config/mod.rs |
Documents epoch-dependent registry reads. |
stackslib/src/chainstate/tests/mod.rs |
Extends registry stubs with signer data. |
stackslib/src/chainstate/tests/consensus.rs |
Tests recipient selection across epoch activation. |
stackslib/src/chainstate/stacks/sbtc.rs |
Implements and tests v2 deposit derivation. |
stackslib/src/chainstate/stacks/fixtures/sbtc-v2.json |
Adds upstream-derived reference fixtures. |
stackslib/src/chainstate/nakamoto/signer_set.rs |
Selects recipient derivation by computing epoch. |
stackslib/Cargo.toml |
Adds HMAC for signer-key derivation. |
stacks-node/src/tests/signer/v0/mod.rs |
Extends integration-test registry stubs. |
stacks-node/src/tests/signer/v0/epoch_4_0_waterfall.rs |
Adds a bitcoind recipient-switch test. |
stacks-node/src/tests/nakamoto_integrations.rs |
Adds an Epoch 4.1 activation helper. |
stacks-common/src/types/tests.rs |
Tests deposit-format activation. |
stacks-common/src/types/mod.rs |
Defines epoch-specific deposit formats. |
contrib/tools/sbtc-fixtures/src/main.rs |
Generates fixtures using upstream sBTC. |
contrib/tools/sbtc-fixtures/README.md |
Documents generation and reproducibility checks. |
contrib/tools/sbtc-fixtures/inputs.json |
Defines seven fixture input cases. |
contrib/tools/sbtc-fixtures/Cargo.toml |
Defines the standalone generator and dependencies. |
contrib/tools/sbtc-fixtures/Cargo.lock |
Locks generator dependencies. |
changelog.d/epoch-4-1-sbtc-taproot-multisig.changed |
Describes the recipient-format transition. |
Cargo.lock |
Adds the workspace HMAC dependency reference. |
.github/workflows/check-sbtc-fixtures.yml |
Checks fixture regeneration byte for byte. |
Review effort: Balanced
Change the sbtc contract stub for tests which require booting through 4.1 -- this preserves the hashes in the snap consensus tests for <= 4.0 by separating out the tests that boot to 4.1
This branch has not been deployed
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.
From Epoch 4.1, PoX-5 signer-set computation derives the per-cycle sBTC waterfall recipient from the sBTC registry's
current-signer-setandcurrent-signature-threshold(viaget-current-signer-data) as an sBTC v2 Taproot script-path multisig deposit, instead of from the registry's WSTS aggregate public key (get-current-aggregate-pubkey), which stops being a public key once sBTC rotates to v2 signing (stacks-sbtc/sbtc#2138).The epoch of the block computing the reward set selects the format, so the block-commit output switches at the first reward cycle whose prepare phase begins in Epoch 4.1. The Epoch 4.0 path is unchanged.
This PR adds:
multi_ascript, v2 deposit prefix and v2 NUMS constant tochainstate::stacks::sbtc