Skip to content
ciphernomPublic

Latest commit

 

History

477 Commits

Folders and files

Repository files navigation

Midstate

Midstate is a cryptocurrency implementing BLAKE3 sequential-time proof of work, post-quantum cryptography (WOTS and MSS), and strict power-of-2 coin denominations. Transactions operate on a two-phase commit-reveal protocol.

1. Build

Compilation requires the standard Rust toolchain.

cargo build --release

The binary is output to ./target/release/midstate.

2. Node Operations

Nodes maintain the state accumulator, manage libp2p networking, and execute mining.

Start a node with mining enabled:

midstate node --data-dir ./data --port 9333 --rpc-port 8545 --mine --threads 3

Native Batch Explorer Access the native explorer at http://localhost:8545 to view detailed info - mempool, batches, height etc.

Circulating Supply & Rich List Start the node with --rich-list (or rich_list = true in config.toml) to keep an index of every unspent coin's address and value. The explorer's SUPPLY tab (http://localhost:8545/?richlist) then shows the circulating supply and the top 100 holders. The index builds from genesis in the background on first start, costs about 100 bytes per unspent coin, and needs an archival node (no --prune).

The same figures are served for listing sites (CoinGecko, CoinMarketCap, LiveCoinWatch). Amounts are in MDS, the base unit (1 gMDS = 2^30 MDS):

Endpoint Returns
GET /supply/circulating Circulating supply, as a bare number
GET /supply/total Total supply (issued minus burned), as a bare number
GET /supply/max Max supply: the halving schedule's total, 1,128,717,404,337,600
GET /supply All supply figures as JSON, with a check that the unspent coins add up to issuance minus burns
GET /richlist?limit=100 The largest holders as JSON (up to 1000)
GET /richlist/<address> One address's balance and rank

Circulating supply equals total supply: there is no premine, treasury or team allocation. It counts every block reward issued, minus the genesis reward (paid to the genesis inscription, which no key can spend) and value destroyed by data burns. After the halvings end at block 15,768,000, a tail of 1 MDS per block continues. The plain-number endpoints answer 503 until the index has caught up, rather than publish a figure that might be wrong.

Midstate Axe Dashboard: For hardware nodes (or local testing), access the web dashboard at http://127.0.0.1:8545/axe to configure Wi-Fi, view live telemetry, and set up pool mining.

3. Wallet Operations

The wallet communicates with the node via HTTP RPC. All wallet commands require a password, which is prompted interactively or read from the MIDSTATE_PASSWORD environment variable.

Create a new HD (BIP39) wallet:

midstate wallet create --path wallet.dat

Restore a wallet from a 24-word seed phrase:

midstate wallet restore --path wallet.dat

4. Addresses & Receiving

Midstate utilizes post-quantum signatures. Standard addresses are consumed upon spending.

Generate a WOTS Address (Single-use):

midstate wallet receive --path wallet.dat --label "payment1"

WARNING: REUSING WOTS ADDRESSES EXPOSES YOUR PRIVATE KEY

Generate an MSS Address (Multi-use):

midstate wallet generate-mss --path wallet.dat --height 10 --label "donation"

For mining rewards from a pool, the MSS address type is the ONLY address type you should use.

Smart Contracts & Covenants: Compile a human-readable .msc assembly file into a Pay-to-Script-Hash (P2SH) address.

midstate wallet compile --file limit_order.msc

Scan for Outputs: Incoming transactions must be scanned to update local balances:

midstate wallet scan --path wallet.dat --rpc-port 8545

5. Sending

Outputs must be powers of 2. The wallet automatically decomposes base-10 integers into power-of-2 denominations, computes change, and executes the required commit and reveal transactions.

Standard Send:

midstate wallet send --path wallet.dat --rpc-port 8545 --to <ADDRESS_HEX>:15

Private Send:

midstate wallet send --path wallet.dat --rpc-port 8545 --to <ADDRESS_HEX>:15 --private

The --private flag splits the payment into separate, independent transactions for each required denomination, preventing output linking.

6. P2P CoinJoin

Nodes coordinate uniform-denomination CoinJoin transactions over the p2p network to obfuscate UTXO lineage.

Initiate a mix:

midstate wallet mix --path wallet.dat --rpc-port 8545 --denomination 8

This outputs a <MIX_ID>.

Join a mix:

midstate wallet mix --path wallet.dat --rpc-port 8545 --denomination 8 --join <MIX_ID>

7. Mining Rewards

A solo mining node writes its deterministic coinbase seeds to a local log file. These must be imported to the wallet to be spent.

midstate wallet import-rewards --path wallet.dat --coinbase-file ./data/coinbase_seeds.jsonl

CLI Reference

Node

  • node - Start the node daemon.

Wallet

  • wallet create - Initialize a new HD wallet.
  • wallet restore - Restore an HD wallet from a 24-word seed phrase.
  • wallet receive - Generate a WOTS address.
  • wallet generate-mss - Generate an MSS address.
  • wallet compile - Compile a .msc script.
  • wallet list - Display controlled coins and unused keys.
  • wallet balance - Display aggregate balance.
  • wallet scan - Scan blockchain for incoming coins.
  • wallet send - Construct and broadcast a transaction.
  • wallet mix - Participate in a CoinJoin session.
  • wallet history - Display past transactions.
  • wallet pending - Display transactions awaiting block inclusion.
  • wallet import-rewards - Import coinbase seeds from node logs.

RPC (Debug)

  • state - Display chain height, depth, and midstate.
  • mempool - Display pending transactions.
  • peers - List active p2p connections.

MidstateLabs

MidstateLabs will be the software company that continues to develop midstate. In addition to the ongoing development, it will be the company responsible for running the bootstraps, formal messaging the community, and selling the up-and-comping MidtateAxe hardware.


Releases

Contributors

Languages