diff --git a/README.md b/README.md index 34dc021..acb571e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -

json-trail

+

json-record

- CI - npm version + CI + npm version dependencies types - license + license

@@ -14,11 +14,11 @@ --- -json-trail gives you **chronological integrity**: a guarantee that a sequence of blocks has not been altered, reordered, or truncated. It does not enforce authenticity or authorship; it simply ensures the history is intact. +json-record gives you **chronological integrity**: a guarantee that a sequence of blocks has not been altered, reordered, or truncated. It does not enforce authenticity or authorship; it simply ensures the history is intact. --- -## Why json-trail? +## Why json-record? Most applications do not need a blockchain, or consensus protocol. They just need a simple, deterministic way to ensure that: @@ -27,7 +27,7 @@ They just need a simple, deterministic way to ensure that: - nothing was removed - nothing was rewritten -json-trail gives you that primitive, nothing more and nothing less. +json-record gives you that primitive, nothing more and nothing less. It is ideal for: @@ -52,7 +52,7 @@ It is ideal for: ## Environment Support -json-trail runs anywhere WebCrypto is available: +json-record runs anywhere WebCrypto is available: - Node.js 18+ (global crypto.subtle) - Browsers @@ -66,9 +66,9 @@ A pure, deterministic, in-memory primitive. --- -## What json-trail guarantees +## What json-record guarantees -json-trail provides **tamper-evident ordering**: +json-record provides **tamper-evident ordering**: - A block's payload cannot be changed without detection - A block's header cannot be changed without detection @@ -79,9 +79,9 @@ This is the same integrity model used by Git commit chains and linear Merkle-sty --- -## What json-trail does not guarantee +## What json-record does not guarantee -json-trail does not provide: +json-record does not provide: - authenticity - authorship @@ -91,7 +91,7 @@ json-trail does not provide: If you need to prove who created the data, seal the payload with **json-seal** before storing it in the trail. -json-trail stays intentionally minimal. +json-record stays intentionally minimal. --- @@ -100,7 +100,7 @@ json-trail stays intentionally minimal. ### Creating a block ```ts -import { createBlock } from "json-trail"; +import { createBlock } from "json-record"; const payload = new TextEncoder().encode("hello world"); @@ -113,7 +113,7 @@ const block1 = await createBlock(payload, block0); ### Verifying a block ```ts -import { verifyBlock } from "json-trail"; +import { verifyBlock } from "json-record"; const ok = await verifyBlock(block1); console.log(ok); // true @@ -124,7 +124,7 @@ console.log(ok); // true ### Verifying a chain ```ts -import { verifyChain } from "json-trail"; +import { verifyChain } from "json-record"; const chain = [block0, block1]; const ok = await verifyChain(chain); @@ -139,7 +139,7 @@ If you want to prove where the data came from, seal the payload before putting i ```ts import { generateKeyPair, signPayload } from "json-seal"; -import { createBlock } from "json-trail"; +import { createBlock } from "json-record"; const { privateKey, publicKey } = await generateKeyPair(); @@ -153,7 +153,7 @@ const block = await createBlock( This gives you: - authenticity of the payload (json-seal) -- chronological integrity of the chain (json-trail) +- chronological integrity of the chain (json-record) A clean, layered integrity model. @@ -161,7 +161,7 @@ A clean, layered integrity model. ## Storage -json-trail is an in-memory primitive. +json-record is an in-memory primitive. For persistence, serialize blocks however you like. A recommended format: @@ -173,14 +173,14 @@ A recommended format: } ``` -json-trail does not define a storage format. +json-record does not define a storage format. You choose how to store, sync, or replicate the chain. --- ## Design Philosophy -json-trail is intentionally small: +json-record is intentionally small: - no I/O - no storage format @@ -195,7 +195,7 @@ You build the policies on top. ## Prior Art -json-trail builds on a long lineage of cryptographic integrity primitives: +json-record builds on a long lineage of cryptographic integrity primitives: - Git commit chains - Merkle-style hash chains @@ -203,7 +203,7 @@ json-trail builds on a long lineage of cryptographic integrity primitives: - Certificate Transparency logs - Secure audit log research -json-trail distills these ideas into a tiny, deterministic, dependency-free primitive designed for local-first apps, PWAs, and in-memory trails. It offers integrity without the complexity. +json-record distills these ideas into a tiny, deterministic, dependency-free primitive designed for local-first apps, PWAs, and in-memory trails. It offers integrity without the complexity. --- diff --git a/docs/api.html b/docs/api.html index 9686f92..1b7f832 100644 --- a/docs/api.html +++ b/docs/api.html @@ -3,7 +3,7 @@ - json-trail - API + json-record - API @@ -13,7 +13,7 @@

API Reference

- json-trail exposes a minimal API for creating hash-linked blocks and + json-record exposes a minimal API for creating hash-linked blocks and verifying their integrity. All operations use deterministic SHA-256 hashing and return plain data structures containing Uint8Array fields.

@@ -27,7 +27,7 @@

createBlock(payload, prevBlock)

Import

-
import { createBlock } from "json-trail";
+    
import { createBlock } from "json-record";
 

Usage

@@ -64,7 +64,7 @@

verifyBlock(block)

Import

-
import { verifyBlock } from "json-trail";
+    
import { verifyBlock } from "json-record";
 

Usage

@@ -86,7 +86,7 @@

verifyChain(blocks)

Import

-
import { verifyChain } from "json-trail";
+    
import { verifyChain } from "json-record";
 

Usage

@@ -102,12 +102,12 @@

Returns

API Examples Integrity Model - Using json-seal with json-trail + Using json-seal with json-record diff --git a/docs/examples.html b/docs/examples.html index 35f5a1b..ff24ac7 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -3,7 +3,7 @@ - json-trail - Examples + json-record - Examples @@ -14,7 +14,7 @@

Examples

Basic usage

-
import { createBlock, verifyBlock, verifyChain } from "json-trail";
+    
import { createBlock, verifyBlock, verifyChain } from "json-record";
 
 const enc = new TextEncoder();
 const payload = enc.encode("hello world");
@@ -40,12 +40,12 @@ 

Tampering detection

API Examples Integrity Model - Using json-seal with json-trail + Using json-seal with json-record diff --git a/docs/index.html b/docs/index.html index acc9a57..ab28802 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,30 +3,30 @@ - json-trail + json-record
-

json-trail

+

json-record

Tamper-evident, hash-linked blocks for apps. Zero dependencies.

- json-trail is a tiny library for creating hash-linked blocks that detect + json-record is a tiny library for creating hash-linked blocks that detect any modification to payloads or history. It provides chronological integrity without keys, signatures, or complex state.

-

Why json-trail exists

+

Why json-record exists

Local-first apps store data on the device and sync when possible. Without a server acting as the source of truth, you still need a way to know - whether your local history has been tampered with. json-trail provides a + whether your local history has been tampered with. json-record provides a minimal, deterministic, tamper-evident structure for that purpose.

@@ -44,12 +44,12 @@

Features

API Examples Integrity Model - Using json-seal with json-trail + Using json-seal with json-record
diff --git a/docs/integrity-model.html b/docs/integrity-model.html index 80713a4..5f7a200 100644 --- a/docs/integrity-model.html +++ b/docs/integrity-model.html @@ -3,7 +3,7 @@ - json-trail - Integrity Model + json-record - Integrity Model @@ -13,7 +13,7 @@

Integrity Model

- json-trail uses a simple hashing model to detect tampering. + json-record uses a simple hashing model to detect tampering.

Block structure

@@ -41,12 +41,12 @@

Chain validity

API Examples Integrity Model - Using json-seal with json-trail + Using json-seal with json-record diff --git a/docs/seal-and-trail.html b/docs/seal-and-trail.html index 36be3af..595e721 100644 --- a/docs/seal-and-trail.html +++ b/docs/seal-and-trail.html @@ -3,17 +3,17 @@ - json-seal + json-trail + json-seal + json-record
-

json-seal + json-trail

+

json-seal + json-record

- json-seal provides authenticity. json-trail provides chronological integrity. + json-seal provides authenticity. json-record provides chronological integrity. Together, they form a signed, tamper-evident, hash-linked log entry.

@@ -24,7 +24,7 @@

json-seal + json-trail

Example

import { generateKeyPair, signPayload, canonicalize } from "json-seal";
-import { createBlock } from "json-trail";
+import { createBlock } from "json-record";
 
 const { privateKey, publicKey } = await generateKeyPair();
 
@@ -39,7 +39,7 @@ 

Example

Using canonicalize ensures that the bytes passed into createBlock are deterministic. json-seal produces a stable, canonical representation of the sealed envelope, so hashing it with - json-trail yields consistent results across platforms and runtimes. + json-record yields consistent results across platforms and runtimes.

Verification flow

@@ -54,7 +54,7 @@

Verification flow

API Examples Integrity Model - Using json-seal with json-trail + Using json-seal with json-record
diff --git a/package-lock.json b/package-lock.json index 427c560..6e2b7dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "json-trail", - "version": "0.1.1", + "name": "json-record", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "json-trail", + "name": "json-record", "version": "0.1.1", "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 6d5e384..70f9c1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "json-trail", - "version": "0.1.1", + "name": "json-record", + "version": "0.1.0", "author": "Chris Myers (https://www.npmjs.com/~cmyers-dev)", "description": "A lightweight, tamper-evident, hash-linked ledger for JSON or binary payloads, with optional WebCrypto signatures.", "type": "module", @@ -23,7 +23,7 @@ "LICENSE" ], "keywords": [ - "trail", + "record", "ledger", "hash-chain", "append-only", @@ -38,11 +38,11 @@ ], "repository": { "type": "git", - "url": "https://github.com/cmyers/json-trail.git" + "url": "https://github.com/cmyers/json-record.git" }, - "homepage": "https://github.com/cmyers/json-trail#readme", + "homepage": "https://github.com/cmyers/json-record#readme", "bugs": { - "url": "https://github.com/cmyers/json-trail/issues" + "url": "https://github.com/cmyers/json-record/issues" }, "scripts": { "build": "tsc", diff --git a/tests/integration-json-seal.test.ts b/tests/integration-json-seal.test.ts index 86b5ae0..7ee2e06 100644 --- a/tests/integration-json-seal.test.ts +++ b/tests/integration-json-seal.test.ts @@ -6,7 +6,7 @@ import { verifyBlock, verifyChain } from "../src/verify"; const enc = new TextEncoder(); const dec = new TextDecoder(); -describe("json-seal + json-trail integration", () => { +describe("json-seal + json-record integration", () => { it("stores a sealed backup inside a ledger block and verifies both layers", async () => { const { privateKey, publicKey } = await generateKeyPair();