Witness v1 / P2WSH-512
Status: Built, activates with AuxPoW.
Tidecoin’s witness version 1 uses a 64-byte SHA-512 hash of the witness
script (P2WSH-512) instead of Bitcoin’s 32-byte SHA-256 hash. SHA-512
provides NIST Category 5 post-quantum security under Grover’s algorithm
— twice the margin of SHA-256 — at the cost of a larger program field.
Addresses use the q1 (mainnet) and tq1 (testnet) bech32m HRPs.
This page describes the post-AuxPoW witness/script extension. It is not an address tutorial; for user-facing address guidance, see Addresses.
Activation
Witness v1 / P2WSH-512 is enabled by SCRIPT_VERIFY_WITNESS_V1_512, which is
added at AuxPoW activation height. On mainnet it is built but not active while
AuxPoW remains disabled. On testnet it is active from block 1000. On regtest it
is active from genesis.
Program layout
| Witness type | Version | Program size | Hash |
|---|---|---|---|
| P2WPKH-compatible | 0 | 20 bytes | HASH160 |
| P2WSH-compatible | 0 | 32 bytes | SHA-256 |
| P2WSH-512 | 1 | 64 bytes | SHA-512 |
For P2WSH-512, the witness program is SHA512(witness_script). During
validation, the final witness stack element is the witness script. Tidecoin
computes SHA-512 over that script and compares it to the 64-byte program.
Address HRPs
The configured PQ witness HRP is separate from the standard SegWit HRP:
| Network | Standard bech32 HRP | PQ witness HRP | Common PQ witness form |
|---|---|---|---|
| Mainnet | tbc | q | q1... |
| Testnet | ttbc | tq | tq1... |
| Regtest | rtbc | rq | rq1... |
PQ witness v1 addresses must use Bech32m checksum semantics.
OP_SHA512
OP_SHA512 is opcode 0xb3. When SCRIPT_VERIFY_SHA512 is active, it hashes
the top stack item with SHA-512 and pushes the 64-byte digest. Before activation
it is treated as an upgrade-reserved opcode by the normal script flag rules.
Sighash and script execution
Witness v1 / P2WSH-512 uses its own script execution version,
SigVersion::WITNESS_V1_512. The transaction digest path carries SHA-512
precomputed data for witness v1 inputs.
Standardness and policy
Wallet and mempool policy gate witness v1 PQ outputs before AuxPoW. A wallet
should not create bech32pq outputs before the target height allows them.
Pre-activation transactions using witness v1 PQ outputs are rejected from the
mempool with a pre-AuxPoW policy reason.
Source of truth
| Source | What it defines |
|---|---|
src/script/interpreter.h | SCRIPT_VERIFY_WITNESS_V1_512, SCRIPT_VERIFY_SHA512, SigVersion::WITNESS_V1_512, and 64-byte program size. |
src/script/interpreter.cpp | Witness v1 validation and OP_SHA512 execution. |
src/key_io.cpp | PQ witness address decoding and Bech32m requirement. |
src/validation.cpp | Activation-height flag application and pre-AuxPoW policy rejection. |
See also: Scripts, Addresses, Consensus Rules, Activation Status.