Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d0b9847
chore: workspace + Changesets bootstrap (T-2)
ignromanov May 19, 2026
31b7868
feat(types): package skeleton — TS type declarations (T-4)
ignromanov May 19, 2026
5d4388f
feat(networks): package skeleton — 5 EVM chain configs (no RPC keys) …
ignromanov May 19, 2026
1de5be5
feat(codec): package skeleton — Rust hello-world + wasm-pack manifest…
ignromanov May 19, 2026
969e5f8
ci: Phase 1 scaffold — release.yml LOCKED filename + ci.yml + dependa…
ignromanov May 19, 2026
7384373
docs: Phase 1 documentation foundation — README + CoC + SECURITY + ar…
ignromanov May 19, 2026
f064665
lint: scaffold ESLint 9 flat + Prettier + clippy + rustfmt (T-7)
ignromanov May 19, 2026
53f43ac
chore: persist ESLint deps in package.json + lockfile (T-7 follow-up)
ignromanov May 19, 2026
ae692e6
chore(codec): bump to 0.0.1 for crates.io name reservation
ignromanov May 19, 2026
deebae5
spike(brotli): measure compression + WASM blob — B-i ruled out, B-iv …
ignromanov May 20, 2026
80860e3
spike(bigint): WASM<->JS boundary failure-mode + regression test (D-B11)
ignromanov May 20, 2026
2e1179f
deps(codec): lock Phase 2 dependency set (T-P2-1)
ignromanov May 20, 2026
2cea71e
fix(codec): drop redundant js_sys import — clippy single-component-pa…
ignromanov May 20, 2026
6e7c597
feat(codec): CodecError 9-variant error enum (T-P2-2)
ignromanov May 20, 2026
76cc793
feat(codec): LEB128 varint primitive, MAX_BYTES=37 (T-P2-3)
ignromanov May 20, 2026
74100d0
fix(codec): drop guarded unwrap in shr7_le — AC-15 no-unwrap discipli…
ignromanov May 20, 2026
c3a8acc
feat(codec): TLV record primitives, BTreeMap byte-stable (T-P2-4)
ignromanov May 20, 2026
ec17a0e
feat(codec): phf static dictionaries app + chain (T-P2-5)
ignromanov May 20, 2026
00f1feb
test(codec): lock dictionary snapshot hashes (T-P2-5)
ignromanov May 20, 2026
c19d645
feat(codec): keccak256 content-hash primitive (T-P2-6)
ignromanov May 20, 2026
6f9d0a1
chore(codec): drop brotli-decompressor dep — B-iv superseded by B-v r…
ignromanov May 20, 2026
7759eb3
fix(codec): resolve clippy::format_collect warnings in proptest helpers
ignromanov May 20, 2026
2b69236
feat(codec): B-v canonical encode/decode WASM layer (T-P2-7-alt)
ignromanov May 20, 2026
ba52e5b
refactor(codec): drop tsify + serde_json from production deps
ignromanov May 20, 2026
a1e6753
feat(codec): B-v JS shim — wire encode/decode over brotli-wasm (T-P2-…
ignromanov May 20, 2026
f51851c
style(codec): cargo fmt — resolve fmt --check CI gate (Iris Gate A2)
ignromanov May 20, 2026
575517d
feat(codec): bridge receiptHash JS export (T-P2-9b)
ignromanov May 20, 2026
1cf710d
fix(codec): make proptest target-conditional — unblock wasm-pack test…
ignromanov May 20, 2026
71a2a93
fix(codec): wasm_boundary.rs calls compute_content_hash directly (T-P…
ignromanov May 20, 2026
56e9845
fix(ci): install wasm-pack in lint-and-build job
ignromanov May 20, 2026
616ccb4
feat(codec): widen amount domain u128 -> U256 (T-P2-12a)
ignromanov May 20, 2026
e7b0340
feat(codec): 17 golden vectors v4-codec.json (T-P2-12, schema_version=1)
ignromanov May 20, 2026
57440dd
fix(codec): correct malformed vector set + pnpm-lock straggler (T-P2-…
ignromanov May 20, 2026
0088201
test(codec): golden-vector parity test — Rust + TS surfaces (T-P2-13)
ignromanov May 20, 2026
4f7d482
ci(codec): gzip size-gate + wasm-node test job (T-P2-14)
ignromanov May 20, 2026
2cf3ba8
chore(codec): bundle-budget + hygiene + version 0.1.0 — Phase 2 exit …
ignromanov May 20, 2026
7197883
chore(deps): bump actions/checkout from 4 to 6
dependabot[bot] May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.rs]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default owner for everything
* @ignromanov

# Phase 3+: add @void-layer/maintainers when team formed
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
groups:
changesets:
patterns: ["@changesets/*"]
typescript:
patterns: ["typescript", "@types/*"]
- package-ecosystem: "cargo"
directory: "/packages/codec"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
with: { version: 10.24.0 }
- uses: actions/setup-node@v4
with: { node-version: 24, cache: pnpm }
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.1
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | WASM_PACK_VERSION=v0.14.1 sh
- run: pnpm install --frozen-lockfile
- run: pnpm -r build
- run: cargo build --manifest-path packages/codec/Cargo.toml --release
- run: cargo test --manifest-path packages/codec/Cargo.toml
- name: Assert size budgets
run: bash scripts/assert-size.sh
working-directory: packages/codec
- run: |
for dir in packages/codec packages/types packages/networks; do
(cd "$dir" && npm pack --dry-run)
done
vector-parity:
needs: [lint-and-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
with: { version: 10.24.0 }
- uses: actions/setup-node@v4
with: { node-version: 24, cache: pnpm }
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.1
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | WASM_PACK_VERSION=v0.14.1 sh
- run: pnpm install --frozen-lockfile
- run: pnpm -C packages/codec build
- name: TS/JS parity (vitest)
run: pnpm -C packages/codec exec vitest run tests/parity.test.ts
- name: Rust parity (cargo)
run: cargo test --manifest-path packages/codec/Cargo.toml --test parity
macos-sanity:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- run: cargo test --manifest-path packages/codec/Cargo.toml
test-wasm-node:
needs: [lint-and-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.1
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | WASM_PACK_VERSION=v0.14.1 sh
- name: Run wasm-pack test --node (AC-9 boundary tests)
run: wasm-pack test --node packages/codec
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release
on:
push:
branches: [main]
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
validate-oidc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with: { node-version: 24 }
- run: |
echo "Phase 1: release.yml plumbing reserved. Publish job lands Phase 3."
echo "OIDC token presence: $([ -n "$ACTIONS_ID_TOKEN_REQUEST_URL" ] && echo yes || echo no)"
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact=true
engine-strict=true
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
pkg/
target/
.changeset/
pnpm-lock.yaml
Cargo.lock
*.md
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "lf"
}
23 changes: 23 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Code of Conduct

This project adopts the [Contributor Covenant version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) as its Code of Conduct.

Please read the full text at the link above before contributing.

## Reporting

Report unacceptable behavior to **ign.romanov@gmail.com** with subject prefix `[code-of-conduct][@void-layer/codec]`.

Reports are reviewed within 72 hours. Confidentiality is maintained for reporters.

## Scope

This Code of Conduct applies within all project spaces — GitHub issues, pull requests, discussions, and any official communication channels — and when an individual is officially representing the project.

## Enforcement

Maintainers may take any action deemed appropriate, including warning, temporary ban, or permanent ban from the project.

## Attribution

This document is a pointer to the [Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/), which is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing to @void-layer/codec

## Dev Setup

```bash
# Requires Node >=24 and pnpm >=10
pnpm install
```

## Making Changes

Build all packages:
```bash
pnpm build
```

Run tests:
```bash
pnpm test
```

Run lint:
```bash
pnpm lint
```

## Releasing

This repo uses [Changesets](https://github.com/changesets/changesets) for versioning.

Add a changeset for any user-facing change:
```bash
pnpm changeset
```

Then commit the generated `.changeset/*.md` file with your PR.

Maintainers run `pnpm version` to bump versions and `pnpm release` to publish.

## Design Rationale

See [spec 056](https://github.com/ignromanov/voidpay-ai/blob/master/ops/specs/056-void-layer-codec-extraction/spec.md).

The decision to rewrite the codec from TypeScript to Rust+WASM is documented in:
`voidpay-ai/agent-memory/advisors/decisions/2026-05-09-kai-cto-codec-rust-supersedes-ts-first.md`

## Schema

v1 schema is LOCKED. Old invoice URLs must decode forever. Never break existing field assignments.
59 changes: 45 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
# @void-layer/codec

Canonical Invoice codec — TLV + Brotli wire format. v1 schema LOCKED.
Canonical Invoice codec — TLV + Brotli wire format. v1 schema LOCKED forever.

[![npm version](https://img.shields.io/npm/v/@void-layer/codec)](https://www.npmjs.com/package/@void-layer/codec)
[![CI](https://github.com/void-layer/codec/actions/workflows/ci.yml/badge.svg)](https://github.com/void-layer/codec/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![npm](https://img.shields.io/npm/v/@void-layer/codec.svg)](https://npmjs.com/package/@void-layer/codec) [![CI](https://github.com/void-layer/codec/actions/workflows/ci.yml/badge.svg)](https://github.com/void-layer/codec/actions) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

## Status

Phase 1 scaffolding — Rust impl coming Phase 2.

See [spec 056](https://github.com/ignromanov/voidpay-ai/blob/master/ops/specs/056-void-layer-codec-extraction/spec.md) for full design rationale.
🚧 Phase 1 scaffolding (May 2026) — Rust impl lands Phase 2

## Packages

| Package | Description | Status |
|---------|-------------|--------|
| `@void-layer/codec` | Rust+WASM TLV encoder/decoder | Phase 1 init |
| `@void-layer/types` | Shared TypeScript types | Phase 1 init |
| `@void-layer/networks` | Chain configs + token list | Phase 1 init |
| Package | Status | Description |
|---------|--------|-------------|
| `@void-layer/codec` | Phase 1 | Rust + WASM canonical TLV codec |
| `@void-layer/types` | Phase 1 | Manual TypeScript types (zero runtime deps) |
| `@void-layer/networks` | Phase 1 | EVM chain configs + token list (no RPC keys) |

## Quick Install

```bash
pnpm add @void-layer/codec
```

> Not yet published — Phase 3

## Why

- Third-party developers building on top of VoidPay need a stable, versioned codec they can depend on
- MCP servers, Farcaster Frames, and AI agents all depend on a common wire format — language-agnostic TLV is the right primitive
- Version-controlled schema means consumers can pin to v1 and get backward-compat guarantees forever
- Language-agnostic TLV encoding allows Rust, Go, Python, and JS implementations to interoperate on the same wire format

## Constitution IV — Perpetual

> Schema v1 LOCKED. Old URLs decode forever.

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md)

## Security

See [SECURITY.md](SECURITY.md)

## Architecture

See [docs/architecture-overview.md](docs/architecture-overview.md)

## Spec

Full design: [spec 056 in voidpay-ai](https://github.com/ignromanov/voidpay-ai/blob/master/ops/specs/056-void-layer-codec-extraction/spec.md) (private — internal reference)

## Contributing
---

See [CONTRIBUTING.md](CONTRIBUTING.md).
Built by [Ignat Romanov](https://github.com/ignromanov) · MIT License
41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Security Policy

## Supported Versions

Latest published version on npm only (Phase 3+).

| Version | Supported |
|---------|-----------|
| latest | ✅ |
| < latest | ❌ |

## Reporting a Vulnerability

**Preferred**: open a private advisory at https://github.com/void-layer/codec/security/advisories/new

**Email fallback**: `ign.romanov@gmail.com` with subject prefix `[security][@void-layer/codec]`

**Response SLA**: 72 hours initial acknowledgment.

## Scope

### In scope

- Codec encoding/decoding correctness
- Schema v1 backward-compatibility violations
- BigInt boundary issues (precision loss, silent truncation)
- WASM initialization security (race conditions, init bypass)
- Wire format determinism (canonical hash drift)

### Out of scope

- VoidPay product application — see [voidpay/SECURITY.md](https://github.com/ignromanov/voidpay/blob/master/SECURITY.md)
- RPC provider issues — those are external infrastructure

## Constitution VI

RPC keys are server-side only. `@void-layer/*` packages NEVER contain RPC keys or PII.

## Provenance

All releases from Phase 3+ ship with npm Provenance attestations via Trusted Publishing.
Loading
Loading