Bitcoin Development Mailinglist
 help / color / mirror / Atom feed
* [bitcoindev] BIP54 implementation and test vectors
@ 2025-10-21 15:46 'Antoine Poinsot' via Bitcoin Development Mailing List
  2025-10-27  5:21 ` [bitcoindev] " Antoine Riard
  0 siblings, 1 reply; 4+ messages in thread
From: 'Antoine Poinsot' via Bitcoin Development Mailing List @ 2025-10-21 15:46 UTC (permalink / raw)
  To: Bitcoin Development Mailing List

Hi everyone,

I'd like to give an update on my Consensus Cleanup work, now BIP54.

I opened an implementation against Bitcoin Inquisition v29.1 at [0]. It contains extensive testing
of each of the four proposed mitigations, and was used as a basis to generate test vectors for
BIP54. I opened a PR against the BIPs repository to add them to BIP54 [1].

The test vectors for the transaction-level sigops limit contain a wide variety of usage combinations
as well as ways of running into the limit. They also include some historical violations as well as
pathological transactions demonstrating the implementation details of the sigop accounting logic
(which was itself borrowed from that of BIP16, which all Bitcoin implementations presumably already
have).

The test vectors for the new witness-stripped transaction size restriction similarly exercise the
bounds of the check under various conditions (e.g. transactions with/without a witness). All
historical violations were also added to the test vectors, thanks to Chris Stewart for digging those
up.

Because the new timestamp restrictions are tailor-made to the mainnet difficulty adjustment
parameters, the test vectors for those contain a number of chains of mainnet headers (from genesis).
Each test case contains a full header chain and whether it is valid according to BIP54. These chains
were generated using a custom miner available in [2] and added to the implementation as a JSON data
file.

The test vectors for the coinbase restriction similarly include a chain of mainnet blocks, because
the timelock check is context-dependent. These were generated using a similar miner also available
at [2].

I'm seeking feedback on these test vectors from everybody but in particular developers of
alternative Bitcoin clients, as compatibility with other Bitcoin implementations than Bitcoin Core
was a design goal.

Best,
Antoine Poinsot

[0]: https://github.com/bitcoin-inquisition/bitcoin/pull/99
[1]: https://github.com/bitcoin/bips/pull/2015
[2]: https://github.com/darosior/bitcoin/commits/bip54_miner

-- 
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/V0qeILOW1CuH3NS2O8IUdQBK8i3o8LwzLNGf7xh1UO0S_Gzui1CpdP5NhdT3EtrW6NgqxJ538egeag6bVZoBX8C8E46ZYTCyPg1qBxkwCXs%3D%40protonmail.com.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-10  1:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21 15:46 [bitcoindev] BIP54 implementation and test vectors 'Antoine Poinsot' via Bitcoin Development Mailing List
2025-10-27  5:21 ` [bitcoindev] " Antoine Riard
2025-10-28  9:53   ` 'Antoine Poinsot' via Bitcoin Development Mailing List
2025-11-10  1:40     ` Antoine Riard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox