@itechsmart/prooflink-verifier 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +196 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/prooflink-verifier.d.ts +99 -0
- package/dist/prooflink-verifier.d.ts.map +1 -0
- package/dist/prooflink-verifier.js +235 -0
- package/dist/prooflink-verifier.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 iTechSmart Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# ProofLink™ Verifier
|
|
2
|
+
|
|
3
|
+
**Open-source cryptographic verification logic for iTechSmart UAIO receipts.**
|
|
4
|
+
|
|
5
|
+
> Don't trust our AI. Trust the math.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What is this?
|
|
10
|
+
|
|
11
|
+
When iTechSmart's UAIO platform autonomously remediates infrastructure — restarting a crashed pod, patching a misconfiguration, rolling back a bad deployment — it generates a **ProofLink receipt**: a cryptographically signed, hash-chained record of exactly what happened, when, and why.
|
|
12
|
+
|
|
13
|
+
This repository contains the **open-source verification logic** that anyone can use to independently confirm those receipts haven't been tampered with.
|
|
14
|
+
|
|
15
|
+
You don't need to trust us. You can verify the math yourself.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## How it works
|
|
20
|
+
|
|
21
|
+
Each ProofLink receipt contains:
|
|
22
|
+
|
|
23
|
+
1. **SHA-256 hash** — computed over all fields of the receipt (deterministic, canonical JSON)
|
|
24
|
+
2. **Previous hash** — the SHA-256 of the preceding receipt, creating a tamper-evident chain
|
|
25
|
+
3. **Chain position** — sequential integer; gaps indicate missing receipts
|
|
26
|
+
4. **Timestamp** — ISO 8601, must be chronologically ordered
|
|
27
|
+
|
|
28
|
+
Altering **any** receipt in the chain invalidates **every subsequent receipt** — the same principle as Bitcoin's blockchain, applied to infrastructure audit trails.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Receipt 0 (genesis) Receipt 1 Receipt 2
|
|
32
|
+
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
|
|
33
|
+
│ sha256: abc123... │──────▶│ prev_hash: abc123... │─────▶│ prev_hash: def456...│
|
|
34
|
+
│ prev_hash: null │ │ sha256: def456... │ │ sha256: ghi789... │
|
|
35
|
+
│ chain_position: 0 │ │ chain_position: 1 │ │ chain_position: 2 │
|
|
36
|
+
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you alter Receipt 1's `action` field:
|
|
40
|
+
- Its computed SHA-256 changes → `sha256` field no longer matches → **tamper detected**
|
|
41
|
+
- Receipt 2's `prev_hash` no longer matches → **chain broken**
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install @itechsmart/prooflink-verifier
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or clone and use directly:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/Iteksmart/prooflink-verifier
|
|
55
|
+
cd prooflink-verifier
|
|
56
|
+
npm install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
### Verify a single receipt
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { verifyReceipt } from '@itechsmart/prooflink-verifier'
|
|
67
|
+
|
|
68
|
+
const result = verifyReceipt(receipt, previousReceipt)
|
|
69
|
+
|
|
70
|
+
console.log(result.valid) // true/false
|
|
71
|
+
console.log(result.tamper_detected) // true if hash or chain broken
|
|
72
|
+
console.log(result.checks) // detailed check results
|
|
73
|
+
console.log(result.errors) // list of failures
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Verify an entire chain
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { verifyChain } from '@itechsmart/prooflink-verifier'
|
|
80
|
+
|
|
81
|
+
const receipts = await fetchReceiptsFromLedger()
|
|
82
|
+
const result = verifyChain(receipts)
|
|
83
|
+
|
|
84
|
+
console.log(result.chain_valid) // true if all receipts intact
|
|
85
|
+
console.log(result.tamper_detected) // true if any tampering found
|
|
86
|
+
console.log(result.tamper_position) // which position was altered
|
|
87
|
+
console.log(result.summary) // human-readable summary
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Compute a hash yourself
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { computeReceiptHash } from '@itechsmart/prooflink-verifier'
|
|
94
|
+
|
|
95
|
+
const { sha256, ...receiptWithoutHash } = receipt
|
|
96
|
+
const computed = computeReceiptHash(receiptWithoutHash)
|
|
97
|
+
|
|
98
|
+
console.log(computed === receipt.sha256) // true if untampered
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## The canonical hash function
|
|
104
|
+
|
|
105
|
+
The hash is computed over a deterministic JSON serialization of all fields **except** `sha256` itself:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
export function computeReceiptHash(receipt: Omit<ProofLinkReceipt, 'sha256'>): string {
|
|
109
|
+
const canonical = JSON.stringify({
|
|
110
|
+
receipt_id: receipt.receipt_id,
|
|
111
|
+
version: receipt.version,
|
|
112
|
+
timestamp: receipt.timestamp,
|
|
113
|
+
container: receipt.container,
|
|
114
|
+
executor: receipt.executor,
|
|
115
|
+
trigger: receipt.trigger,
|
|
116
|
+
action: receipt.action,
|
|
117
|
+
action_parameters: receipt.action_parameters,
|
|
118
|
+
before_state: receipt.before_state,
|
|
119
|
+
after_state: receipt.after_state,
|
|
120
|
+
nist_controls: receipt.nist_controls,
|
|
121
|
+
human_input: receipt.human_input,
|
|
122
|
+
arbiter_policy: receipt.arbiter_policy,
|
|
123
|
+
previous_hash: receipt.previous_hash,
|
|
124
|
+
chain_position: receipt.chain_position,
|
|
125
|
+
}, null, 0)
|
|
126
|
+
|
|
127
|
+
return crypto.createHash('sha256').update(canonical, 'utf8').digest('hex')
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The field ordering is fixed and documented. You can reimplement this in any language and verify receipts independently.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Verification checks
|
|
136
|
+
|
|
137
|
+
For each receipt, the verifier runs 5 checks:
|
|
138
|
+
|
|
139
|
+
| Check | What it verifies |
|
|
140
|
+
|-------|-----------------|
|
|
141
|
+
| `schema_valid` | All required fields present |
|
|
142
|
+
| `receipt_integrity` | Stored SHA-256 matches recomputed hash |
|
|
143
|
+
| `chain_link` | `previous_hash` matches prior receipt's `sha256` |
|
|
144
|
+
| `chain_position` | Position is sequential (no gaps) |
|
|
145
|
+
| `timestamp_order` | Timestamps are chronologically ordered |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Live receipts
|
|
150
|
+
|
|
151
|
+
Verify real receipts from iTechSmart's production ledger:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
https://verify.itechsmart.dev
|
|
155
|
+
https://api.itechsmart.dev/api/v1/prooflink/receipts
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Try the sandbox
|
|
161
|
+
|
|
162
|
+
See UAIO detect, fix, and prove a live Kubernetes OOMKilled crash:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
https://itechsmart.dev/break-it
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Contributing
|
|
171
|
+
|
|
172
|
+
This verifier is intentionally minimal. The goal is auditable simplicity — not feature bloat.
|
|
173
|
+
|
|
174
|
+
PRs welcome for:
|
|
175
|
+
- Additional language implementations (Python, Go, Rust)
|
|
176
|
+
- OpenTimestamps proof verification
|
|
177
|
+
- CLI tool
|
|
178
|
+
- Test vectors
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT — use freely, audit openly, verify everything.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## About iTechSmart
|
|
189
|
+
|
|
190
|
+
iTechSmart builds UAIO (Unified Autonomous IT Operations) — the first enterprise platform that autonomously detects, remediates, and cryptographically proves every infrastructure action.
|
|
191
|
+
|
|
192
|
+
- Website: [itechsmart.dev](https://itechsmart.dev)
|
|
193
|
+
- Verify receipts: [verify.itechsmart.dev](https://verify.itechsmart.dev)
|
|
194
|
+
- Whitepaper: [whitepaper.itechsmart.dev](https://whitepaper.itechsmart.dev)
|
|
195
|
+
|
|
196
|
+
SDVOSB · CAGE: 172W2 · NVIDIA Inception · NIST CSF 96/100
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./prooflink-verifier"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProofLink™ Verifier
|
|
3
|
+
* Open-source cryptographic verification logic for iTechSmart UAIO receipts
|
|
4
|
+
*
|
|
5
|
+
* Don't trust our AI. Trust the math.
|
|
6
|
+
*
|
|
7
|
+
* MIT License — https://github.com/Iteksmart/prooflink-verifier
|
|
8
|
+
*/
|
|
9
|
+
export interface ProofLinkReceipt {
|
|
10
|
+
receipt_id: string;
|
|
11
|
+
version: string;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
container: string;
|
|
14
|
+
executor: string;
|
|
15
|
+
trigger: string;
|
|
16
|
+
action: string;
|
|
17
|
+
action_parameters: Record<string, unknown>;
|
|
18
|
+
before_state: SystemState;
|
|
19
|
+
after_state: SystemState;
|
|
20
|
+
nist_controls: string[];
|
|
21
|
+
human_input: 'ZERO' | 'APPROVAL_REQUIRED' | 'MANUAL';
|
|
22
|
+
arbiter_policy: string;
|
|
23
|
+
sha256: string;
|
|
24
|
+
previous_hash: string | null;
|
|
25
|
+
chain_position: number;
|
|
26
|
+
opentimestamps_proof?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SystemState {
|
|
29
|
+
snapshot_hash: string;
|
|
30
|
+
healthy: boolean;
|
|
31
|
+
metrics: Record<string, number | string>;
|
|
32
|
+
}
|
|
33
|
+
export interface VerificationResult {
|
|
34
|
+
valid: boolean;
|
|
35
|
+
receipt_id: string;
|
|
36
|
+
checks: VerificationCheck[];
|
|
37
|
+
chain_position: number;
|
|
38
|
+
tamper_detected: boolean;
|
|
39
|
+
errors: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface VerificationCheck {
|
|
42
|
+
name: string;
|
|
43
|
+
passed: boolean;
|
|
44
|
+
detail: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Compute the expected SHA-256 hash for a receipt.
|
|
48
|
+
* The hash covers all fields EXCEPT the sha256 field itself.
|
|
49
|
+
* This is the canonical hash function — open for inspection.
|
|
50
|
+
*/
|
|
51
|
+
export declare function computeReceiptHash(receipt: Omit<ProofLinkReceipt, 'sha256'>): string;
|
|
52
|
+
/**
|
|
53
|
+
* Verify a single receipt's internal integrity.
|
|
54
|
+
* Returns true if the stored hash matches the recomputed hash.
|
|
55
|
+
*/
|
|
56
|
+
export declare function verifyReceiptIntegrity(receipt: ProofLinkReceipt): VerificationCheck;
|
|
57
|
+
/**
|
|
58
|
+
* Verify that a receipt's previous_hash matches the prior receipt's sha256.
|
|
59
|
+
* This is what makes the chain tamper-evident — altering any receipt
|
|
60
|
+
* breaks every subsequent link.
|
|
61
|
+
*/
|
|
62
|
+
export declare function verifyChainLink(receipt: ProofLinkReceipt, previousReceipt: ProofLinkReceipt | null): VerificationCheck;
|
|
63
|
+
/**
|
|
64
|
+
* Verify that the chain_position is sequential.
|
|
65
|
+
*/
|
|
66
|
+
export declare function verifyChainPosition(receipt: ProofLinkReceipt, previousReceipt: ProofLinkReceipt | null): VerificationCheck;
|
|
67
|
+
/**
|
|
68
|
+
* Verify timestamp ordering — receipts must be chronologically ordered.
|
|
69
|
+
*/
|
|
70
|
+
export declare function verifyTimestampOrder(receipt: ProofLinkReceipt, previousReceipt: ProofLinkReceipt | null): VerificationCheck;
|
|
71
|
+
/**
|
|
72
|
+
* Verify the receipt schema has all required fields.
|
|
73
|
+
*/
|
|
74
|
+
export declare function verifyReceiptSchema(receipt: unknown): VerificationCheck;
|
|
75
|
+
/**
|
|
76
|
+
* Full verification of a single receipt.
|
|
77
|
+
* Pass previousReceipt=null for genesis (first) receipt.
|
|
78
|
+
*/
|
|
79
|
+
export declare function verifyReceipt(receipt: ProofLinkReceipt, previousReceipt?: ProofLinkReceipt | null): VerificationResult;
|
|
80
|
+
/**
|
|
81
|
+
* Verify an entire chain of receipts.
|
|
82
|
+
* Returns a result for each receipt plus an overall chain validity boolean.
|
|
83
|
+
*/
|
|
84
|
+
export declare function verifyChain(receipts: ProofLinkReceipt[]): {
|
|
85
|
+
chain_valid: boolean;
|
|
86
|
+
tamper_detected: boolean;
|
|
87
|
+
tamper_position: number | null;
|
|
88
|
+
results: VerificationResult[];
|
|
89
|
+
summary: string;
|
|
90
|
+
};
|
|
91
|
+
export declare const ProofLinkVerifier: {
|
|
92
|
+
computeHash: typeof computeReceiptHash;
|
|
93
|
+
verifyReceipt: typeof verifyReceipt;
|
|
94
|
+
verifyChain: typeof verifyChain;
|
|
95
|
+
verifyIntegrity: typeof verifyReceiptIntegrity;
|
|
96
|
+
verifyChainLink: typeof verifyChainLink;
|
|
97
|
+
};
|
|
98
|
+
export default ProofLinkVerifier;
|
|
99
|
+
//# sourceMappingURL=prooflink-verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prooflink-verifier.d.ts","sourceRoot":"","sources":["../src/prooflink-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1C,YAAY,EAAE,WAAW,CAAA;IACzB,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,EAAE,MAAM,GAAG,mBAAmB,GAAG,QAAQ,CAAA;IACpD,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAA;IACr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ACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG;IACzD,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB,CAsCA;AAMD,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ProofLink™ Verifier
|
|
4
|
+
* Open-source cryptographic verification logic for iTechSmart UAIO receipts
|
|
5
|
+
*
|
|
6
|
+
* Don't trust our AI. Trust the math.
|
|
7
|
+
*
|
|
8
|
+
* MIT License — https://github.com/Iteksmart/prooflink-verifier
|
|
9
|
+
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ProofLinkVerifier = void 0;
|
|
15
|
+
exports.computeReceiptHash = computeReceiptHash;
|
|
16
|
+
exports.verifyReceiptIntegrity = verifyReceiptIntegrity;
|
|
17
|
+
exports.verifyChainLink = verifyChainLink;
|
|
18
|
+
exports.verifyChainPosition = verifyChainPosition;
|
|
19
|
+
exports.verifyTimestampOrder = verifyTimestampOrder;
|
|
20
|
+
exports.verifyReceiptSchema = verifyReceiptSchema;
|
|
21
|
+
exports.verifyReceipt = verifyReceipt;
|
|
22
|
+
exports.verifyChain = verifyChain;
|
|
23
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
24
|
+
// ─────────────────────────────────────────────
|
|
25
|
+
// Core Verification Logic
|
|
26
|
+
// ─────────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Compute the expected SHA-256 hash for a receipt.
|
|
29
|
+
* The hash covers all fields EXCEPT the sha256 field itself.
|
|
30
|
+
* This is the canonical hash function — open for inspection.
|
|
31
|
+
*/
|
|
32
|
+
function computeReceiptHash(receipt) {
|
|
33
|
+
const canonical = JSON.stringify({
|
|
34
|
+
receipt_id: receipt.receipt_id,
|
|
35
|
+
version: receipt.version,
|
|
36
|
+
timestamp: receipt.timestamp,
|
|
37
|
+
container: receipt.container,
|
|
38
|
+
executor: receipt.executor,
|
|
39
|
+
trigger: receipt.trigger,
|
|
40
|
+
action: receipt.action,
|
|
41
|
+
action_parameters: receipt.action_parameters,
|
|
42
|
+
before_state: receipt.before_state,
|
|
43
|
+
after_state: receipt.after_state,
|
|
44
|
+
nist_controls: receipt.nist_controls,
|
|
45
|
+
human_input: receipt.human_input,
|
|
46
|
+
arbiter_policy: receipt.arbiter_policy,
|
|
47
|
+
previous_hash: receipt.previous_hash,
|
|
48
|
+
chain_position: receipt.chain_position,
|
|
49
|
+
}, null, 0); // deterministic — no pretty printing
|
|
50
|
+
return crypto_1.default.createHash('sha256').update(canonical, 'utf8').digest('hex');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Verify a single receipt's internal integrity.
|
|
54
|
+
* Returns true if the stored hash matches the recomputed hash.
|
|
55
|
+
*/
|
|
56
|
+
function verifyReceiptIntegrity(receipt) {
|
|
57
|
+
const { sha256, ...rest } = receipt;
|
|
58
|
+
const computed = computeReceiptHash(rest);
|
|
59
|
+
const passed = computed === sha256;
|
|
60
|
+
return {
|
|
61
|
+
name: 'receipt_integrity',
|
|
62
|
+
passed,
|
|
63
|
+
detail: passed
|
|
64
|
+
? `Hash matches: ${sha256.substring(0, 16)}...`
|
|
65
|
+
: `Hash mismatch. Expected ${computed.substring(0, 16)}..., got ${sha256.substring(0, 16)}...`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Verify that a receipt's previous_hash matches the prior receipt's sha256.
|
|
70
|
+
* This is what makes the chain tamper-evident — altering any receipt
|
|
71
|
+
* breaks every subsequent link.
|
|
72
|
+
*/
|
|
73
|
+
function verifyChainLink(receipt, previousReceipt) {
|
|
74
|
+
if (receipt.chain_position === 0) {
|
|
75
|
+
const passed = receipt.previous_hash === null;
|
|
76
|
+
return {
|
|
77
|
+
name: 'chain_link',
|
|
78
|
+
passed,
|
|
79
|
+
detail: passed
|
|
80
|
+
? 'Genesis receipt — no previous hash required'
|
|
81
|
+
: `Genesis receipt should have null previous_hash, got: ${receipt.previous_hash}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (!previousReceipt) {
|
|
85
|
+
return {
|
|
86
|
+
name: 'chain_link',
|
|
87
|
+
passed: false,
|
|
88
|
+
detail: `Cannot verify chain — previous receipt (position ${receipt.chain_position - 1}) not provided`,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const passed = receipt.previous_hash === previousReceipt.sha256;
|
|
92
|
+
return {
|
|
93
|
+
name: 'chain_link',
|
|
94
|
+
passed,
|
|
95
|
+
detail: passed
|
|
96
|
+
? `Chain intact: links to receipt ${previousReceipt.receipt_id.substring(0, 8)}...`
|
|
97
|
+
: `Chain BROKEN: expected ${previousReceipt.sha256.substring(0, 16)}..., got ${receipt.previous_hash?.substring(0, 16)}...`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Verify that the chain_position is sequential.
|
|
102
|
+
*/
|
|
103
|
+
function verifyChainPosition(receipt, previousReceipt) {
|
|
104
|
+
if (receipt.chain_position === 0) {
|
|
105
|
+
return { name: 'chain_position', passed: true, detail: 'Genesis position: 0' };
|
|
106
|
+
}
|
|
107
|
+
if (!previousReceipt) {
|
|
108
|
+
return {
|
|
109
|
+
name: 'chain_position',
|
|
110
|
+
passed: false,
|
|
111
|
+
detail: 'Cannot verify position without previous receipt',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const passed = receipt.chain_position === previousReceipt.chain_position + 1;
|
|
115
|
+
return {
|
|
116
|
+
name: 'chain_position',
|
|
117
|
+
passed,
|
|
118
|
+
detail: passed
|
|
119
|
+
? `Position ${receipt.chain_position} follows ${previousReceipt.chain_position}`
|
|
120
|
+
: `Position gap detected: ${previousReceipt.chain_position} → ${receipt.chain_position}`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Verify timestamp ordering — receipts must be chronologically ordered.
|
|
125
|
+
*/
|
|
126
|
+
function verifyTimestampOrder(receipt, previousReceipt) {
|
|
127
|
+
if (!previousReceipt) {
|
|
128
|
+
return { name: 'timestamp_order', passed: true, detail: 'No previous receipt to compare' };
|
|
129
|
+
}
|
|
130
|
+
const current = new Date(receipt.timestamp).getTime();
|
|
131
|
+
const previous = new Date(previousReceipt.timestamp).getTime();
|
|
132
|
+
const passed = current >= previous;
|
|
133
|
+
return {
|
|
134
|
+
name: 'timestamp_order',
|
|
135
|
+
passed,
|
|
136
|
+
detail: passed
|
|
137
|
+
? `Timestamp order valid: ${receipt.timestamp} >= ${previousReceipt.timestamp}`
|
|
138
|
+
: `Timestamp order INVALID: ${receipt.timestamp} precedes ${previousReceipt.timestamp}`,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Verify the receipt schema has all required fields.
|
|
143
|
+
*/
|
|
144
|
+
function verifyReceiptSchema(receipt) {
|
|
145
|
+
const required = [
|
|
146
|
+
'receipt_id', 'version', 'timestamp', 'container', 'executor',
|
|
147
|
+
'trigger', 'action', 'before_state', 'after_state',
|
|
148
|
+
'sha256', 'chain_position', 'human_input',
|
|
149
|
+
];
|
|
150
|
+
const r = receipt;
|
|
151
|
+
const missing = required.filter(field => !(field in r) || r[field] === undefined);
|
|
152
|
+
const passed = missing.length === 0;
|
|
153
|
+
return {
|
|
154
|
+
name: 'schema_valid',
|
|
155
|
+
passed,
|
|
156
|
+
detail: passed
|
|
157
|
+
? 'All required fields present'
|
|
158
|
+
: `Missing required fields: ${missing.join(', ')}`,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Full verification of a single receipt.
|
|
163
|
+
* Pass previousReceipt=null for genesis (first) receipt.
|
|
164
|
+
*/
|
|
165
|
+
function verifyReceipt(receipt, previousReceipt = null) {
|
|
166
|
+
const checks = [
|
|
167
|
+
verifyReceiptSchema(receipt),
|
|
168
|
+
verifyReceiptIntegrity(receipt),
|
|
169
|
+
verifyChainLink(receipt, previousReceipt),
|
|
170
|
+
verifyChainPosition(receipt, previousReceipt),
|
|
171
|
+
verifyTimestampOrder(receipt, previousReceipt),
|
|
172
|
+
];
|
|
173
|
+
const errors = checks
|
|
174
|
+
.filter(c => !c.passed)
|
|
175
|
+
.map(c => `[${c.name}] ${c.detail}`);
|
|
176
|
+
const tamperDetected = !checks.find(c => c.name === 'receipt_integrity')?.passed ||
|
|
177
|
+
!checks.find(c => c.name === 'chain_link')?.passed;
|
|
178
|
+
return {
|
|
179
|
+
valid: errors.length === 0,
|
|
180
|
+
receipt_id: receipt.receipt_id,
|
|
181
|
+
checks,
|
|
182
|
+
chain_position: receipt.chain_position,
|
|
183
|
+
tamper_detected: tamperDetected,
|
|
184
|
+
errors,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Verify an entire chain of receipts.
|
|
189
|
+
* Returns a result for each receipt plus an overall chain validity boolean.
|
|
190
|
+
*/
|
|
191
|
+
function verifyChain(receipts) {
|
|
192
|
+
if (receipts.length === 0) {
|
|
193
|
+
return {
|
|
194
|
+
chain_valid: false,
|
|
195
|
+
tamper_detected: false,
|
|
196
|
+
tamper_position: null,
|
|
197
|
+
results: [],
|
|
198
|
+
summary: 'Empty chain — nothing to verify',
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
// Sort by chain_position
|
|
202
|
+
const sorted = [...receipts].sort((a, b) => a.chain_position - b.chain_position);
|
|
203
|
+
const results = [];
|
|
204
|
+
let tamperPosition = null;
|
|
205
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
206
|
+
const result = verifyReceipt(sorted[i], i > 0 ? sorted[i - 1] : null);
|
|
207
|
+
results.push(result);
|
|
208
|
+
if (result.tamper_detected && tamperPosition === null) {
|
|
209
|
+
tamperPosition = sorted[i].chain_position;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const chainValid = results.every(r => r.valid);
|
|
213
|
+
const tamperDetected = tamperPosition !== null;
|
|
214
|
+
return {
|
|
215
|
+
chain_valid: chainValid,
|
|
216
|
+
tamper_detected: tamperDetected,
|
|
217
|
+
tamper_position: tamperPosition,
|
|
218
|
+
results,
|
|
219
|
+
summary: chainValid
|
|
220
|
+
? `Chain valid — ${receipts.length} receipts verified, no tampering detected`
|
|
221
|
+
: `Chain INVALID — tampering detected at position ${tamperPosition}`,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
// ─────────────────────────────────────────────
|
|
225
|
+
// Public API
|
|
226
|
+
// ─────────────────────────────────────────────
|
|
227
|
+
exports.ProofLinkVerifier = {
|
|
228
|
+
computeHash: computeReceiptHash,
|
|
229
|
+
verifyReceipt,
|
|
230
|
+
verifyChain,
|
|
231
|
+
verifyIntegrity: verifyReceiptIntegrity,
|
|
232
|
+
verifyChainLink,
|
|
233
|
+
};
|
|
234
|
+
exports.default = exports.ProofLinkVerifier;
|
|
235
|
+
//# sourceMappingURL=prooflink-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prooflink-verifier.js","sourceRoot":"","sources":["../src/prooflink-verifier.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;AA0DH,gDAoBC;AAMD,wDAYC;AAOD,0CA+BC;AAKD,kDAwBC;AAKD,oDAmBC;AAKD,kDAkBC;AAMD,sCA2BC;AAMD,kCA4CC;AAnSD,oDAA2B;AA+C3B,gDAAgD;AAChD,0BAA0B;AAC1B,gDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,kBAAkB,C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AC,CAAA;QAEpB,IAAI,MAAM,CAAC,eAAe,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;YACtD,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAA;QAC3C,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IAC9C,MAAM,cAAc,GAAG,cAAc,KAAK,IAAI,CAAA;IAE9C,OAAO;QACL,WAAW,EAAE,UAAU;QACvB,eAAe,EAAE,cAAc;QAC/B,eAAe,EAAE,cAAc;QAC/B,OAAO;QACP,OAAO,EAAE,UAAU;YACjB,CAAC,CAAC,iBAAiB,QAAQ,CAAC,MAAM,2CAA2C;YAC7E,CAAC,CAAC,kDAAkD,cAAc,EAAE;KACvE,CAAA;AACH,CAAC;AAED,gDAAgD;AAChD,aAAa;AACb,gDAAgD;AAEnC,QAAA,iBAAiB,GAAG;IAC/B,WAAW,EAAE,kBAAkB;IAC/B,aAAa;IACb,WAAW;IACX,eAAe,EAAE,sBAAsB;IACvC,eAAe;CAChB,CAAA;AAED,kBAAe,yBAAiB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@itechsmart/prooflink-verifier",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Open-source cryptographic verification for iTechSmart UAIO ProofLink receipts — don't trust our AI, trust the math.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"prooflink",
|
|
19
|
+
"uaio",
|
|
20
|
+
"itechsmart",
|
|
21
|
+
"cryptographic-verification",
|
|
22
|
+
"audit",
|
|
23
|
+
"sha256",
|
|
24
|
+
"hash-chain",
|
|
25
|
+
"tamper-evident"
|
|
26
|
+
],
|
|
27
|
+
"author": "iTechSmart Inc.",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/Iteksmart/prooflink-verifier.git"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/Iteksmart/prooflink-verifier/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/Iteksmart/prooflink-verifier#readme",
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^20.0.0",
|
|
45
|
+
"typescript": "^5.4.0",
|
|
46
|
+
"vitest": "^1.6.0"
|
|
47
|
+
}
|
|
48
|
+
}
|