(c) 2026 Cyborg Unicorn Pty Ltd - MIT License
Creates the genesis block - the immutable "seed" that anchors your entire blockchain.
Every blockchain starts here. This 64KB file of high-entropy data becomes the root of trust. Without it, nothing else works.
Once, at the very beginning, before creating any blocks.
ztbcreate selfie.jpg . A0000001-0000-4000-8000-000000000001
ztbcreate <source1> [source2] [source3] <workdir> <new_block_id>
Note: 1 to 3 source files are recommended to be JPEGs, MP3s, or some other capture of real-world physics.
Adds a new block of data to an existing chain (trunk or branch).
This is how you store data on the blockchain - documents, transactions, records, anything.
Every time you want to add new data to your chain.
prev_block_id through prior blocks<new_block_id>.ztbworkdir - directory containing the genesis block and all chain blockschain_id - a label of your own choosing, for your own bookkeeping only (not stored in the file)new_block_id - the ID this new block will be saved underprev_block_id - the ID of the block this one links to; use 00000000-0000-0000-0000-000000000000 for the first block of a chain-t "text" or -f filename - the payload, as a text string or a file's contents# First block on a new trunk
ztbaddblock . MyTrunk A0000001-0000-4000-8000-000000000002 00000000-0000-0000-0000-000000000000 -t "Invoice #001"
# Second block, linked to the first
ztbaddblock . MyTrunk A0000001-0000-4000-8000-000000000003 A0000001-0000-4000-8000-000000000002 -t "Invoice #002"
# Add a file as the payload
ztbaddblock . MyTrunk A0000001-0000-4000-8000-000000000004 A0000001-0000-4000-8000-000000000003 -f contract.pdf
Creates a new branch that splits off from any existing block — typically the current tip of a trunk.
Perfect for organizing data hierarchically. Think: trunk = company, branches = departments. Or trunk = financial year, branches = accounts.
When you want to create a separate but linked chain of blocks.
prev_block_id, with the branch flag set and the trunk's chain ID recorded in its headerztbaddblock tool# Create main company trunk
ztbaddblock . CompanyLedger B0000001-0000-4000-8000-000000000002 00000000-0000-0000-0000-000000000000 -t "2025 Books"
# Branch off for departments
ztbaddbranch . CompanyLedger Sales B0000001-0000-4000-8000-000000000003 B0000001-0000-4000-8000-000000000002 -t "Sales Q1"
ztbaddbranch . CompanyLedger Marketing B0000001-0000-4000-8000-000000000004 B0000001-0000-4000-8000-000000000002 -t "Marketing Q1"
# Now add blocks to a branch using ztbaddblock
ztbaddblock . Sales B0000001-0000-4000-8000-000000000005 B0000001-0000-4000-8000-000000000003 -t "Sale #001"
Retrieves and decodes a specific block by its ID.
To actually read the data you stored! Blocks are ZOSCII-encoded, so you need this tool to decode them.
Whenever you want to see what's in a block.
ztbfetch . A0000001-0000-4000-8000-000000000003
# Output shows:
# - Block header (block ID, prev ID, trunk ID, branch flag, block type)
# - Hash and prev-hash verification results
# - Your decoded payload
Verifies that your blockchain is intact and untampered, starting at a given block.
To prove your data hasn't been altered. If anyone modifies even one byte in an earlier block, verification fails as soon as that block is reached.
ztbfetch)-walk, follows prev_block_id back through the chain, repeating the check on every block, until it reaches the start of the chain or a truncation marker-walk, checks only the one block you named-walk - walk backwards and verify the entire chain# Verify just one block
ztbverify . A0000001-0000-4000-8000-000000000004
# Verify the whole chain back to the start
ztbverify . A0000001-0000-4000-8000-000000000004 -walk
Result: if any block has been tampered with, verification stops and reports failure at that block.
Writes a documented anchor point into the chain — a block whose only job is to carry a human-readable label, ready to be the basis of a later truncation.
It's the first step in archiving old data: you mark a point in the chain, then use ztbtruncate to actually cut history off below it.
Checkpointztbcheckpoint . FY2025 C0000001-0000-4000-8000-000000000004 C0000001-0000-4000-8000-000000000003 "End of financial year 2025"
Cuts a chain's history off at a checkpoint, so everything below it can be moved to cold storage while the active chain stays fully verifiable on its own.
Over time, chains grow huge. Truncation lets you archive historical data without breaking the chain above the cut point.
Right after you've placed a checkpoint, and before adding any further blocks above it.
# Build to the checkpoint
ztbaddblock . FY2025 C0000001-...0002 00000000-...-000000000000 -t "Block 1"
ztbaddblock . FY2025 C0000001-...0003 C0000001-...0002 -t "Block 2"
ztbcheckpoint . FY2025 C0000001-...0004 C0000001-...0003 "End of FY2025"
# Truncate immediately
ztbtruncate . C0000001-...0004
# Now keep going — new blocks build correctly on the truncated chain
ztbaddblock . FY2026 C0000001-...0005 C0000001-...0004 "First FY2026 entry"
Scenario: Accounting firm tracking invoices for separate clients
# 1. Start fresh
ztbcreate selfie.jpg . D0000001-0000-4000-8000-000000000001
# 2. Create main trunk for 2025
ztbaddblock . FY2025 D0000001-0000-4000-8000-000000000002 00000000-0000-0000-0000-000000000000 -t "Financial Year 2025"
# 3. Create branches for different clients
ztbaddbranch . FY2025 ClientA D0000001-0000-4000-8000-000000000003 D0000001-0000-4000-8000-000000000002 -t "Client A Account"
ztbaddbranch . FY2025 ClientB D0000001-0000-4000-8000-000000000004 D0000001-0000-4000-8000-000000000002 -t "Client B Account"
# 4. Add invoices to Client A
ztbaddblock . ClientA D0000001-0000-4000-8000-000000000005 D0000001-0000-4000-8000-000000000003 -t "Invoice #1001"
ztbaddblock . ClientA D0000001-0000-4000-8000-000000000006 D0000001-0000-4000-8000-000000000005 -f invoice_1002.pdf
# 5. Add an invoice to Client B
ztbaddblock . ClientB D0000001-0000-4000-8000-000000000007 D0000001-0000-4000-8000-000000000004 -t "Invoice #2001"
# 6. Retrieve a specific invoice
ztbfetch . D0000001-0000-4000-8000-000000000006
# 7. Verify everything is intact
ztbverify . D0000001-0000-4000-8000-000000000006 -walk
# 8. At year-end, checkpoint and truncate
ztbcheckpoint . FY2025 D0000001-0000-4000-8000-000000000008 D0000001-0000-4000-8000-000000000002 "End of FY2025"
ztbtruncate . D0000001-0000-4000-8000-000000000008
# 9. Archive everything below the truncated block, keep building forward for FY2026
If you change any byte in a block, every later block whose Rolling ROM sampled that block fails verification. The ZOSCII pointer encoding makes forgery combinatorially impossible (10^152900 combinations).
There is no auto-generated numbering. Every block ID — a GUID or any string up to 36 characters — is supplied by you on the command line, and you're responsible for tracking which ID is the current "tip" of each chain between commands.
Every block commits to two integrity hashes: a hash covering just the payload data (calculated before the data is encoded), and a hash of the previous block's complete file. The current block's hash is deliberately payload-only — it doesn't cover the header fields (block ID, previous block ID, branch info). That's intentional: keeping the hash limited to the payload means it can eventually be computed as the data streams in, rather than needing the whole block finished first. Header tampering is still caught, just by a different mechanism — the header sits within the portion of each block sampled into the Rolling ROM of later blocks, so it's protected the same combinatorial way the payload is. This dual-hash binding is a standard feature of all blocks — there are no optional modes. The first block of a chain has no predecessor; its prev-hash is zero by design.
The C command-line tools use CRC32 over the full payload as their hash algorithm. The C# reference library additionally supports a ZRollingHash algorithm and a 1KB-window variant of each, selectable per block — these are recognized but not yet computed by the C tools.
Every block carries a block_type field in its header. The types are: Genesis (the root 64KB block), Normal (standard data — also used for branch blocks), Checkpoint (documented anchor point), Truncation (written by ztbtruncate; makes a chain self-contained without its original genesis block), Finalise (soft close marker), and Bridge (reserved).
This isn't encryption - it's addressing. The data is encoded as pointers into the Rolling ROM. Without the exact Rolling ROM, the pointers are meaningless.
Checkpoints plus truncation let you create self-contained archives that verify independently. Perfect for legal compliance, backups, and long-term storage.
Use branches like folders. Trunk = main timeline, branches = parallel sub-timelines. Both verify together by walking back through the branch into the trunk.
| Command | Purpose | Example |
|---|---|---|
| ztbcreate | Create genesis block | ztbcreate selfie.jpg . <new_id> |
| ztbaddblock | Add data block | ztbaddblock . chain <new_id> <prev_id> -t "text" |
| ztbaddbranch | Create new branch | ztbaddbranch . trunk branch <new_id> <prev_id> -t "text" |
| ztbcheckpoint | Mark archival boundary | ztbcheckpoint . chain <new_id> <prev_id> "label" |
| ztbtruncate | Archive below checkpoint | ztbtruncate . <checkpoint_id> |
| ztbfetch | Read block data | ztbfetch . <block_id> |
| ztbverify | Verify integrity | ztbverify . <block_id> -walk |