Research notes

The main design decisions, in the order they were made, with the reasoning and what testing later showed. Dates are UTC. Where a number comes from a simulation and not from a running network, the note says so.

Continue the chain from upstream's fork block

The aim is the plainest possible continuation: the old network keeps going from the exact block where upstream changes its rules. So Classic's fork height H is defined as upstream's FP8 activation height, block H is the first block under Classic rules, and H−1 is the last shared block. The ticker is PEARLC.

Continuing the old chain needs no new code at all, because the current software cannot read the new FP8 blocks and simply stops following them. Making the continued chain usable does need new consensus code, for three reasons: the difficulty rule would stall it, transactions could be replayed between the chains, and the two networks would keep talking to each other. Each has its own note below.

One constraint shaped everything else. Upstream's FP8 height is a value compiled into its software, with no on-chain signalling, and none had been set when this was written. Past upstream fork heights were published between 52 minutes and 12 hours ahead, and twice moved late. Classic therefore cannot ship with a height built in ahead of time. Nodes are armed with H when it is known, and can be re-armed if it moves.

A new difficulty rule from block H

. Tested on a local network the same day and on the public testnet on .

Pearl's difficulty rule is a weighted average with a 168-hour time constant. After a fork, the minority side inherits a difficulty set for the whole network. Simulated under the unchanged rule, a chain keeping 1% of the hashrate waits about 5.4 hours for its first block and about 48 days for difficulty to come within 10% of the right level. At 10% it is 32 minutes and about 31 days.

The replacement has three parts.

  1. Block H finds its own difficulty. Its target is the inherited one made easier by a factor of 2k, where k starts at 1 and rises by 1 for every 300 seconds since the previous block's timestamp, up to 8 (256×). No estimate of the surviving hashrate is needed. Because k is at least 1, a block valid under the old rule is never a valid Classic block H, and the other way round, which makes the split unambiguous.
  2. From H+1, absolute ASERT. The integer formula Bitcoin Cash adopted (aserti3-2d), anchored on the difficulty and timestamp block H was actually mined at, with a 194-second target and a 3,600-second half-life. The schedule is pinned to timestamps from the anchor, so it does not drift and cannot be walked by manipulating a few timestamps.
  3. Stall relief. A block whose timestamp is 1,200 seconds or more after its parent gets a target doubled once, and doubled again for every further 300 seconds. It applies to that block only. The next block's difficulty is computed from the anchor again.

In simulation the first block arrives in about 26 minutes at 0.5% of pre-fork hashrate (worst case 44) and about 4 minutes at 30%, and the base difficulty is within 10% of the right level in roughly 2 to 4.5 hours at the median. In steady state the mean block time is 194.0 seconds and about one block in 400 uses the relief.

The other failure a slow rule invites is a large miner joining briefly to collect easy blocks and leaving the chain stalled behind it. In the model, a miner with 100 times the chain's hashrate gains at most about 124 blocks above schedule under the new rule, against about 14,400 under the current one, and the stall after it leaves shortens from about 5 hours on average to about 40 minutes.

Observed on the testnet: the fork block was eased as specified, and difficulty then overshot about sevenfold after a burst of fast blocks before settling toward 194 seconds. The first hours of a real fork will be uneven in the same way.

Replay protection by changing one signature tag

. Tested in both directions on the public testnet on .

The two chains share every key and every unspent coin at the fork, and compute the hash that signatures commit to in exactly the same way. Without a change, any transaction on one chain could be copied to the other.

Every signature in Pearl ends in a single tagged hash. From block H, Classic computes it with the tag PearlClassic/TapSighash instead of TapSighash. Nothing else in the signed message, the transaction format or the transaction ID changes.

This is two-way even though only Classic changes. A Classic signature signs a different 32-byte message, so upstream's check fails. From H, Classic computes the Classic hash, so an upstream signature fails there. A transaction with at least one signed input is protected as a whole.

The tag alone was not enough for a safe system. Four things were added around it:

  • The node records which rules and which H its stored blocks were validated under, and validates again from the affected height if either changes. Otherwise a node re-armed with a different height would keep trusting blocks checked under the wrong rules.
  • The wallet chooses the tag from the height of the next block, and close to the fork it refuses to sign with the old tag on a stale view of the chain.
  • The two versions of a transaction, one signed for each chain, have the same transaction ID. The node no longer remembers an ID as rejected when the failure was a signature failure, or the wrong version arriving first would block the right one.
  • A node with no height set refuses to mine after a deadline date, so that a forgotten unarmed node cannot keep producing blocks on rules nobody intends.

A lesson from testing: a replay test can pass for the wrong reason. The first wallet check reported that the other chain rejected a Classic transaction, but the coin had already been spent there, so it was rejected as a double spend and proved nothing about signatures. The check now requires the coin to be unspent on the other chain first.

A separate network, the same addresses

Classic nodes get their own peer-to-peer identity: a distinct network identifier (PRLC), their own ports (44118 for peers), their own data directories and, at launch, their own seed nodes. A Classic node and an upstream node cannot complete a handshake with each other on the Classic network, and a Classic node can run beside an upstream node on the same machine.

What stays untouched is everything that defines the chain's history and its coins: the genesis block, the address prefix, the key derivation path and the existing checkpoints.

Before the fork, Classic nodes still need upstream's blocks. They get them over a small number of ordinary outbound connections to upstream nodes, which are switched off at H−1. Whether those connections are on is decided only by the current fork height, so it cannot be left on by accident after the fork.

A non-custodial pool with no fee

A new chain needs a pool on its first day, and consumer-card miners need a stratum endpoint to mine at all. A conventional pool would mean someone holding miners' coins and running accounts. We chose a peer-to-peer pool in the style of Bitcoin's P2Pool, adapting an existing open-source design for Pearl.

Pool nodes share a record of submitted work. When one finds a block, the block's own reward transaction pays each miner directly, in proportion to recent work (the last 1,000 shares). Nobody holds a balance, so there is nothing to withdraw and nothing to take. The fee is zero.

The costs are real. Each participant runs a pool node and a Classic node, which is more work than typing in a pool address. And a peer-to-peer pool has its own consensus between pool nodes, which is its own attack surface: this is why the pool runs only between the project's own nodes until it has been reviewed for outside participants.

Testing found a payout bug worth recording. With no recent shares on record, a pool block on a test network paid its reward to nobody. That is fixed, and the pool's payout logic was put through the same review as the node's consensus changes.

What the first public testnet run got wrong

. Fork at block 300.

The fork itself worked. Each side agreed with itself, neither had the other's blocks, Classic nodes closed their upstream connections on time, difficulty eased at the fork block, and replay was rejected in both directions. Two findings changed the design.

Blocks mined on Classic before the fork were lost. The connections to upstream only received. Blocks found by Classic miners before H never reached the upstream network, which built a longer chain without them. Every pre-fork block the Classic miner found was orphaned. A miner who switched early would have earned nothing until the fork.

Pool blocks carried no user transactions. The pool design we adopted built blocks containing only the reward. A wallet payment sat unconfirmed through 14 consecutive pool blocks and confirmed only when a solo miner found one. If the pool held most of the hashrate, the chain would mine blocks and move no payments.

The node left on the current release, with no changes, ended one block past the fork on a chain of its own. That is the expected fate of a node that upgrades to neither side.

The next two notes are the responses to the two findings.

Relay blocks out to upstream before the fork

. Tested on the public testnet the same day.

There were two ways to fix the orphaned blocks. Classic pools and miners could stay idle until H−1, which needs no code but means nobody can run Classic early without giving up income. Or Classic nodes could relay the blocks they mine before the fork out to upstream nodes.

We chose the relay. Upstream fork heights have been announced hours ahead. Miners will not reliably change software in that window, so the hashrate present at block H is mostly the hashrate that was already running Classic software. That only happens if running it early costs nothing.

With the relay, a block mined on a Classic node before H is offered to upstream peers like any other block. It is an ordinary Pearl block. The relay stops, and the upstream connections close, at H−1. Classic blocks from H onward are never sent to upstream.

It changes node networking code, so it went through review before being merged on .

User transactions in pool blocks

Pool blocks now select transactions from the node's pending set, within the block size limit less the room the payout needs, and pay the fees to miners along with the reward. Pool nodes commit to the fees in their shared record, so that every pool node can check a share pays what it should.

This changed the rules pool nodes follow among themselves, which is another reason the pool is not open yet. On the testnet, pool blocks carried user payments both before and after the fork.

Second public testnet run

. Fork at block 260, moved live from 360.

Six nodes: three Classic, two upstream with FP8, and one left on the current release with no changes. During the run the fork height was changed from 360 to 260 on the live network, to rehearse upstream moving its height.

  • All six nodes agreed on block 259, the last shared block.
  • 104 of the 259 pre-fork blocks on the upstream chain were mined through Classic nodes, and their rewards matured on the upstream chain.
  • A pool block carrying a user payment before the fork was accepted on the upstream chain. Pool blocks after the fork carried payments signed with the Classic tag.
  • Upstream connections closed, block H was eased, and the split was clean.
  • Replay was rejected in both directions, and the wallet signed, was rejected on the other chain, and confirmed on its own.

All of this used CPU miners on a small network. It says the rules work. It says nothing yet about GPU miners or about behaviour at mainnet scale.

Keep the prl address prefix

The open question was whether Classic addresses should get a prefix of their own. A distinct prefix makes it obvious which chain an address is meant for. Against that, Pearl Classic is the existing chain: every address and every key that holds coins at the fork must keep working exactly as it does now, and a new prefix would mean one set of coins with two spellings of every address.

We kept prl. Addresses, keys and wallets' key derivation are identical on both chains. The cost is that an address alone does not tell you which chain a payment is on, so the separation rests where it should, on signatures: a payment can only take effect on the chain it was signed for.

Review before release

to

Changes to consensus rules, signing and pool payouts move other people's coins, so none of it is released on the builders' word. The node and wallet changes went through repeated rounds of independent review until the reviewers had no open findings, and were merged on 30 November. The first round found nine high-severity issues; they were fixed and re-reviewed.

The pool took more rounds and is cleared only for use between the project's own nodes, with its ports closed to others. Opening it to outside miners is a separate decision with its own review.

Release builds are reproducible: on Linux, two independent builds of the same source produce identical files, bit for bit. Releases will be signed, and the signatures will be checked against more than one key.