← Back to cphcoin.org

CPH Coin: A Peer-to-Peer Decentralized Digital Currency System

Satoshi Nakamoto

satoshi@cphcoin.org

https://cphcoin.org

March 2026

Abstract

CPH Coin is a fully decentralized peer-to-peer electronic cash system that enables direct online payments between parties without relying on a trusted third party. The system employs a Proof of Work consensus mechanism with Double SHA-256 hashing to secure the network, validate transactions, and achieve distributed consensus. With a fixed maximum supply of 21 million coins and a deflationary issuance model featuring periodic reward halving, CPH Coin is designed to function as a store of value and medium of exchange. This paper outlines the architecture, cryptographic foundations, consensus mechanism, economic model, and network protocol of CPH Coin.

Table of Contents

  1. Introduction
  2. Transactions
  3. Proof of Work
  4. Network
  5. Blockchain Structure
  6. Merkle Trees
  7. Supply and Issuance
  8. Difficulty Adjustment
  9. Wallets and Addresses
  10. Block Explorer
  11. Security Considerations
  12. Conclusion

1. Introduction

The existing financial system relies heavily on trusted intermediaries to process electronic payments. While this model works adequately for most transactions, it suffers from inherent weaknesses: reliance on trust, reversibility of transactions, high fees for small payments, and exclusion of participants who lack access to traditional banking.

CPH Coin addresses these challenges by implementing a decentralized digital currency that operates on a peer-to-peer network. Every transaction is cryptographically signed and recorded on a public, immutable ledger known as the blockchain. Consensus is achieved through computational work, eliminating the need for any central authority.

The design of CPH Coin draws from established principles in distributed systems and cryptography, combining them into a practical system that anyone can participate in through mining, transacting, or running a network node.

2. Transactions

A CPH transaction represents a transfer of value between participants. Each transaction consists of inputs and outputs, following the Unspent Transaction Output (UTXO) model.

2.1 Transaction Structure

Each transaction contains:

+------------------+ +------------------+ +------------------+ | Transaction 0 | | Transaction 1 | | Transaction 2 | +------------------+ +------------------+ +------------------+ | Input: | | Input: | | Input: | | Coinbase | | TX0, Output 0 | | TX1, Output 0 | | Output: | | Signature | | Signature | | 50 CPH -> Addr1 |---->| Output: |---->| Output: | +------------------+ | 30 CPH -> Addr2 | | 15 CPH -> Addr3 | | 20 CPH -> Addr1 | | 15 CPH -> Addr2 | +------------------+ +------------------+

Figure 1: Chain of transactions showing the flow of value through the UTXO model.

2.2 Coinbase Transactions

Each block contains a special transaction called the coinbase transaction. This transaction has no inputs and creates new coins as a reward to the miner who successfully mined the block. The coinbase transaction is the sole mechanism through which new CPH coins enter circulation.

2.3 Transaction Fees

The difference between the total input value and the total output value of a transaction constitutes the transaction fee. This fee is collected by the miner who includes the transaction in a block, providing an economic incentive for miners to process transactions. The minimum transaction fee is set at 0.00001000 CPH, with a default fee of 0.00010000 CPH.

3. Proof of Work

CPH Coin uses Proof of Work (PoW) as its consensus mechanism. Miners compete to find a nonce value that, when combined with the block header and hashed using Double SHA-256, produces a hash value below a target threshold determined by the current difficulty.

3.1 Double SHA-256

The hashing algorithm used throughout CPH Coin is Double SHA-256, which applies the SHA-256 hash function twice:

Hash(x) = SHA-256(SHA-256(x))

This double application provides additional resistance against length extension attacks and adds an extra layer of security to the mining process and transaction verification.

3.2 Mining Process

To mine a block, a miner performs the following steps:

  1. Collect pending transactions from the memory pool.
  2. Construct a candidate block with a block header containing the previous block hash, Merkle root of transactions, current timestamp, difficulty target, and an initial nonce of 0.
  3. Compute the Double SHA-256 hash of the block header.
  4. If the resulting hash is below the target (i.e., has the required number of leading zeros), the block is valid.
  5. If not, increment the nonce and repeat from step 3.
Block Header: [Version | PrevHash | MerkleRoot | Timestamp | Difficulty | Nonce] | Double SHA-256 | v Hash < Target? / \ Yes No | | Block Valid Increment Nonce | | Broadcast Block Try Again

Figure 2: The Proof of Work mining process.

3.3 Difficulty Target

The difficulty determines how many leading zero characters the block hash must have. A higher difficulty requires more computational effort to find a valid hash. The initial difficulty of CPH Coin is set to 4, meaning block hashes must begin with four zeros.

4. Network

The CPH Coin network operates as a peer-to-peer system where nodes communicate directly with each other over TCP connections.

4.1 Network Protocol

Nodes communicate using a simple message protocol on port 8333. The following message types are supported:

MessagePurpose
VERSIONExchange node information and blockchain height on connection
BLOCKBroadcast a newly mined block to peers
TXBroadcast a new transaction to peers
GETBLOCKSRequest blockchain data for synchronization

4.2 Block Propagation

When a miner discovers a valid block, it is immediately broadcast to all connected peers. Each receiving node validates the block independently by verifying the Proof of Work, checking the Merkle root, and ensuring all transactions are valid. Validated blocks are appended to the local blockchain, and the node relays the block to its own peers.

4.3 Node Discovery

Nodes can manually connect to peers using the addnode command, specifying the IP address and port of the target node. Upon connection, nodes exchange version messages containing their blockchain height, facilitating chain synchronization.

5. Blockchain Structure

The blockchain is an ordered, append-only sequence of blocks. Each block references the hash of its predecessor, forming an unbreakable chain from the genesis block to the current tip.

5.1 Block Structure

FieldDescriptionSize
VersionBlock version number4 bytes
Previous HashDouble SHA-256 hash of the previous block header32 bytes
Merkle RootRoot hash of the Merkle tree of transactions32 bytes
TimestampBlock creation time (Unix epoch)4 bytes
DifficultyCurrent mining difficulty target4 bytes
NonceCounter used for Proof of Work4 bytes
TransactionsList of transactions included in the blockVariable

5.2 Genesis Block

The first block in the CPH blockchain is the genesis block, created with the coinbase message "CPH Coin Genesis Block - 2026". This block has a fixed timestamp and a previous hash of all zeros, serving as the immutable anchor for the entire chain.

+-------------+ +-------------+ +-------------+ +-------------+ | Genesis | | Block 1 | | Block 2 | | Block N | | Block 0 |<----| |<----| |<----| | +-------------+ +-------------+ +-------------+ +-------------+ | PrevHash: 0 | | PrevHash: | | PrevHash: | | PrevHash: | | Timestamp: | | Hash(B0) | | Hash(B1) | | Hash(BN-1) | | Nonce: ... | | Timestamp: | | Timestamp: | | Timestamp: | | Tx: Coinbase| | Nonce: ... | | Nonce: ... | | Nonce: ... | +-------------+ | Txs: [...] | | Txs: [...] | | Txs: [...] | +-------------+ +-------------+ +-------------+

Figure 3: The blockchain as a linked sequence of blocks.

5.3 Chain Validation

The integrity of the blockchain is verified by checking that each block's previous hash correctly references the hash of its predecessor, each block's hash satisfies the difficulty requirement at the time it was mined, and all transactions within each block are valid and properly signed.

6. Merkle Trees

Each block contains a Merkle root, which is the root hash of a binary hash tree constructed from the block's transactions. This structure enables efficient and secure verification of transaction inclusion.

6.1 Construction

The Merkle tree is built bottom-up:

  1. Each transaction is hashed using Double SHA-256 to form the leaf nodes.
  2. Pairs of adjacent hashes are concatenated and hashed together to form parent nodes.
  3. If the number of hashes at any level is odd, the last hash is duplicated.
  4. This process repeats until a single root hash remains.
Merkle Root / \ Hash(AB) Hash(CD) / \ / \ Hash(A) Hash(B) Hash(C) Hash(D) | | | | TX_0 TX_1 TX_2 TX_3

Figure 4: Merkle tree structure for four transactions.

7. Supply and Issuance

CPH Coin implements a fixed, predictable monetary policy designed to be deflationary over time.

7.1 Maximum Supply

The total supply of CPH Coin is capped at exactly 21,000,000 CPH. No mechanism exists to create coins beyond this limit. Each CPH is divisible into 100,000,000 units (8 decimal places), with the smallest unit being 0.00000001 CPH.

7.2 Block Reward and Halving

New coins are issued exclusively through mining block rewards. The initial block reward is 50 CPH per block. This reward is halved every 210,000 blocks, following a geometric decay schedule:

Block RangeRewardCumulative Supply
0 - 209,99950 CPH10,500,000 CPH
210,000 - 419,99925 CPH15,750,000 CPH
420,000 - 629,99912.5 CPH18,375,000 CPH
630,000 - 839,9996.25 CPH19,687,500 CPH
840,000 - 1,049,9993.125 CPH20,343,750 CPH
.........
~6,720,000+0 CPH21,000,000 CPH

7.3 Issuance Timeline

With a target block time of 10 minutes, the first halving is projected approximately 4 years after the genesis block. The final coin is estimated to be mined approximately 130 years after network launch. After all coins have been issued, miners will rely solely on transaction fees as compensation for securing the network.

8. Difficulty Adjustment

To maintain a consistent block time of approximately 10 minutes regardless of changes in network hash rate, CPH Coin implements an automatic difficulty adjustment mechanism.

8.1 Adjustment Algorithm

Every 2,016 blocks (approximately two weeks at the target block rate), the network recalculates the difficulty:

Expected Time = 2016 blocks x 600 seconds = 1,209,600 seconds
Actual Time   = Timestamp(Block 2016N) - Timestamp(Block 2016(N-1))
New Difficulty = Old Difficulty x (Expected Time / Actual Time)

If blocks were mined faster than expected, the difficulty increases. If they were mined slower, the difficulty decreases. This mechanism ensures that the network self-regulates to maintain its target block time.

8.2 Bounds

The adjustment is bounded to prevent extreme changes: the difficulty can at most quadruple or reduce to one-quarter in a single adjustment period. The minimum difficulty is set to 1.

9. Wallets and Addresses

Wallets in CPH Coin manage cryptographic key pairs and provide the interface for users to send and receive coins.

9.1 Key Generation

Each wallet generates a private-public key pair:

9.2 Transaction Signing

When creating a transaction, the sender signs the transaction data with their private key. Nodes on the network can verify this signature using the sender's public key, ensuring that only the legitimate owner of the funds can authorize their transfer.

10. Block Explorer

CPH Coin includes a built-in web-based Block Explorer that provides a graphical interface for inspecting the blockchain. The explorer runs as an embedded HTTP server and offers the following functionality:

11. Security Considerations

11.1 Double Spending

The Proof of Work consensus mechanism prevents double spending by establishing a canonical ordering of transactions. An attacker attempting to reverse a transaction would need to redo the Proof of Work for the target block and all subsequent blocks, which becomes exponentially more difficult as additional blocks are added. The probability of a successful attack diminishes rapidly with each confirmation.

11.2 51% Attack

An attacker controlling a majority of the network's hash rate could theoretically rewrite recent history. However, this attack becomes infeasible as the network hash rate grows and distributes across many independent participants. The economic cost of sustaining such an attack also serves as a deterrent.

11.3 Cryptographic Foundations

The security of CPH Coin rests on the computational hardness of the SHA-256 hash function. As long as SHA-256 remains collision-resistant and preimage-resistant, the integrity of the blockchain and the security of wallet addresses are maintained.

12. Conclusion

CPH Coin presents a complete implementation of a decentralized digital currency system. By combining Proof of Work consensus, UTXO-based transactions, Merkle tree verification, and a fixed monetary policy with periodic halving, CPH Coin achieves the essential properties of a trustless electronic cash system: immutability, censorship resistance, and predictable issuance.

The system is implemented in C++17 and is fully open source under the MIT License. The complete source code, including the blockchain engine, mining software, wallet system, P2P networking layer, and block explorer, is available for review and contribution at github.com/cypheronsupport-commits/cphcoin.org.

CPH Coin demonstrates that the principles of decentralized consensus and sound monetary policy can be implemented in a practical, functional system accessible to anyone with a computer and an internet connection.

References

[1] S. Nakamoto, "Bitcoin: A Peer-to-Peer Electronic Cash System," 2008.

[2] National Institute of Standards and Technology, "Secure Hash Standard (SHS)," FIPS PUB 180-4, 2015.

[3] R. C. Merkle, "Protocols for Public Key Cryptosystems," IEEE Symposium on Security and Privacy, 1980.

[4] A. Back, "Hashcash - A Denial of Service Counter-Measure," 2002.

[5] W. Dai, "b-money," 1998.

[6] H. Finney, "Reusable Proofs of Work (RPOW)," 2004.