The Ledger

This is what Mats Frost watched. The chain he built, the blocks it kept, and the file he was told to ship. The ledger remembers everything.

chainscan

Genesis was 28 July 2018. It was supposed to stop in September that year. It did not. The chain is still climbing, one block every three seconds, in the dark.

BlockHashAgeTxnsValue
#84 304 8180x36ca…2f9b1s2€ 855 816
#84 304 8170x4590…aa884s9€ 2 353
#84 304 8160x402f…5c487s2€ 1 761 562
#84 304 815zk:0xf0d0…d69410s3shielded
#84 304 8140x62f7…bfa113s5€ 1 485 300

the_chain / README.md

# The Chain

A distributed ledger project.

## Overview

The Chain aims to provide a global, immutable record of transactions,
untraceable yet secure, unstoppable yet dangerously misunderstood.

> Warning: This repository was developed under intense pressure from
> "stakeholders." Tread carefully.

## Features

1. ZK-SNARK Privacy. Zero-knowledge proofs hide amounts and parties while every
   transaction still verifies. The proving circuits change between releases; ask
   Rina before you touch them, and then do not touch them.
2. High-Speed Consensus. Proof-of-work, three-second target blocks, SHA-256
   linked. Fast enough to settle, slow enough to deny.
3. Modular Contracts. Settlement, token supply, and cleanup logic load as
   pluggable modules. Swap one and nobody reads the diff.
4. Multi-Asset Support. Many currencies, one ledger, one set of keys to lose.
5. Encrypted Whisper Network. Off-ledger encrypted messaging between nodes, for
   the coordination you would rather not write to the chain.

## Installation

1. Clone the repo

       git clone https://github.com/TheChainProject/TheChain.git
       cd TheChain

2. Install dependencies (Node.js + Yarn recommended)

       yarn install

   Make sure you trust your machine's environment. Some watchers might prefer
   you not to.

3. Configure. Copy .env.example to .env and add your secrets:
   - PRIVATE_KEY for dev or test
   - RPC_ENDPOINT to connect to a local or remote chain environment
   - Possibly an ENFORCER_PUBLIC_KEY if certain parties gave you special
     instructions

4. Compile and test

       yarn build
       yarn test

   Passing tests is critical. Failure can be punishing.

## Usage

- Local dev node:

       yarn start:local

  Good for safe experimentation.

- Deploy to testnet/mainnet:

       yarn deploy --network <networkName>

  Double-check the contract addresses. The watchers will.

- Monitoring and logging:

       yarn monitor

  Tracks transactions, node health, and suspicious network anomalies. Keep one
  eye on the logs, another on the door.

## Architecture

1. Core Protocol. Proof-of-work consensus, SHA-256 linked blocks, wallet logic,
   and the core data structures. About a three-second block time, roughly 1,200
   blocks an hour on a good day. Extensively tested, though the QA team
   occasionally vanished when they asked too many questions.
2. Smart Contract Layer. Modular settlement and token-supply contracts on a
   small execution environment. The cleanup and burn paths live here, which is
   why they get reviewed, and why we keep reminding each other that reviewed is
   not the same as deployed.
3. Privacy Layer. The zk-SNARK proving system: circuits, trusted setup, and
   verifier. Rebuilt and second-guessed continuously by R. Sakai. It is the one
   part of the stack nobody else fully understands, which is the point.
4. Client and CLI. A TypeScript CLI for day-to-day usage. Uses ephemeral keys
   for signing. Certain "friends" insisted that ephemeral means "zero audit
   trail."
5. Security Audits. Underway, but results remain confidential. We are told an
   outside group is verifying the code, though we suspect infiltration attempts
   daily.

## Contributing

All contributions are welcome, even if you are just passing by. To submit a
pull request:

1. Fork the repo.
2. Branch off dev with a short name describing your feature or fix.
3. Add tests, please. Our last silent meltdown nearly destroyed everything.
4. Open a PR, and one of the core devs will review it (assuming they are still
   around).

> Note: Merging suspicious code is easy in a chaotic environment. We rely on
> each other to keep The Chain "clean." Watch for commits with hidden loops or
> backdoors.

## License

Released under the MIT License. Note that certain unspoken restrictions apply
if you are acting on behalf of organizations who might prefer secrecy over free
software ideals.

## Disclaimer

"The Chain" is a dangerous piece of software, both in concept and execution. If
you use it, you acknowledge the risks. Repercussions could come from multiple
directions: legal, moral, or more direct forms of enforcement. You have been
warned.

> "We code, we commit, and we pray for daylight."
>  - Mats Frost, Lead Dev

Stay safe. Build responsibly. And remember:
every commit has consequences.

Where it begins

The opening scene of The Chain: a safe house in Tangier, late at night.
Tangier. Late night. The first block of the night was already written.

Read the first chapter free. Join the early reader list and it arrives by email, as PDF and EPUB.

Get the first chapter

The soundtrack

The story runs to a chapter-by-chapter score, in three different cuts. Hear the soundtrack.

Join the early reader list