Research & Development
Tomoya
Nagasawa
Hacker and engineer for thirty-plus years. My research is in the algorithms and mathematics under data systems: codes, trees, proofs and composition, worked out down to the bit.

Research
All research (24) →- A log-structured store across trust tiersDraft
A key-value store whose layers sit on tiers of different speed and trust: a volatile tier that answers at once, a durable ordered log, and immutable segments. Reads equal the sequential map, flush and compaction preserve it, tombstones may be dropped exactly at the bottom level, re-encoding with any lossless codec is safe, recovery is exact, finalised state is never rolled back, and a wrong state root has one-step evidence.
Databases · Distributed SystemsLog-structured merge trees · Write-ahead logging · Replay verification - Demurrage at constant costDraft
A holding cost on money, applied through share accounting: only the total supply decays, so every holder is charged in proportion at constant cost per operation. Decay is independent of when updates happen exactly when it is geometric; a linear per-interval rule rewards frequent updates by exactly r²ab·S; floor rounding stays within one unit per operation and never pays out more than the supply; supply plus collected pool is conserved.
EconomicsDemurrage · Share accounting · Functional equations - Upgrading everything but the storeDraft
An architecture in which one persistent key-value store is fixed and every other component, including the registry that names components, can be replaced. Upgrades never touch stored state; only setters write; flattened keys are faithful exactly when the key encoding is injective; positional layouts collide where keyed ones cannot; a two-step role transfer opens a stale-writer window that an atomic or revoke-first transfer closes; registry replacement keeps every name resolvable under a stated ordering; and the set of components that can change a binding is a reachability closure.
Distributed Systems · Formal Methods · Smart ContractsDynamic software updating · Access control · Key-value storage - Small integers at bit granularityDraft
Length functions, prefix-freeness and Kraft sums for 2-bit selector integer codes, compared with LEB128 and Elias-γ, and what they cost under a geometric source.
Data EncodingInteger codes · Prefix codes · Kraft inequality - Trees as columnsDraft
A JSON tree written as two pre-order pointer arrays plus typed value columns, packed at the bit level, and an update scheme in which each edit is a small payload addressed against the previous materialized state.
Data Encoding · DatabasesTree encoding · Columnar layout · Delta coding · Incremental update
Papers
All papers →Bit-Level Columnar Coding of JSON Trees with Append-Only Delta Chains
A JSON encoding that drops byte alignment for variable-width bit fields. One pre-order scan splits a document into twelve column streams coded with width-selecting integer codes, a ±3 delta window and run-length packing; the only count written is the number of leaves. The integer codes are proved prefix-free with closed-form lengths, and the slot and leaf sequences are proved to determine the tree. The same grammar serves as an update format whose length-framed payload chains replay to every version. Sizes computed from the specification on seeded synthetic data: arrays of records take 52–55% of the size of the shortest MessagePack encoding; an interleaved time series is 21% larger.
Canonical Arithmetization of JSON Documents, with Authenticated Stores and Zero-Knowledge Path Queries
A canonical encoding of JSON values into elements of the BN254 scalar field, proved injective on a precisely stated domain by giving every stage a left inverse: flattening into (path, leaf) rows with empty containers as leaves, shortlex-sorted paths, type-tagged integers, length-prefixed decimal tokens with run compression, and 75-digit blocks behind a guard digit. On this encoding, path queries and non-existence are defined as relations over a commitment and decided exactly by a walk over the token grammar; the paper states what a circuit must constrain for soundness, with an analytic constraint estimate, and specifies a two-level sparse Merkle store with an injective radix map from ids to leaves. All encoding results are machine-checked in Lean 4.