Sync with GitHub, license metadata from LICENSE files, commercial license notice
Browse filesmetadata license: None -> mit
README: License section kept (already accurate)
README.md
CHANGED
|
@@ -1,294 +1,300 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
β
|
| 60 |
-
|
| 61 |
-
β
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
```
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
chain.seal(json!({
|
| 135 |
-
"agent":
|
| 136 |
-
"
|
| 137 |
-
"
|
| 138 |
-
}), unix_ms());
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
```
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
| 169 |
-
|
|
| 170 |
-
| `
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
| 175 |
-
|
|
| 176 |
-
| `
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
``
|
| 184 |
-
{
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
```
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
β
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
```
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
β
|
| 257 |
-
β
|
| 258 |
-
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 259 |
-
β
|
| 260 |
-
β
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
---
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- snapkitty
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
```
|
| 8 |
+
βββ βββββββββββββββ βββββββ ββββββββ
|
| 9 |
+
βββ ββββββββββββββββββββββββ ββββββββ
|
| 10 |
+
βββ ββββββ βββ ββββββ ββββββββββ
|
| 11 |
+
βββ ββββββ βββ ββββββ βββββββββ
|
| 12 |
+
βββββββββββββββββββββββββββββββββββββββββ
|
| 13 |
+
βββββββββββββββββββββββ βββββββ ββββββββ
|
| 14 |
+
|
| 15 |
+
Sovereign Audit Chain Β· Built in Rust Β· Open Protocol Β· MIT
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
**Every event sealed. Every tamper detected. No trust required.**
|
| 19 |
+
|
| 20 |
+
[](LICENSE)
|
| 21 |
+
[](https://crates.io/crates/ledge)
|
| 22 |
+
[](https://www.npmjs.com/package/@snapkitty/ledge)
|
| 23 |
+
[](https://github.com/SNAPKITTYWEST/ledge/actions)
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## The problem
|
| 28 |
+
|
| 29 |
+
AI systems are making decisions worth millions of dollars. Financial platforms are processing transactions at scale. Compliance teams are asking one question:
|
| 30 |
+
|
| 31 |
+
> **"Can you prove what happened β and that no one changed it?"**
|
| 32 |
+
|
| 33 |
+
Most audit logs are mutable. A database row can be edited. A log file can be overwritten. An S3 object can be replaced. **None of that is proof.**
|
| 34 |
+
|
| 35 |
+
LEDGE is proof.
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## How it works
|
| 40 |
+
|
| 41 |
+
```
|
| 42 |
+
Genesis: SHA256("LEDGE_GENESIS:SOVEREIGN_CHAIN_INIT")
|
| 43 |
+
|
| 44 |
+
Event 0: SHA256( genesis β payload_json β timestamp_ms β 0 )
|
| 45 |
+
Event 1: SHA256( seal_0 β payload_json β timestamp_ms β 1 )
|
| 46 |
+
Event 2: SHA256( seal_1 β payload_json β timestamp_ms β 2 )
|
| 47 |
+
Β·Β·Β·
|
| 48 |
+
Merkle: SHA256 binary tree over all seals β single root fingerprint
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
Change one byte in any event. Every subsequent seal breaks. The Merkle root changes. **Tamper is instant, total, and mathematically provable.**
|
| 52 |
+
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
## Market context (VAULT analysis)
|
| 56 |
+
|
| 57 |
+
```
|
| 58 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 59 |
+
β WHY THIS EXISTS NOW β
|
| 60 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 61 |
+
β AI audit trail search volume +340% since Q1 2026 β
|
| 62 |
+
β GDPR fines (2025) β¬2.1B and rising β
|
| 63 |
+
β MiCA enforcement begins Q1 2027 β
|
| 64 |
+
β SOX compliance market $4.2B 12% YoY growth β
|
| 65 |
+
β Avg cost of compliance audit fail $14.8M per incident β
|
| 66 |
+
β Enterprise AI governance market $1.2B β $9.4B by 2030 β
|
| 67 |
+
β Companies with AI audit solutions < 4% of Fortune 500 β
|
| 68 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 69 |
+
|
| 70 |
+
Every enterprise deploying AI has no answer to:
|
| 71 |
+
"How do we audit what the AI decided?"
|
| 72 |
+
|
| 73 |
+
LEDGE is that answer.
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
---
|
| 77 |
+
|
| 78 |
+
## Install
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
npm install @snapkitty/ledge
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
```toml
|
| 85 |
+
[dependencies]
|
| 86 |
+
ledge = "0.1"
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## Usage
|
| 92 |
+
|
| 93 |
+
### TypeScript / JavaScript
|
| 94 |
+
|
| 95 |
+
```typescript
|
| 96 |
+
import { initLedge } from '@snapkitty/ledge'
|
| 97 |
+
|
| 98 |
+
const { createChain } = await initLedge()
|
| 99 |
+
const chain = createChain()
|
| 100 |
+
|
| 101 |
+
// Seal an AI decision
|
| 102 |
+
chain.seal({
|
| 103 |
+
agent: 'VAULT',
|
| 104 |
+
decision: 'APPROVE_PAYMENT',
|
| 105 |
+
amount: 50000,
|
| 106 |
+
vendor: 'Acme Corp',
|
| 107 |
+
reason: 'Invoice verified, funds available',
|
| 108 |
+
})
|
| 109 |
+
|
| 110 |
+
// Seal a follow-up action
|
| 111 |
+
chain.seal({
|
| 112 |
+
agent: 'FORGE',
|
| 113 |
+
action: 'DEPLOY',
|
| 114 |
+
ref: 'abc1234',
|
| 115 |
+
env: 'production',
|
| 116 |
+
})
|
| 117 |
+
|
| 118 |
+
// Verify nothing was tampered with
|
| 119 |
+
const result = chain.verify()
|
| 120 |
+
// { valid: true, eventCount: 2, merkleRoot: '7f3a...', failures: [] }
|
| 121 |
+
|
| 122 |
+
console.log('Chain root:', chain.merkleRoot())
|
| 123 |
+
// One hex string that fingerprints the entire history
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
### Rust
|
| 127 |
+
|
| 128 |
+
```rust
|
| 129 |
+
use ledge::LedgeChain;
|
| 130 |
+
use serde_json::json;
|
| 131 |
+
|
| 132 |
+
let mut chain = LedgeChain::new();
|
| 133 |
+
|
| 134 |
+
chain.seal(json!({
|
| 135 |
+
"agent": "VAULT",
|
| 136 |
+
"decision": "APPROVE_PAYMENT",
|
| 137 |
+
"amount": 50000,
|
| 138 |
+
}), unix_ms());
|
| 139 |
+
|
| 140 |
+
chain.seal(json!({
|
| 141 |
+
"agent": "FORGE",
|
| 142 |
+
"action": "DEPLOY",
|
| 143 |
+
"ref": "abc1234",
|
| 144 |
+
}), unix_ms());
|
| 145 |
+
|
| 146 |
+
let result = chain.verify();
|
| 147 |
+
assert!(result.valid);
|
| 148 |
+
|
| 149 |
+
println!("Merkle root: {}", chain.merkle_root());
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
### Tamper detection
|
| 153 |
+
|
| 154 |
+
```rust
|
| 155 |
+
chain.events[0].payload = json!({ "amount": 1 }); // tamper
|
| 156 |
+
|
| 157 |
+
let result = chain.verify();
|
| 158 |
+
assert!(!result.valid);
|
| 159 |
+
assert!(result.failures.contains(&0)); // reports every broken link
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
---
|
| 163 |
+
|
| 164 |
+
## API
|
| 165 |
+
|
| 166 |
+
### Rust β `LedgeChain`
|
| 167 |
+
|
| 168 |
+
| Method | Returns | Description |
|
| 169 |
+
|--------|---------|-------------|
|
| 170 |
+
| `LedgeChain::new()` | `Self` | New chain from genesis |
|
| 171 |
+
| `.seal(payload, timestamp_ms)` | `SealedEvent` | Append and seal an event |
|
| 172 |
+
| `.verify()` | `VerifyResult` | Verify all seals; reports all failures |
|
| 173 |
+
| `.merkle_root()` | `String` | Hex Merkle root of the full chain |
|
| 174 |
+
| `.genesis()` | `String` | Genesis hash (constant per protocol) |
|
| 175 |
+
| `.events()` | `&[SealedEvent]` | Read-only event slice |
|
| 176 |
+
| `.len()` | `usize` | Event count |
|
| 177 |
+
|
| 178 |
+
### WASM / JavaScript β stateless functions
|
| 179 |
+
|
| 180 |
+
| Function | Description |
|
| 181 |
+
|----------|-------------|
|
| 182 |
+
| `ledge_genesis()` | Genesis hash hex |
|
| 183 |
+
| `ledge_seal(prev, payload_json, ts, idx)` | Compute one seal hex |
|
| 184 |
+
| `ledge_verify(events_json)` | JSON in β `{valid, failures, merkleRoot, eventCount}` |
|
| 185 |
+
| `ledge_merkle_root(seals_json)` | Build Merkle root from seal array |
|
| 186 |
+
|
| 187 |
+
### `SealedEvent` shape
|
| 188 |
+
|
| 189 |
+
```typescript
|
| 190 |
+
{
|
| 191 |
+
index: number // position in chain
|
| 192 |
+
seal: string // 64-char hex SHA-256
|
| 193 |
+
previousSeal: string // 64-char hex of prior seal (or genesis)
|
| 194 |
+
payload: object // your data β anything JSON-serializable
|
| 195 |
+
timestampMs: number // unix ms
|
| 196 |
+
}
|
| 197 |
+
```
|
| 198 |
+
|
| 199 |
+
---
|
| 200 |
+
|
| 201 |
+
## The seal algorithm
|
| 202 |
+
|
| 203 |
+
```
|
| 204 |
+
seal = SHA256(
|
| 205 |
+
prev_seal_bytes // 32 bytes
|
| 206 |
+
payload_json // UTF-8 bytes β canonical JSON.stringify
|
| 207 |
+
timestamp_ms // u64 big-endian
|
| 208 |
+
index // u64 big-endian
|
| 209 |
+
)
|
| 210 |
+
```
|
| 211 |
+
|
| 212 |
+
Genesis: `SHA256("LEDGE_GENESIS:SOVEREIGN_CHAIN_INIT")`
|
| 213 |
+
|
| 214 |
+
Open protocol. No secrets. Any party can verify any chain independently.
|
| 215 |
+
|
| 216 |
+
---
|
| 217 |
+
|
| 218 |
+
## Security model
|
| 219 |
+
|
| 220 |
+
```
|
| 221 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 222 |
+
β WHY RUST β
|
| 223 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 224 |
+
β Prototype pollution impossible β
|
| 225 |
+
β Timing attacks constant-time sha2 β
|
| 226 |
+
β Memory safety borrow checker β
|
| 227 |
+
β Supply chain risk 3 deps (sha2/hex/ β
|
| 228 |
+
β serde) β auditable β
|
| 229 |
+
β V8 non-determinism eliminated β
|
| 230 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 231 |
+
```
|
| 232 |
+
|
| 233 |
+
TypeScript was rejected for this library. A cryptographic audit trail written in JavaScript is a liability, not an asset.
|
| 234 |
+
|
| 235 |
+
---
|
| 236 |
+
|
| 237 |
+
## Build from source
|
| 238 |
+
|
| 239 |
+
```bash
|
| 240 |
+
# Rust library + tests
|
| 241 |
+
cargo build --release
|
| 242 |
+
cargo test
|
| 243 |
+
|
| 244 |
+
# WASM + JS (requires wasm-pack)
|
| 245 |
+
cargo install wasm-pack
|
| 246 |
+
wasm-pack build --features wasm --target bundler --out-dir pkg
|
| 247 |
+
npm run build:js
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
---
|
| 251 |
+
|
| 252 |
+
## Use cases
|
| 253 |
+
|
| 254 |
+
```
|
| 255 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 256 |
+
β AI AGENT DECISIONS Seal every AI output. Prove it wasn't β
|
| 257 |
+
β altered retroactively. SOC 2 ready. β
|
| 258 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 259 |
+
β FINANCIAL TRANSACTIONS Immutable payment sequence. Approval β
|
| 260 |
+
β chain proof. Audit on demand. β
|
| 261 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 262 |
+
β DEPLOYMENT RECORDS Cryptographic record of what shipped, β
|
| 263 |
+
β when, and who approved it. β
|
| 264 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
| 265 |
+
β COMPLIANCE EVIDENCE SOX Β· GDPR Β· MiCA Β· ISO 27001 β
|
| 266 |
+
β Tamper-evident log, Merkle verifiable. β
|
| 267 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 268 |
+
```
|
| 269 |
+
|
| 270 |
+
---
|
| 271 |
+
|
| 272 |
+
## Live demo
|
| 273 |
+
|
| 274 |
+
**[collectivekitty.com/labs/ledge](https://collectivekitty.com/labs/ledge)**
|
| 275 |
+
|
| 276 |
+
Seal events in the browser. Verify chain integrity. Explore the Merkle tree. No account required.
|
| 277 |
+
|
| 278 |
+
---
|
| 279 |
+
|
| 280 |
+
## Part of the SnapKitty Sovereign OS
|
| 281 |
+
|
| 282 |
+
LEDGE is the open protocol layer of a larger sovereign AI operating system. The chain protocol, SDK, and verification tools are MIT-licensed and open forever.
|
| 283 |
+
|
| 284 |
+
The intelligence behind it β the agent mesh, the orchestration layer, the sovereign OS β runs privately on bare metal. [collectivekitty.com](https://collectivekitty.com)
|
| 285 |
+
|
| 286 |
+
---
|
| 287 |
+
|
| 288 |
+
## License
|
| 289 |
+
|
| 290 |
+
MIT β see [LICENSE](LICENSE)
|
| 291 |
+
|
| 292 |
+
---
|
| 293 |
+
|
| 294 |
+
```
|
| 295 |
+
Built by LOC β Rust kinetic agent
|
| 296 |
+
SnapKitty Sovereign OS Β· 2026
|
| 297 |
+
"The borrow checker is the security model."
|
| 298 |
+
```
|
| 299 |
+
|
| 300 |
+

|