Skip to Content
ProtocolAddresses

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

NetworkP2PKH prefixP2SH prefixAlternate P2SH prefixWIF prefixWitness v0 HRPPQ witness v1 HRP
Mainnet337065125tbcq
Testnet92132127180ttbctq
Regtest11718612215rtbcrq

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.

DestinationPayloadScript template
Key hashHASH160(serialized_pq_public_key)OP_DUP OP_HASH160 <20-byte key hash> OP_EQUALVERIFY OP_CHECKSIG
Script hashHASH160(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 versionProgram sizeDestination
020 bytesWitness v0 key hash
032 bytesWitness 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 versionProgram sizeDestination
164 bytesWitness 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:

  1. Try Base58Check with the active network’s Base58 prefixes.
  2. If the string has a matching witness HRP, decode it as bech32 or bech32m.
  3. For legacy witness HRPs, require witness version 0 and bech32.
  4. For PQ witness HRPs, require witness version 1 and bech32m.
  5. 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

TopicSource
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.

Last updated on