Skip to Content
ProtocolTransactions

Transactions

Tidecoin keeps Bitcoin’s UTXO transaction model and serialization shape: version, inputs, outputs, optional witness data, and locktime. The protocol differences are in the scripts, witness programs, and post-quantum signature/public-key material carried by those scripts.

This page defines transaction structure. It is not the signature scheme registry; for schemes and byte sizes, see Scheme Registry. It is not the script reference; for opcodes and witness program semantics, see Scripts.

Serialized structure

Non-witness transactions use the classic form:

nVersion vin[] vout[] nLockTime

Transactions with witness data use the segwit serialization form:

nVersion marker flag vin[] vout[] witnesses[] nLockTime

The txid is the transaction hash without witness data. The witness hash or wtxid includes the witness serialization. Tidecoin preserves this Bitcoin distinction.

Inputs

Each input spends a previous output and carries unlocking data:

previous_txid previous_output_index scriptSig nSequence

For legacy key-hash spends, scriptSig commonly carries the signature stack data. For witness spends, scriptSig is empty or carries only the nested redeem script, and the actual signatures/scripts are in the input witness.

Outputs

Each output carries an amount and a locking script:

nValue scriptPubKey

Common Tidecoin output templates include:

Output typeScriptPubKey shapeAddress family
Key hashOP_DUP OP_HASH160 <20-byte key hash> OP_EQUALVERIFY OP_CHECKSIGBase58Check P2PKH-style
Script hashOP_HASH160 <20-byte script hash> OP_EQUALBase58Check P2SH-style
Witness v0 key hashOP_0 <20-byte key hash>bech32 witness v0
Witness v0 script hashOP_0 <32-byte script hash>bech32 witness v0
Witness v1 script hash 512OP_1 <64-byte SHA512(witness_script)>bech32m PQ witness v1

Witness v1 script-hash-512 outputs are implemented but gated by the post-AuxPoW rule set on mainnet.

PQ public keys and signatures

Tidecoin identifies a PQ signature scheme through the serialized public key. The public key layout is:

scheme_prefix || raw_scheme_public_key

The signature does not carry a separate Tidecoin scheme prefix. The verifier reads the public-key prefix, selects the scheme, and verifies the signature bytes for that scheme.

For script paths that use a standard sighash byte, the signature stack item is:

scheme_signature || sighash_type

The sighash byte is part of script transaction-signing semantics. It is not part of the raw Falcon or ML-DSA signature passed to the scheme verifier.

Typical witness stacks

Spend pathWitness stack shape
Witness v0 key hash<signature+sighash> <prefixed_pq_public_key>
Witness v0 script hash<satisfying stack items...> <witness_script>
Witness v1 script hash 512<satisfying stack items...> <witness_script>

Inside witness scripts, OP_CHECKSIG and multisig-style constructions consume PQ signatures and prefixed PQ public keys according to the active signature verification mode.

Size drivers

PQ transactions are larger than classical ECDSA/Schnorr transactions because public keys and signatures are larger. The most important size drivers are:

SchemeSerialized public key bytesPadded or fixed signature bytesScript signature bytes with sighash
Falcon-512898666667
Falcon-10241,7941,2801,281
ML-DSA-441,3132,4202,421
ML-DSA-651,9533,3093,310
ML-DSA-872,5934,6274,628

Fee estimation and integration code should calculate sizes from the actual script and witness stack, not from classical Bitcoin assumptions.

Sighash semantics

Witness v0 follows the Bitcoin-style witness sighash path. Witness v1 P2WSH-512 uses the Tidecoin witness-v1 signature version and SHA-512 hashing internally for the transaction digest components. The accepted sighash types remain the standard transaction-signing modes such as SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, and SIGHASH_ANYONECANPAY.

Source of truth

TopicSource
Transaction serialization and witness hashes../tidecoin/src/primitives/transaction.h, ../tidecoin/src/core_write.cpp
Address and script templates../tidecoin/src/addresstype.cpp, ../tidecoin/src/script/solver.cpp
PQ key/signature sizes../tidecoin/src/pq/pq_scheme.h
Signature dispatch../tidecoin/src/key.cpp, ../tidecoin/src/pubkey.cpp, ../tidecoin/src/pq/pq_api.h
Witness v1 signature hashing../tidecoin/src/script/interpreter.cpp

See also: Signatures, Signature Encoding, Scripts, Witness V1 SHA-512, Addresses.

Last updated on