Address Formats
Tidecoin uses Bitcoin-style destination encoding with Tidecoin-specific network prefixes. Base58Check addresses are used for legacy key-hash and script-hash destinations. Bech32 addresses are used for witness v0. Bech32m addresses with a separate PQ HRP are used for witness v1 P2WSH-512 destinations.
This page is the protocol reference for address decoding and encoding. For a plain-language explanation, see Address Formats Explained. For the script templates behind these addresses, see Scripts.
Network prefixes
| Network | P2PKH prefix | P2SH prefix | Alternate P2SH prefix | WIF prefix | Witness v0 HRP | PQ witness v1 HRP |
|---|---|---|---|---|---|---|
| Mainnet | 33 | 70 | 65 | 125 | tbc | q |
| Testnet | 92 | 132 | 127 | 180 | ttbc | tq |
| Regtest | 117 | 186 | 122 | 15 | rtbc | rq |
The decoder accepts both script-hash prefixes for a network. The encoder
uses the alternate script-hash prefix for ScriptHash destinations.
Base58Check destinations
Base58Check addresses encode a one-byte network prefix plus a 20-byte HASH160 payload, followed by the Base58Check checksum.
| Destination | Payload | Script template |
|---|---|---|
| Key hash | HASH160(serialized_pq_public_key) | OP_DUP OP_HASH160 <20-byte key hash> OP_EQUALVERIFY OP_CHECKSIG |
| Script hash | HASH160(serialized_redeem_script) | OP_HASH160 <20-byte script hash> OP_EQUAL |
The serialized PQ public key includes its one-byte scheme prefix. That means a key-hash address commits to the scheme-tagged public key bytes, not just the raw scheme public key.
Witness v0 addresses
Witness v0 addresses use the legacy bech32 HRP for the network:
tbc, ttbc, or rtbc. They must use the original bech32 checksum, not
bech32m.
| Witness version | Program size | Destination |
|---|---|---|
0 | 20 bytes | Witness v0 key hash |
0 | 32 bytes | Witness v0 script hash |
The output script is:
OP_0 <witness_program>PQ witness v1 addresses
PQ witness v1 addresses use the PQ HRP for the network: q, tq, or
rq. They must use bech32m and must carry witness version 1.
| Witness version | Program size | Destination |
|---|---|---|
1 | 64 bytes | Witness v1 script hash, also called P2WSH-512 |
The output script is:
OP_1 <64-byte SHA512(witness_script)>The witness program is exactly the 64-byte SHA-512 hash of the witness
script. A PQ HRP address with witness version 0, a legacy HRP address
with witness version 1, the wrong checksum family, or a program length
other than 64 bytes is invalid.
Decoding rules
Address validation should follow the same order as the node:
- Try Base58Check with the active network’s Base58 prefixes.
- If the string has a matching witness HRP, decode it as bech32 or bech32m.
- For legacy witness HRPs, require witness version
0and bech32. - For PQ witness HRPs, require witness version
1and bech32m. - Convert the 5-bit witness payload back to bytes and check the exact program size for the witness version.
Do not infer the network from the address body alone. Use the configured chain parameters and reject addresses whose prefixes do not match that network.
Activation and wallet policy
Base58Check and witness v0 destinations are the live compatibility
surface. PQ witness v1 P2WSH-512 is implemented in consensus code and is
enabled by the post-AuxPoW script flag
SCRIPT_VERIFY_WITNESS_V1_512. On mainnet, AuxPoW is currently disabled,
so production wallet flows should not present PQ witness v1 as a spendable
mainnet default until activation is scheduled and deployed.
Source of truth
| Topic | Source |
|---|---|
| Chain prefixes and HRPs | ../tidecoin/src/kernel/chainparams.cpp |
| Address encoder and decoder | ../tidecoin/src/key_io.cpp |
| Destination script templates | ../tidecoin/src/addresstype.cpp |
| Witness v1 program size | ../tidecoin/src/script/interpreter.h |
| PQ address round-trip tests | ../tidecoin/src/test/key_io_tests.cpp |
See also: Scripts, Witness V1 SHA-512, Signature Encoding, Address Validation.