Run these commands from the project root with Python 3.10 or later. Wallet generation, signing, and signature verification use OpenSSL 3.5 or later with secp256k1 and ML-DSA-44 support. Set BITKEELMARK_OPENSSL to the executable path if needed. Keep wallet directories under the ignored .local directory or on the custodian's own machine.
Run a local chain
1..5 | ForEach-Object { python -m chain keygen ".local/wallets/custodian-$_" }
$miner = (python -m chain keygen .local/wallets/miner | ConvertFrom-Json).address
$worker = (python -m chain keygen .local/wallets/worker | ConvertFrom-Json).address
python -m chain manifest .local/custodians.json .local/wallets/custodian-1 .local/wallets/custodian-2 .local/wallets/custodian-3 .local/wallets/custodian-4 .local/wallets/custodian-5
python -m chain init .local/custodians.json
python -m chain mine $miner
python -m chain transfer .local/wallets/miner $worker 100000000 .local/payment.json
python -m chain work-share $worker .local/share.json
python -m chain mine $miner --transaction .local/payment.json --share .local/share.json
python -m chain balance $worker
python -m chain verify
python -m chain export .local/explorer.json
The default ledger is .local/bkmk/ledger.sqlite3. Pass --db PATH before the command to select a different database. Each peer needs the same public manifest before starting. manifest reads five local public-wallet files for convenience. For independent custody, each custodian generates a wallet and shares their address. Save the five addresses as a JSON array and distribute that manifest. All output commands require a fresh destination path.
Amounts are in atomic units, with 100,000,000 atomic units per BKMK. The transfer command writes a signed payment. Attach it to a block with mine --transaction FILE. Use --commitment HEX on transfer to include a signed 32-byte lowercase hex commitment. A work share binds to the tip used when it was mined and can be attached only to its immediate successor. For another share to the same address in the same window, set --start-nonce above the prior result's nonce.
Prepare reserve spends with reserve-propose ADDRESS AMOUNT_ATOMIC PROPOSAL.json. Each custodian adds their signature with reserve-approve WALLET INPUT.json OUTPUT.json. Pass each resulting JSON file to the next custodian. At height 210,001 or later, attach the final transaction to a mined block.
Consensus
- Genesis commits to the five sorted custodian addresses and issues 300,000,000 BKMK to the reserve. Its balance is separate from ordinary accounts. The reserve can authorize partial spends starting at block 210,001 with valid hybrid signatures from three distinct manifest custodians. Approvals are ordered by address.
- The network has identifier
bitkeelmark-devnet-v1. Consensus objects encode sorted compact ASCII JSON. The genesis hash uses double SHA-256 over the genesis domain and canonical genesis record. Each block links its parent hash and commits to the complete transaction and share lists. Block hashes use double SHA-256 over the block domain, the double SHA-256 of the canonical block body withouthashornonce, and the unsigned 64-bit big-endian nonce. The hash interpreted as a big-endian integer must be at most2^244 - 1. Block timestamps must be non-decreasing. Each block adds equal work. Nodes keep their current chain on a tie. - Payments and reserve spends sign their canonical payload and genesis hash under the transaction domain. Ordinary payments also commit to the sender's hybrid public keys. The next nonce is one above the account's current nonce, starting at one. Transactions execute in block order before that block's subsidy is spendable. The devnet has no fees or coinbase maturity.
- Each block uses
lab.economicsfor subsidy. It pays 95% rounded up to the block producer and divides the remaining 5% rounded down among included valid shares. A share uses double SHA-256 over the share domain, the double SHA-256 of its canonical genesis, parent, height, and payout address fields, and the unsigned 64-bit big-endian nonce. Its big-endian hash must be at most2^248 - 1. Each distinct address and nonce pair earns one point. The economics module allocates atomic-unit remainders deterministically. In a window without shares, the block producer receives the pool for solving the block's proof of work. - Domain prefixes are the ASCII strings
BKMK genesis,BKMK block,BKMK share, andBKMK transaction, each followed by a zero byte. Blocks are limited to 512 KiB, 32 transactions, and 256 shares. Issuance reaches the 30,000,000,000 BKMK cap at height 2,100,000. - Reorganizations replay a strictly heavier chain from genesis and commit the resulting tip and balances together.
verifyindependently replays stored blocks and compares balances, reserve, nonces, and scheduled issuance.
The easy fixed difficulty is for isolated development. Block producers choose which shares to include. A share proves hashing work for its block window. It gives no evidence of uptime or application execution. The ledger uses accounts and hybrid transfer signatures with its own serialization. It does not implement Bitcoin's UTXO format, peer wire protocol, or scripts.
References and validation
- Proof-of-work comparison and height-based lock design were reviewed against Bitcoin Core v31.1, licensed under MIT, and BIP 65. No Bitcoin Core source is bundled here. Bitcoin Core proof of work · BIP 65
- Hashing and transaction storage use Python's standard
hashlibandsqlite3modules. SQLite uses its default rollback journal. The ledger was tested on Python 3.14.10 and SQLite 3.50.4. Python SHA-256 API · SQLite transactions
python -m unittest chain.test_ledger lab.test_economics -v