staking: Sequentia's coinbase maturity is 1,000 blocks, not Bitcoin's 100 - #10
Merged
Merged
Conversation
… 100 Found by running a node against the live testnet: a reward with 60 confirmations reported 941 blocks still to wait. Every light wallet was passing 100, which would have called that reward spendable 900 blocks early and then built a transaction the chain rejects. COINBASE_MATURITY is a number of BLOCKS, so what it protects drifts with the cadence: 100 blocks at Bitcoin's 600 seconds is 16h40m, while the same 100 on a 60-second chain is 100 minutes -- a tenth of the protection. Sequentia holds the WALL-CLOCK figure equal to Bitcoin's instead of the block count, which at 60s means 1,000. It matters more here than on Bitcoin, because Sequentia has no block subsidy and the coinbase carries the producer's fee income rather than new issuance. The figure is now a constant next to the attribution that uses it, and exposed to the wallets, so none of them has to hard-code it and none of them can hard-code it wrong. The same run turned up an off-by-one. A coinbase is spendable when its depth EXCEEDS the maturity, not when it equals it, so the node computes maturity + 1 - depth. This computed maturity - depth, and one block out here is a wallet that offers a reward for conversion one block before the chain will accept the spend.
GracedEternalKingCabbageMan
merged commit Aug 24, 2026
576d27e
into
sequentia
11 of 16 checks passed
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.
Found by running a node against the live testnet: a reward with 60
confirmations reported 941 blocks still to wait. Every light wallet was
passing
100, which would have called that reward spendable 900 blocks earlyand then built a transaction the chain rejects.
COINBASE_MATURITYis a number of blocks, so what it protects drifts with thecadence: 100 blocks at Bitcoin's 600 seconds is 16h40m, while the same 100 on a
60-second chain is 100 minutes — a tenth of the protection. Sequentia holds the
wall-clock figure equal to Bitcoin's instead of the block count, which at 60s
means 1,000. It matters more here than on Bitcoin, because Sequentia has no block
subsidy and the coinbase carries the producer's fee income rather than new
issuance.
The figure is now a constant next to the attribution that uses it, and exposed to
the wallets (
sequentiaCoinbaseMaturity()), so none of them has to hard-code itand none of them can hard-code it wrong.
And an off-by-one, from the same run
A coinbase is spendable when its depth exceeds the maturity, not when it
equals it — the node computes
maturity + 1 - depth. This computedmaturity - depth. One block out here is a wallet that offers a reward forconversion one block before the chain will accept the spend.
Testing
19 tests pass, including a new one that pins both: the constant is 1,000, and a
reward 60 deep reports exactly the 941 the live node reported.