Reference / Protocol

Ravelnonce testnet protocol

This page separates the issuance facts already present in the checked-in project tests from implementation choices made for the first runnable testnet node. The latter are testnet rules, not recovered report text or approved mainnet parameters.

Checked-in issuance facts

Initial subsidy
12.5 Ravelnonce / 1,250,000,000 atoms
Atomic-unit conversion
100,000,000 atoms per Ravelnonce
Halving interval
Every 840,000 mined blocks
Scheduled total
2,099,999,990,760,000 atoms

Genesis is height 0 and has no subsidy. Valid mined blocks begin at height 1. Heights 1 through 840,000 receive the initial subsidy; each following era begins after exactly 840,000 mined blocks.

Subsidies are floored to whole atoms. The rule is subsidy_atoms(h) = floor(1,250,000,000 / 2^floor((h-1)/840,000)) for h ≥ 1. When the result reaches zero, no subsidy is created; there is no tail emission.

Preserved boundary vectors

Mined block heightSubsidy (atoms)
1 and 840,0001,250,000,000
840,001625,000,000
1,680,001312,500,000
6,720,0014,882,812
25,200,001 and 26,040,0001
26,040,0010

Flooring each era produces exactly 2,099,999,990,760,000 atoms (20,999,999.9076 Ravelnonce), below the 21,000,000 nominal limit. The unit tests retain these boundary values and the full scheduled sum.

Ravelnonce testnet implementation choice

Network identity and keys

Canonical bytes and identifiers

All fixed-width unsigned integers and length prefixes use big-endian byte order. UTF-8 is used for the chain ID; API atom amounts are canonical base-10 integer strings. Unknown JSON fields, unknown type/version values, non-canonical integer strings, and malformed lengths are rejected.

EncodingByte layout, in order
Transaction, regularu8 type=1 | u16 version | u8 chain length + UTF-8 chain ID | u16 input count | inputs | u16 output count | outputs
Regular input32-byte txid | u32 output index | 32-byte Ed25519 public key | 64-byte Ed25519 signature
Transaction, coinbaseu8 type=0 | u16 version | u8 chain length + UTF-8 chain ID | u64 height | u64 extra nonce | u16 output count | outputs
Outputu64 atom amount | 79 ASCII bytes: rvtest1 + 32-byte public key as lowercase hex + 4-byte checksum as lowercase hex
Block headeru16 version | u8 chain length + UTF-8 chain ID | u64 height | 32-byte parent ID | u64 timestamp | 32-byte target | 32-byte merkle root | u64 nonce

Transactions and spendable outputs

For comparison only, see Bitcoin Core's transaction structures and validation code. They are not normative Ravelnonce sources.

Blocks, timestamps, and proof of work

The interval and retarget are Ravelnonce testnet choices tied to the 150-second target spacing, not approved mainnet values. Bitcoin Core's proof-of-work code is comparison material for bounds and hash checks only.

Verification evidence

These checked-in checks exercise the implementation described above. Passing tests show those cases behave as asserted; they are not a security audit or protocol approval.

Rule-level consensus vectors

tests/unit/ravelnonce-consensus.test.ts checks SHA-256d and Ed25519 vectors, addresses, genesis and transaction bytes, issuance boundaries, signature and UTXO validation, coinbase rules, timestamp medians, retarget bounds, header linkage, and proof of work. The related protocol-page test checks the published schedule and scope copy.

Find the test command and checked-in test paths

Authenticated peer catch-up

tests/unit/ravelnonce-peer-sync-integration.test.ts exercises two local nodes, authenticated peer discovery, bounded block catch-up, and tip safety when a received block is invalid. It does not add fork choice or ledger reorganization.

Find the peer verification command

Executable local testnet exercise

node scripts/ravelnonce-testnet.mjs demo --base-url http://localhost:3000 creates ephemeral keys, mines and submits valid blocks, submits a signed spend, confirms a competing spend is rejected, then checks invalid-signature and wrong-target rejections without advancing the tip. It also reads the resulting address balances, explorer, and status. It uses a disposable database and does not test peer networking.

Open the demo setup and run instructions

Node scope and reproducibility

The implementation maintains one append-only canonical chain in PostgreSQL. Accepted transactions and blocks use serializable database transactions, including active-tip comparison and UTXO updates. Rejected submissions leave persisted chain, reservations, and spendable outputs unchanged. Nodes can discover peers and authenticate a versioned HTTPS handshake. A peer can submit up to eight contiguous blocks through /api/node/peers/blocks; each block and transaction is validated against the preceding active tip, and the batch commits atomically. An authenticated higher-tip announcement prompts the receiver to fetch missing canonical ranges in batches of up to eight; the announced hash is checked against the fetched tip and every block is validated before commit. Invalid batches leave that batch's prior tip unchanged. Nodes do not relay transactions, store side branches, choose forks, or reorganize ledgers, so disconnected nodes can still have different valid tips and UTXO states.

Consensus gaps remain: there is no wall-clock future-time bound, network-wide fork-choice rule, side-branch validation, reorganization, or production/testnet-to-mainnet parameter approval. These are explicit limitations of this runnable testnet, not guarantees supplied by peer connectivity. The implementation has not been audited for production use.

The rule-level vectors, including the external Ed25519 vector from RFC 8032, live in tests/unit/ravelnonce-consensus.test.ts. The RFC defines Ed25519 and supplies vectors; selecting it for this testnet is an implementation choice. The local CLI uses the key, signing, and verification APIs documented for Node.js 20.18.1 and newer.

Run the node against a disposable PostgreSQL database with the commands on the mining and node guide. The public API reference lists state, block templates, submissions, explorer reads, limits, and rejection responses.