ZOSCII Tamperproof Blockchain

Implementation Guide for Developers

(c) 2025 Cyborg Unicorn Pty Ltd - MIT License

Key Features: Quantum Resistant Information-Theoretic Security Fast Verification Scalable Architecture

Table of Contents

Overview

The ZOSCII Tamperproof Blockchain (ZTB) provides:

Key Concepts

Traditional Blockchains vs ZTB

Aspect Traditional Blockchain ZTB
Block Linking Cryptographic hashes (SHA-256) ZOSCII pointer encoding
Security Basis Computational difficulty Combinatorial impossibility
Quantum Threat Vulnerable Immune
Data Structure Linear chain Tree (trunk + branches)
Decoding Speed Hash verification O(1) pointer lookup

Core Components

1. Genesis ROM (64KB)

Immutable root of trust. Contains random data with all 256 byte values (0-255) present.

⚠️ Lost Genesis ROM = Unrecoverable Blockchain

2. Rolling ROM (64KB)

Built from samples of previous blocks (up to 64 blocks × 1KB each). Acts as encoding table for each new block.

3. ZOSCII Encoding

Each byte (1 byte) → pointer (2 bytes) into Rolling ROM. Random selection creates non-deterministic encoding.

Architecture

Chain Structure

Genesis ROM (64KB random data)
        ↓
    Trunk Block 1 (encoded)
        ↓
    Trunk Block 2 (encoded)
        ├─→ Branch A Block 1 (encoded)
        │       ↓
        │   Branch A Block 2 (encoded)
        │
        ├─→ Branch B Block 1 (encoded)
        │       ↓
        │   Branch B Block 2 (encoded)
        ↓
    Trunk Block 3 (encoded)

Block Types

Command-Line Tools

1. ztbcreate - Genesis ROM Creator

Creates the 64KB high-entropy Genesis ROM file.

ztbcreate <output_genesis_rom_file>

Example:

ztbcreate genesis.rom
⚠️ CRITICAL: Keep this file secure and backed up. Loss = unrecoverable blockchain.

2. ztbaddblock - Block Creator

Adds a new block to an existing chain (trunk or branch).

# Add text block
ztbaddblock <genesis_rom> <chain_id> -t "text string"

# Add file block
ztbaddblock <genesis_rom> <chain_id> -f <file_path>

Examples:

# First block creates new trunk
ztbaddblock genesis.rom MyTrunk -t "Genesis block"

# Add subsequent blocks
ztbaddblock genesis.rom MyTrunk -t "Block 2"
ztbaddblock genesis.rom MyTrunk -f invoice.pdf

3. ztbaddbranch - Branch Creator

Creates a new branch splitting from a trunk block.

ztbaddbranch <genesis_rom> <trunk_id> <new_branch_id> -t "text"
ztbaddbranch <genesis_rom> <trunk_id> <new_branch_id> -f <file>

Example:

# Create trunk
ztbaddblock genesis.rom CompanyLedger -t "2025 Books"

# Branch off for departments
ztbaddbranch genesis.rom CompanyLedger Sales -t "Sales Genesis"
ztbaddbranch genesis.rom CompanyLedger Marketing -t "Marketing Genesis"

4. ztbfetch - Block Fetcher & Decoder

Retrieves and decodes a specific block, verifying its integrity.

ztbfetch <genesis_rom> <chain_id> <block_index>

Examples:

# Fetch from trunk
ztbfetch genesis.rom MyTrunk 3

# Fetch from branch
ztbfetch genesis.rom ClientA 2

5. ztbverify - Chain Verifier

Verifies integrity of chains by working backwards from latest block to Genesis.

# Verify trunk and all branches (default)
ztbverify <genesis_rom> <trunk_id>

# Verify trunk only
ztbverify <genesis_rom> <trunk_id> -t

# Verify all branches only
ztbverify <genesis_rom> <trunk_id> -bb

# Verify specific branch
ztbverify <genesis_rom> <trunk_id> -b <branch_id>

6. ztbcheckpoint - Checkpoint Creator

Creates an archival boundary for pruning old blocks.

ztbcheckpoint <chain_id> <genesis_rom> <previous_block_guid>

Example:

# At end of financial year
ztbcheckpoint FY2024 genesis.rom last_block_of_2024_guid

File Formats

Genesis ROM File

Block Filename Convention

<chain_id>_<index>_<block_guid>.ztb

Examples:

MyTrunk_0001_A0B9845E-1234-4567-89AB-CDEF01234567.ztb
ClientA_0002_B1C0956F-2345-5678-9ABC-DEF012345678.ztb

Rolling ROM Construction

Construction Algorithm

  1. Start with empty 64KB buffer
  2. Sample from BRANCH BLOCKS (if on branch):
    • Copy first 1KB of ENCODED data from each block
    • Maximum: 64 blocks
  3. Sample from TRUNK BLOCKS (if space remains):
    • Copy first 1KB of ENCODED data
    • Continue until buffer full
  4. Fill remainder with GENESIS ROM data

Why ENCODED Data?

The encoded addresses themselves are the entropy source. Original payload might be boring, but random address selection creates high entropy. Copying encoded addresses preserves this entropy.

Security Model

Tamperproof Guarantee

If an attacker modifies Block N:

  1. Block N's encoded data changes
  2. Block N+1's pointers now point to wrong locations
  3. Probability of pointers still resolving correctly: ~10^-152900

This is combinatorially infeasible - not just hard, but information-theoretically impossible.

Why Quantum-Resistant?

Attack Vector Traditional Blockchain ZTB
Shor's Algorithm Breaks PKI No PKI to break
Grover's Algorithm Weakens hashing No hashing used
Brute Force 2^256 operations 10^152900 permutations
Quantum Computer Eventually vulnerable Immune

Build Instructions

# Compile all tools
make

# Clean build artifacts
make clean

# Individual compilation
gcc -o ztbcreate ztbcreate.c ztbcommon.c -O2
gcc -o ztbaddblock ztbaddblock.c ztbcommon.c -O2
gcc -o ztbaddbranch ztbaddbranch.c ztbcommon.c -O2
gcc -o ztbfetch ztbfetch.c ztbcommon.c -O2
gcc -o ztbverify ztbverify.c ztbcommon.c -O2
gcc -o ztbcheckpoint ztbcheckpoint.c ztbcommon.c -O2

Example Workflows

Basic Trunk Chain

# 1. Create Genesis ROM
./ztbcreate genesis.rom

# 2. Create trunk chain
./ztbaddblock genesis.rom MyTrunk -t "Block 1"
./ztbaddblock genesis.rom MyTrunk -t "Block 2"
./ztbaddblock genesis.rom MyTrunk -t "Block 3"

# 3. Verify
./ztbverify genesis.rom MyTrunk

# 4. Fetch specific block
./ztbfetch genesis.rom MyTrunk 2

Hierarchical Organization

# 1. Create genesis
./ztbcreate genesis.rom

# 2. Create company trunk
./ztbaddblock genesis.rom CompanyLedger -t "FY2025 Genesis"

# 3. Branch for departments
./ztbaddbranch genesis.rom CompanyLedger Sales -t "Sales Dept"
./ztbaddbranch genesis.rom CompanyLedger Marketing -t "Marketing Dept"

# 4. Add department records
./ztbaddblock genesis.rom Sales -f invoice_001.pdf
./ztbaddblock genesis.rom Marketing -f campaign_q1.doc

# 5. Verify everything
./ztbverify genesis.rom CompanyLedger

Important Notes

Critical Requirements

Best Practices