SPB Git

Repository Public

README.md 1.4 KB

# security/vectors/bchn — Bitcoin Cash Node signature-hash vectors (third-party material)

Not SP Boucher code: MIT licence of Bitcoin Cash Node (COPYING, stored next to the vectors), no SP Boucher header. ../MANIFEST.json pins the SHA-256 of each file.

File Source Pinned revision
sighash.json.gz https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node src/test/data/sighash.json 07576013c91ff4a3a74acd85f189c69121cdad1b (tag v29.2.0)
COPYING same repository same

sighash.json is stored gzip-compressed with a zero timestamp (reproducible bytes). Format: a header row, then 1000 rows [raw transaction, script, input index, hash type, digest (regular), digest (no fork flag)]:

  • the hash type is a random signed 32-bit integer (all 32 bits are serialized in the preimage);
  • "digest (regular)" is SignatureHash with SCRIPT_ENABLE_SIGHASH_FORKID: the BIP-143-style algorithm of Bitcoin Cash when bit 0x40 of the hash type is set, the original algorithm otherwise — computed with amount 0: the file carries no amounts;
  • "digest (no fork flag)" is the original algorithm for every row (which never uses an amount);
  • digests are written in the byte order of uint256::GetHex (reversed).

Replayed by security/tests/Tests/ConformanceAuditTests/UTXOCoinsVectors.swift, which states how many rows the public interface of the engine can express and how many only its internal preimage function can.

Files main
Menu

Theme