Skip to Content
DevelopersPQ Test Vectors

PQ Test Vectors

Tidecoin’s post-quantum behavior is tested with a mix of JSON fixtures, unit tests, and functional tests. Vectors are part of the compatibility contract for other implementations.

This page is for contributors and library authors. It is not the normative signature specification; see Protocol / Signatures.

Vector Locations

File or testCovers
src/test/data/script_tests_pq.jsonPQ script interpreter cases
src/test/data/tx_valid_pq.jsonValid PQ transaction cases
src/test/data/tx_invalid_pq.jsonInvalid PQ transaction cases
src/test/pqhd_kdf_tests.cppPQHD derivation behavior
src/test/pqhd_keygen_tests.cppPQHD deterministic key generation
src/test/pq_multisig_tests.cppPQ multisig behavior
src/test/pq_txsize_tests.cppPQ transaction sizing assumptions
src/test/auxpow_tests.cppAuxPoW validation behavior
test/functional/feature_pq_script_assets.pyScript behavior through node RPC/regtest

Adding a Vector

  1. Identify whether the behavior is consensus, policy, wallet, or integration.
  2. Prefer an existing vector format if one already covers the behavior.
  3. Include both valid and invalid cases when practical.
  4. Add a unit test or functional test that fails without the new vector.
  5. Keep vector data deterministic.
  6. Document the scheme, path, script flag, or activation rule involved.

Cross-Implementation Use

External libraries should use vectors to verify:

  • scheme-prefixed public key parsing;
  • signature encoding and sighash handling;
  • PQHD path and seed derivation;
  • script flag activation behavior;
  • witness v1 SHA-512 script-hash behavior;
  • AuxPoW serialization and validation.

Do not copy wallet secrets from examples into production wallets.

Review Checklist

  • Does the vector cover the activated and non-activated rule if activation matters?
  • Does it test malformed data, not only happy paths?
  • Does it avoid relying on ECDSA or Bitcoin-only descriptor behavior?
  • Does it include the right scheme prefix?
  • Does it have a source test that runs in CI or local test commands?

See also: Testing, Protocol / PQHD, Protocol / Signatures, Protocol / AuxPoW.

Last updated on