BitLedger encodes a full double-entry accounting record — value, direction, account pair, settlement status, and three-layer error detection — in exactly 40 bits. BitPads wraps that core for any transmission context, from a one-byte heartbeat to a 44-byte fully annotated civilisational record.
5,000 years of signal · The arc of human record-keeping
Minimal marks. Rich shared context. The accounting principle that BitPads binary pictography implements in nibble streams.
Five bits. Thirty-two signals. BitPads Enhancement Grammar reclaims the 3 upper bits left structurally available for 155 years.
Deep space demanded structured binary. Every bit earned its place when bandwidth was measured in bits per second across millions of miles.
40 bits. The mathematical minimum for a verifiable double-entry record. Deployable from a microcontroller to a Mars colony supply chain.
The Core Protocol
BitLedger is a binary-native protocol designed from first principles at the mathematical definition of a double-entry transaction — not by compressing an existing format. The result: 5 bytes that enforce accounting integrity at the wire level.
A complete double-entry record — value, account pair, direction, status, rounding, and three-layer error detection.
100 transactions. No schema lookup. No decompression step. Fixed bit positions decode directly.
Maximum expressible value in a single record — approximately 305× global GDP. Exact integers only. No floating point.
Layer 3 — The 40-bit transaction record
Polynomial x¹⁵ + x + 1 over the full 49-bit Layer 1 payload. Covers sender identity, domain, permissions. 100% burst-error detection up to 15 bits.
Direction (bit 29) must equal bit 37. Status (bit 30) must equal bit 38. A single cosmic-ray bit-flip in either location is immediately detectable.
For every batch, the sum of all signed flows equals zero. Catches phantom records, duplicates, and missing entries that byte-level CRCs cannot.
Live Protocol Encoder
Enter transaction parameters and press Create to watch the 40-bit record assemble field by field — Multiplicand and Multiplier split, flags packed, account pair encoded, cross-layer mirror bits set. The actual BitLedger encoding algorithm, running in your browser.
Layer 3 — 40-bit Transaction Record
The Infrastructure
BitPads is the outermost layer of the protocol family. A single Meta byte declares frame mode, content type, and enhancement state before the receiver reads a single payload byte. Complexity attaches only when needed — the 1-byte heartbeat and the 44-byte annotated record share the same framing grammar.
Enhancement Grammar — C0 Signal Slots
The C0 Enhancement Grammar reclaims 3 upper bits of Unicode's 32 control characters — structurally available since Baudot's 1870 telegraph codes and never used. These become a universal flag matrix: Priority · Acknowledge · Continuation. Thirteen signal slot positions span the full transmission structure. Binary pictography: four bits per symbol through a shared codebook — the Sumerian accounting principle implemented in binary at sub-byte precision.
Legacy-compatible — a 1960s teleprinter receiving the same byte stream sees standard C0 controls throughout.
Universal Domain
Every system that moves resources between entities is governed by a conservation law whether it knows it or not. Money conserved. Mass conserved. Energy conserved. Data conserved. BitLedger encodes that invariant at the wire level — not as a rule the application must enforce, but as a structural property of the encoding itself.
Double-entry ledger semantics enforced at the encoding level. Debit and credit accounts inferred from a 4-bit pair code.
USD 1,247.50 · Op Expense / Accounts Payable
Propellant mass, power obligations, and mission telemetry — same wire format as financial records. Survives cosmic-ray bit flips.
14.7 kg propellant · Thruster #3 / Tank Reserve
Material flows, work-in-process debts, just-in-time inventory. Conservation invariant enforced: every unit leaving a station must arrive.
240 units · Station A / Station B WIP
Sensor data packets, battery drain, bandwidth usage as conserved quantities. 4-byte anonymous Wave for minimal-overhead reporting.
12.4 Wh · Node 007 / Grid Sink
How It Generalises — The Relationship Archetype Matrix
In Universal Domain mode, the 4-bit account pair field stops being a chart-of-accounts selector and becomes a relationship archetype matrix — 16 canonical flow types between any two entities in any man-made system. The wire format is byte-for-byte identical. Only the semantic interpretation changes.
Binary Pictography — The Codebook Principle
The C0 Enhancement Grammar extends this further with binary pictography: when a stream declares a domain identity, the receiver loads a shared codebook and interprets compact nibble sequences as full semantic events. Four bits per symbol. Sixteen concepts per codebook. The domain field in Layer 1 selects which codebook is active. Extension bytes can chain codebook references for richer ontologies without changing the wire format.
Sumerian clay token accounting worked on exactly this principle: a small impressed mark on a clay tablet carried minimal information — but its meaning expanded dramatically through the shared context both parties held. The token for grain looked like a cone; the token for sheep, a circle. The marks were minimal. The codebook was in the reader's knowledge.
"Four bits per symbol. Sixteen concepts per codebook. The Sumerian accounting principle, implemented in binary at sub-byte precision."
Five thousand years later, BitPads binary pictography is the same architecture at a different scale: a shared codebook declared at session open, compact nibble streams at transmission time, rich semantic events at the receiver. The mark is still minimal. The meaning still lives in the shared context.
Protocol Deep Dive
Every field at every bit position, from the session header to the 40-bit record. Expand any layer to see the full bit specification drawn directly from the protocol documents.
| Bits | Field | Description |
|---|---|---|
| 1 | SOH Marker | Always 1. Self-framing — the receiver knows a record begins without a preamble or sync sequence. |
| 2–4 | Protocol Version | 000–111 (8 versions). Allows future protocol revisions without breaking existing decoders. |
| 5–8 | Core Permissions | Read · Write · Correct · Represent. Four independent capability flags for the sender's authorisation level. |
| 9–12 | Session Defaults | Bit 9: Split order default. Bit 10: Opposing account explicit. Bit 11: Compound mode active (allows 1111 continuation markers). Bit 12: BitLedger block optional. |
| 13–44 | Sender ID | 32-bit integer. Up to 4,294,967,295 unique senders. In a three-level identity session: 255 networks × 255 systems × 65,535 nodes. |
| 45–49 | Sub-Entity ID | 5-bit (31 sub-divisions). Identifies branches, departments, or satellite sub-nodes within the sender identity. |
| 50–64 | CRC-15 Checksum | Computed over bits 1–49 using polynomial x¹⁵ + x + 1. 100% detection of all burst errors up to 15 bits. Embedded during assembly — the receiver validates on arrival. |
| Bits | Field | Description |
|---|---|---|
| 1–2 | Transmission Type | 01=pre-converted · 10=copy · 11=represented. Code 00 is INVALID — ensures the first byte is never all zeros. |
| 3–9 | Scaling Factor | 7-bit index (×1 to ×1,000,000,000). Extends the 25-bit value range to cover any denomination. All records in the batch inherit this default. |
| 10–13 | Optimal Split | 4-bit. Default 8. Governs the A/r decomposition in N = A × 2^S + r. A control record can update S mid-batch. |
| 14–16 | Decimal Position | 000=integer · 010=2 decimal places · 100=4 places · 110=6 places. Applied as divisor after scaling. |
| 17–18 | Enquiry / ACK Bells | Bit 17: request ACK before next batch. Bit 18: confirm previous batch received. Handshake signalling without a separate control record. |
| 19–30 | Separators | Group (4-bit, 15 groups) · Record (5-bit, compound group identity) · File (3-bit, 7 files). Hierarchical context delimiters — mission phase, entity group, logical boundary. |
| 31–35 | Entity ID | 5-bit. Sub-entity within the session — branch, department, satellite node. |
| 36–41 | Currency Code | 6-bit (64 currencies, 0=session default). Seeded 32-currency table built-in; per-record currency override available via extension byte. |
| 42–45 | Rounding Balance | 4-bit sign-magnitude. Tracks cumulative rounding across the batch. 0000=exactly balanced. 1000=ESCAPE, see batch-close control record. |
| 46–47 | Compound Prefix | 00=no compounds · 01=≤3 groups · 10=≤7 groups · 11=unlimited. Must be non-zero for 1111 continuation markers to be valid. |
| 48 | Reserved | Always 1. Ensures the last byte of the header is never all zeros. |
| Bits | Field | Description |
|---|---|---|
| 1–17 | Multiplicand | Upper value bits. At default Optimal Split of 8: A = floor(N / 256). Carries the bulk of the value magnitude. |
| 18–25 | Multiplier / Quantity | Lower value bits. r = N mod 256. When bit 32=1 (Quantity Present), this field carries the item count; Multiplicand carries unit price. |
| 26–27 | Rounding Signal | 00=exact · 10=rounded down · 11=rounded up · 01=protocol error (reject record). Rounding direction is chosen by account type at encode time — never silent. |
| 28 | Split Order | 0=follow session default · 1=reverse. Allows the Multiplier-first convention for quantity×price records without a new batch header. |
| 29 | Direction (Set A) | 0=In · 1=Out. MUST equal bit 37 — cross-layer validation catches single-bit corruption immediately. |
| 30 | Status (Set A) | 0=Paid / Settled · 1=Debt / Accrued. MUST equal bit 38. |
| 31 | Debit/Credit | 0=Credit · 1=Debit. Combined with Account Pair and Direction to fully specify the journal entry without ambiguity. |
| 32 | Quantity Present | 0=flat value · 1=split active (Price × Quantity). When set, Optimal Split is always taken from session state regardless of bit 27. |
| 33–36 | Account Pair | 4-bit code. 16 canonical account pair relationships. See Account Pairs panel below. |
| 37 | Direction (BL) | Mirror of bit 29. Independent error detection — a cosmic-ray flip in either copy is immediately detected. |
| 38 | Status (BL) | Mirror of bit 30. Same cross-layer validation principle. |
| 39 | Completeness | 0=Full record · 1=Partial, continuation follows. Must be 1 before a 1111 compound continuation marker. |
| 40 | Extension Flag | 0=record complete · 1=extension byte follows. Extension bytes are chainable — bit 8 of each triggers the next. |
The 4-bit account pair field encodes the fundamental relationship between the two sides of a double-entry transaction. In financial mode, these are chart-of-accounts pairs. In Universal Domain mode, these become the 16 canonical relationship archetypes for any flow between entities.
| Variable | Source | Meaning |
|---|---|---|
| S | Optimal Split (Layer 2) | Default 8. Governs the decomposition point. A control record can update S mid-batch without restarting the session. |
| A | Multiplicand (bits 1–17) | floor(N / 2^S). The upper portion of the integer value. |
| r | Multiplier (bits 18–25) | N mod 2^S. The lower remainder. Together A and r reconstruct N exactly — no gaps from 0 to 33,554,431. |
| SF | Scaling Factor (Layer 2) | ×1 to ×1,000,000,000. Extends the value range to cover any denomination from cents to quadrillions. |
| D | Decimal Position (Layer 2) | 0, 2, 4, or 6 decimal places. Applied as a divisor after scaling. |
| Type (TTT) | Function | Payload |
|---|---|---|
| 000 | Scaling Factor Change | 0000–1001: SF index. 1111: escape — next byte carries full 7-bit SF. |
| 001 | Currency Change | 0000–1110: currency index. 1111: escape — next byte carries 6-bit code. |
| 010 | Batch Close | Payload: record count 0–14. 1111: escape — next byte carries full count. |
| 011 | ACK / NACK | Bit 5=0 ACK · Bit 5=1 NACK. Bits 6–8: batch sequence reference 0–7. |
| 100 | Compound Group Open | Payload: record count 1–14 expected in the compound group. |
| 101 | Optimal Split Update | Payload: new S value 0–15. Reverts to Layer 2 default at batch close. |
| 110 | Layer 2 Short-Form | Payload 1111: all Layer 2 values equal session defaults. Replaces 48-bit header with 1 byte. |
| 111 | Reserved | Transmit payload as 1111. |
The C0 Enhancement Grammar reclaims the 3 upper bits of Unicode's 32 control characters — structurally available since Baudot's 1870 codes and never used in 155 years of protocol evolution. These 3 bits become a universal flag matrix carried on any agreed C0 control byte.
| Bits (upper 3) | Flag | Meaning when set |
|---|---|---|
| bit 7 | Priority | This transmission or signal requires expedited handling at the receiver. |
| bit 6 | Acknowledge Request | Receiver must confirm receipt of this slot before processing continues. |
| bit 5 | Continuation | The signal or event at this slot continues into the next declared slot position. |
13 named signal slot positions span the full BitPads transmission structure:
Assembly CLI — v0 Reference Implementation
The BitPads v0 CLI is implemented entirely in hand-assembled x86-64 NASM assembly for macOS — no C runtime linked, no dependencies, direct kernel syscalls via syscall. A 256-byte context block is populated from command-line flags and routed to layer builders. Each builder writes to a stack-allocated output buffer. No heap. No post-processing.
A single Meta Byte 1 = 0x00. No Layer 1 header, no payload. The entire meaning lives in session context. One byte from heartbeat to status report.
Wave frames carry no Layer 1 session header. The Setup Byte is auto-inserted because Tier 1 overrides the session default of Tier 3. Value 255 encodes as a single byte at Tier 1.
The 32-bit sender ID is never stored contiguously — it spans bytes 1–5, interleaved with domain and permission fields. The CRC-15 covers the full 49-bit Layer 1 payload, binding sender identity to the checksum.
The Note block is always the last component. A length byte precedes the raw UTF-8 payload, capping at 63 bytes. The receiver reads Role C flags from Meta Byte 1 left-to-right (Value, Time, Task, Note) to determine what follows.
Layer 1 byte[0] packs SOH (bit 7), 2-bit domain (bits 5–4), and 4-bit permissions (bits 3–0) in a single byte. Engineering domain = 01 binary. Permissions are a bitfield — each bit an independent capability grant.
Assembly sequence is fixed: Setup Byte → value → time → task → note. The receiver uses Meta Byte 1 as a map and Meta Byte 2 for encoding overrides, advancing through fixed-width blocks in declaration order. No inline type or length markers between components.
Layer 2 is inserted between Layer 1 and the meta bytes. Even a bare --layer2 produces a fully populated 6-byte structure because all fields have defined defaults. Transmission type 0x00 is a protocol error — the default is 0x40.
Layer 3 adds the 5-byte double-entry record after the meta bytes. Account pair 1 = Debtor/Creditor. The frame type in Layer 1 tells the receiver to expect Layer 3. Meta bytes still govern optional blocks (value, time, task, note) that can follow.
Account pair 1111 is the protocol join marker — exclusively for compound continuation. Valid only when Layer 1 bit 11 (compound mode) = 1 AND Layer 2 compound prefix ≠ 00. Either condition alone is insufficient. The receiver links this record to its predecessor with the Completeness bit as the initiating signal.
The telem shorthand auto-sets domain=Engineering and category=14 (Telegraph Emulation). Telegraph byte packs message type in upper 3 bits and inline payload in lower 5. Heartbeat type = bits[7:5]=101. No Layer 1 header — 3-byte total.
All telegraph messages share the same 3-byte frame layout. The only difference is the telegraph byte. Status type contributes 0x00 to bits[7:5]; code 2 fills the lower 5 bits. Legacy hardware receiving this stream sees standard C0 controls throughout — BEL rings, EOT closes.
Same result as using --type telem. The distinction is at the CLI level only. Category 14 in Meta Byte 1 activates Role B mode — the receiver treats the next byte as a telegraph header regardless of which path generated it.
Enhancement Flag in Layer 1 activates C0 grammar for the session. Meta Byte 2 bit[0] signals that a Signal Slot Presence byte (SSP) follows. SSP 0x87 declares P4 active — it fires immediately before the value block. Assembly order: meta pair → SSP → P4 signal → Setup Byte → value. Position is absolute; skipping a declared slot is a protocol violation.
Category 12 activates the Compact Command sub-protocol. The command byte packs class (upper nibble) and parameter count code (lower nibble). Class 2 = Configure → 0x20. Count 1 → 0x04. Parameter bytes follow in declaration order. No Setup Byte or value encoding applies — the compact command payload is entirely self-described.
Industry Context
No decompression step. No schema lookup. No length-prefixed string parsing. The decoder reads fixed bit positions and the record is complete. On a link measured in bits per second, this matters enormously.
vs. ISO 8583
Nearest binary peer. BitLedger adds native double-entry account-pair semantics, compound continuation markers, session-layer CRC, and cross-domain capability.
vs. NACHA / ISO 20022
Strong double-entry semantics but text-based or XML by default. No per-record CRC-15. Designed for nightly batch settlement, not real-time low-bandwidth links.
vs. TigerBeetle / Protobuf
Storage engines and general serialisation, not transmission protocols. TigerBeetle's Transfer record is 128 bytes. BitLedger's is 5 — orders of magnitude leaner for constrained links.
Five protocol documents. Every wire format decision logged. Open specification under active development by Babb Works Inc.
"The protocol did not set out to be universal. It became universal because the conservation invariant is universal."
— BitPads README
Pilot Programme