Open
Conversation
35a852a to
ebe7773
Compare
d4507b0 to
3684103
Compare
3684103 to
0b2ccaa
Compare
Implements automatic coinbase address rotation using HD wallet derivation. After each block is found, the pool/JDC derives a fresh address from an xpub descriptor, ensuring each coinbase output uses a unique address with an unexposed public key. Key features: - Wildcard descriptor support (e.g., wpkh(xpub.../0/*)) - Persistent index file survives restarts - Thread-safe atomic index management - Works with wpkh, tr, and sh(wpkh) descriptors Configuration: - coinbase_reward_script: descriptor with wildcard (e.g., wpkh(tpub.../0/*)) - coinbase_index_file: path to persist current derivation index - coinbase_start_index: initial index if no persistence file exists Validated on testnet4 with 2 blocks mined at indices 4 and 5. Files changed: - stratum-apps: XpubDerivator, wildcard detection in CoinbaseRewardScript - pool: ChannelManager rotation integration - jd-client: Solo mining rotation support
Document the new coinbase rotation configuration options in testnet4 config examples for both pool and JD-client.
- Add detection for testnet extended key prefixes (tpub, tprv, upub, uprv, vpub, vprv) - Set ok_for_mainnet=false for descriptors using testnet keys - Log at info level whether descriptor uses mainnet or testnet keys - Add tests for testnet key detection and ok_for_mainnet validation
0b2ccaa to
b35b5d9
Compare
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.
Adds deterministic address derivation for coinbase outputs using HD wallet descriptors via miniscript crate. Each block found gets a fresh address derived from an extended public key.
This is ideal for privacy and QC resistance.
The code checks for /* in the descriptor via
has_wildcard(). No wildcard = no rotationNew Config Options
Existing configs work unchanged. Defaults preserve current behavior and coinbase_index_file = None means no rotation.
Testnet4 Validation
Two blocks mined on testnet4 (Jan 28, 2026):
Many more blocks have been found using this code. Any TN4 block with signature
whirly-poolis a result of this rotation feature.Blog: https://average-gary.github.io/sv2-apps/