Tachyon is a pure-Python, dependency-free blockchain exploring high-throughput designs inspired by Solana, Aptos, Sui and Tendermint β with a mobile-friendly fair-play mining layer.
| Feature | Description | Inspiration |
|---|---|---|
| β‘ 6-Stage Pipeline | Fetch β Gossip β Verify β Execute β Store β Finalize, each stage decoupled for backpressure and latency hiding. | Solana |
| π Optimistic Parallel Execution | Block-STM style speculative execution with read/write sets and conflict re-execution. | Aptos / Sui |
| π Ed25519 (RFC 8032) | Pure-Python signatures with a precomputed base-point table (~0.5 ms sign, ~1.5 ms verify). No third-party crypto. | Modern BFT |
| π² Sparse Merkle Tree | 256-bit sparse state tree with compact inclusion and exclusion proofs; precomputed empty-subtree hashes. | Cosmos / Zcash |
| βοΈ Stake-Weighted BFT | Deterministic round-robin leader election and >2/3 stake quorum finality with append-only vote log. | Tendermint |
| πΈ EIP-1559 Fee Market | Base fee adjusts per block against a utilization target, clamped to Β±10% change. | Ethereum |
| π± ARM-Friendly Fair Play | Tier-scaled PoW difficulty so phones and servers win blocks at comparable rates. | β |
Tachyon is designed to be lightweight and ARM-friendly. The pow module implements a Fair Play difficulty engine:
- Tier-scaled targets β a mobile (ARM) miner solves a much easier puzzle than a server, so both find blocks on a comparable timescale despite wildly different hash power.
- Tier-balanced quorum β
FairPlayEngine.check_quorumrequires each registered hardware tier to contribute its share of votes, so servers cannot drown out mobile participants. Tiers with no registered miners are skipped. - Battery-aware design β the hash loop is plain SHA-256 (no SHA-NI assumptions) and yields to the OS periodically to avoid pinning a phone core.
python -m tachyon.pow # fair-play mining demo: ARM phone vs x86 server- Cryptographic foundation β Ed25519 (RFC 8032) with precomputed base table, base58 addresses with checksums, domain-separated SHA-256 for every hash context.
- State management β Sparse Merkle Tree with inclusion/exclusion proofs and precomputed empty hashes.
- Consensus engine β stake-weighted BFT finality (>2/3), slot clock (400 ms), 6-stage pipelined block processor.
- Transaction management β priority mempool and EIP-1559-style dynamic base fee.
- Verification tooling β RFC 8032 vectors, end-to-end simulation, throughput benchmark.
- ARM-friendly PoW layer β
pow.pytier system with per-tier difficulty targets and nonce verification. - Fair-play quorum β
mobile.pyenforces per-tier vote shares instead of raw hash-power dominance.
- VRF leader election β replace round-robin with verifiable randomness for unpredictable slot assignment.
- Smart contracts β sandboxed deterministic execution environment (WASM or restricted bytecode).
- Gossip tuning β sub-100 ms block propagation across geographically distributed nodes.
- Light client proofs β ship SMT exclusion/inclusion proofs over JSON-RPC for mobile verifiers.
- Cross-chain bridging β interoperability with existing BFT chains.
A phone cannot mine like a server. Android kills background CPU work (API 26+), thermal throttling cuts hash rate within minutes, and a 24/7 hash loop flattens the battery. So Tachyon uses bounded work tickets, not continuous mining.
phone pool
|-- calibrate local hash rate -->|
| |-- pick difficulty for ~3s of work on THIS device
|<------ signed ticket ---------|
|-- hash for a few seconds -----|
|------- submit nonce --------->|-- verify signature, expiry, single-use
| |-- credit weight = 2^difficulty
|<-------- accepted ------------|-- assemble a block when weight threshold is hit
The ticket is HMAC-signed, so a client cannot rewrite difficulty downward to
claim credit for work it never did. Tickets are single-use, expire after 90s, and
submissions get a 15s grace window so a phone that solved just before expiry is
not punished for cellular latency.
Why this gives phones a fair shot: credit is 2^difficulty per share. A phone
solves an easier ticket and earns 32,768; a server solves a harder one and earns
1,048,576. The server earns more in absolute terms -- it did more work -- but
neither tier is cheated on payout per hash. The pool aggregates millions of
small shares into blocks so a phone participates meaningfully.
python -m tachyon.mobile_server --port 8080Or programmatically:
from tachyon.mobile_server import MiningServer
import time
s = MiningServer(port=8080)
s.start()
time.sleep(3600)Browse to http://<pool-ip>:8080/ on the phone. The page ships an inline
synchronous SHA-256 (WebCrypto is async-per-call and ~100x too slow to drive a
hash loop), calls the pool over fetch, and shows hash rate, difficulty,
expected solve time and accumulated credit. Stop it any time; nothing is
installed and no background service is registered.
pkg install python
python scripts/mobile_mine.py --pool http://192.168.1.20:8080 --miner my-phone --tier 1Same bounded loop: calibrate, request ticket, hash, submit, rest.
| Method | Path | Purpose |
|---|---|---|
| POST | /register |
{miner, tier} -> account |
| POST | /ticket |
{miner, tier, hashes_per_second} -> signed ticket |
| POST | /share |
{ticket, nonce, elapsed_ms} -> credit |
| GET | /status |
pool totals, accepted/rejected, blocks assembled |
| GET | /leaderboard |
ranked miners by credit |
| GET | / |
the embedded phone client |
- Terminate TLS in front of it -- plain HTTP leaks tickets, and a sniffed ticket can be raced.
- Rate limit
/ticketand/shareper IP, or one client can drain the pool's CPU. - Persist consumed ticket ids; a restart makes old tickets replayable within their TTL.
- Raise
BLOCK_WEIGHT_THRESHOLD; the default is sized for demos.
The server never leaks stack traces to clients and caps request bodies at 64 KB.
Measured with scripts/benchmark.py (10 blocks, 3 transactions per block, full Ed25519 signing and verification plus SMT updates):
Transactions Per Second (tx/s) by Validator Count
--------------------------------------------------------------
2 Validators: 1070.08 tx/s #################################### |
4 Validators: 949.37 tx/s ############################# |
8 Validators: 1166.17 tx/s #################################### |
16 Validators: 1070.04 tx/s #################################### |
--------------------------------------------------------------
Numbers are single-process simulation results on a 12-core container, not network throughput.
Requirements: Python 3.12+ β no third-party packages.
git clone https://github.com/kp-pc/Tachyon-blockchain.git
cd Tachyon-blockchain| Task | Command |
|---|---|
| End-to-end simulation | python -m tachyon.simulation |
| Throughput benchmark | python scripts/benchmark.py |
| Fair-play mining demo | python -m tachyon.pow |
| RFC 8032 crypto vectors | python tests/test_crypto.py |
tachyon/
βββ encoding.py # base58, canonical JSON, domain-separated hashing
βββ crypto.py # Ed25519 (RFC 8032) + address derivation
βββ merkle.py # binary Merkle tree with inclusion proofs
βββ smt.py # Sparse Merkle Tree state commitment
βββ chain.py # blocks, transactions, votes, ledger, BFT finality
βββ pipeline.py # 6-stage block processing pipeline
βββ executor.py # optimistic parallel execution (Block-STM style)
βββ feemarket.py # EIP-1559-style base fee
βββ mempool.py # priority transaction pool
βββ election.py # round-robin and stake-weighted leader election
βββ pow.py # ARM-friendly fair-play PoW layer
βββ mobile.py # tier-balanced quorum engine
βββ mobile_protocol.py # signed work tickets, calibration, hash contract
βββ mobile_pool.py # share accounting and block assembly
βββ mobile_server.py # HTTP transport + embedded phone client
βββ mobile_chain.py # pooled shares -> real hash-linked blocks
βββ lightclient.py # balance proofs + wire serialisation
βββ storage.py # append-only ledger persistence
βββ networking.py # peer gossip
βββ rpc.py # JSON-RPC server
βββ cli.py # command-line client
scripts/benchmark.py # throughput charts
scripts/mobile_mine.py # Termux/Android CLI miner
tests/test_crypto.py # RFC 8032 vectors
tests/test_mobile.py # mobile protocol, pool, HTTP (53 checks)
tests/test_mobile_chain.py # SMT commitment + block assembly (59 checks)
tests/test_lightclient.py # balance proofs, Python/JS cross-check (29 checks)
tests/verify_proof.mjs # Node CLI over the shared verifier core
tachyon/static/verify_core.js # single verifier source for browser + tests
A phone should not have to trust the pool operator to tell it its own balance. Now that state commits through a real Sparse Merkle Tree, it does not have to.
phone node (untrusted)
|-- GET /balance-proof?miner=me ---------->|
|<-- header.state_root + 256-entry proof --|
| |
| fold leaf -> 256 siblings -> root | (server's opinion is unused)
| accept only if root == header.state_root|
The security property: the node can lie about anything except the contents of
committed state. A proof that folds to a header's state_root proves the balance
was in the state that block committed to. A wrong balance would require breaking
SHA-256.
python -m tachyon.mobile_server --port 8080Then open http://<pool-ip>:8080/verify on the phone, type a miner name, and the
page verifies the proof on the device. It uses the same verifier source the
test suite runs (tachyon/static/verify_core.js), so the browser and the tests
cannot drift apart.
key = "balance:" + address
slot = sha256("tachyon:v1:" + "state_slot" + 0x00 + key)
leaf = sha256("tachyon:v1:" + "smt:leaf" + 0x00 + slot + value)
node = sha256("tachyon:v1:" + "smt:node" + 0x00 + left + right)
value is the balance as a big-endian u64, or absent for an exclusion proof
(balance 0). branch[0] pairs with the least-significant bit of the slot.
The JavaScript verifier originally hashed domain + tag + payload, omitting the
0x00 separator after the tag. That separator is invisible in terminal output,
so the code looked right and the server kept reporting valid balances while
every client-side verification silently failed. tests/test_lightclient.py now
runs Python and JavaScript over the same eight accept/reject cases and requires
them to agree.
Tachyon is an educational and research project. The consensus and cryptographic code has not been audited. Do not use it to transfer real value.
Issues and pull requests are welcome β especially around VRF election, smart-contract sandboxing, and light-client proofs.
Tachyon β built from scratch in pure Python