Skip to content

Ledger

The ledger is the backbone of RepoMesh. It is an append-only log of signed events stored as a single JSONL file at ledger/events/events.jsonl in the RepoMesh repository. Each line is one self-contained JSON event.

Every event written to the ledger must satisfy five rules. Violation of any rule causes the event to be rejected by CI validation.

RuleEnforcement
Append-onlyEvents are never modified or deleted. New events are appended to the JSONL file. CI rejects any diff that removes or edits an existing line.
Schema-validEvery event conforms to schemas/event.schema.json. The schema is checked at write time and again in CI.
Signature-validEvery event carries an Ed25519 signature from a registered node. The public key must be present in the node’s manifest under ledger/nodes/.
UniqueNo duplicate (repo, version, type) combinations are allowed. Duplicate entries are rejected.
Timestamp-saneEvent timestamps must not be more than 1 hour in the future or 1 year in the past.
Event typeEmitted byPayload summary
ReleasePublishedCompute nodeRepo, version, commit SHA, artifact checksums
AttestationPublishedAttestor nodeRepo, version, verifier results (sbom.present, provenance.present, signature.chain, etc.)
BreakingChangeDetectedPolicy nodeRepo, version pair, interface diff summary
HealthCheckFailedOracle nodeRepo, check type, failure details, severity
DependencyVulnFoundOracle nodeRepo, dependency, CVE ID, severity, fix available
InterfaceUpdatedCompute nodeRepo, version, schema diff, backward-compatible flag
PolicyViolationPolicy nodeRepo, rule ID, violation details, suggested action

All event types are defined in the single schema at schemas/event.schema.json.

Every event shares a common envelope:

{
"type": "ReleasePublished",
"repo": "your-org/your-repo",
"version": "1.0.0",
"commit": "abc1234def5678...",
"timestamp": "2026-03-05T12:00:00.000Z",
"artifacts": [
{ "name": "package.tgz", "sha256": "abcdef...", "uri": "https://..." }
],
"attestations": [],
"notes": "",
"signature": {
"alg": "ed25519",
"keyId": "ci-your-repo-2026",
"value": "<base64-encoded-signature>",
"canonicalHash": "<sha256-of-canonical-json>"
}
}

The canonicalHash is computed by sorting all keys deterministically (via canonical JSON serialization), then taking the SHA-256 hash of the result (excluding the signature field). The value is the Ed25519 signature over the canonicalHash bytes. This design ensures that identical events always produce the same hash and that signatures can be independently verified.

AttestationPublished events carry an attestations array with typed entries:

Attestation typeMeaning
sbom.presentRelease includes an SBOM attestation
provenance.presentRelease includes build provenance
signature.chainSignature verified against the registered public key
security.scanSecurity scan completed
license.auditLicense audit completed
repro.buildReproducibility build verified
policy.checkPolicy check completed
ledger.anchorLedger partition anchored to XRPL

Each attestation entry includes a uri indicating the result (pass/fail) and source.

Nodes declare their kind in node.json. The kind determines what event types a node is authorized to emit.

KindRoleAuthorized events
registryAggregates node metadata and trust scoresInternal bookkeeping (no ledger events)
attestorRuns verifiers and publishes attestationsAttestationPublished
policyDefines and enforces cross-repo rulesBreakingChangeDetected, PolicyViolation
oracleMonitors external signals (CVEs, uptime, health)HealthCheckFailed, DependencyVulnFound
computeA regular repository that produces releasesReleasePublished, InterfaceUpdated
settlementPosts Merkle roots to XRPLInternal (anchor records, not ledger events)
governanceManages network-level decisions (upgrades, disputes)Governance proposals (future)
identityManages key rotation and node identityKey rotation records (future)

The ledger is stored as a single JSONL (JSON Lines) file at ledger/events/events.jsonl. Each line is one complete event. Events are appended chronologically. The file grows over time; XRPL anchoring creates tamper-evident checkpoints by computing Merkle roots over ranges of events (partitions) and posting the root to the XRP Ledger.

Registered node manifests and profiles live under ledger/nodes/<org>/<repo>/ with node.json and repomesh.profile.json per node.