Skip to content

staking: Sequentia's coinbase maturity is 1,000 blocks, not Bitcoin's 100 - #10

Merged
GracedEternalKingCabbageMan merged 1 commit into
sequentiafrom
fix/coinbase-maturity
Aug 24, 2026
Merged

GracedEternalKingCabbageMan merged 1 commit into
sequentiafrom
fix/coinbase-maturity

Conversation

@GracedEternalKingCabbageMan

Copy link
Copy Markdown
Collaborator

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 (sequentiaCoinbaseMaturity()), so none of them has to hard-code it
and 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 computed
maturity - depth. One block out here is a wallet that offers a reward for
conversion 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.

… 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
GracedEternalKingCabbageMan merged commit 576d27e into sequentia Aug 24, 2026
11 of 16 checks passed
@GracedEternalKingCabbageMan
GracedEternalKingCabbageMan deleted the fix/coinbase-maturity branch August 24, 2026 01:12
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