twzrd-receipt-verifier 1.0.0 → 1.0.1
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/package.json +1 -1
- package/verify_twzrd_receipt.js +23 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twzrd-receipt-verifier",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Standalone offline verifier for TWZRD AO-Receipt V5 (Ed25519-signed keccak256 leaf). No trust in TWZRD servers or code.",
|
|
5
5
|
"keywords": ["twzrd", "x402", "solana", "ed25519", "keccak256", "receipt", "verifier", "agent", "attestation"],
|
|
6
6
|
"homepage": "https://intel.twzrd.xyz",
|
package/verify_twzrd_receipt.js
CHANGED
|
@@ -119,7 +119,29 @@ function verify(receipt, trustedPubkey) {
|
|
|
119
119
|
|
|
120
120
|
async function main() {
|
|
121
121
|
const args = process.argv.slice(2);
|
|
122
|
-
|
|
122
|
+
const HELP = `twzrd-receipt-verifier -- offline verifier for TWZRD AO-Receipt V5 (Ed25519-signed keccak256 leaf)
|
|
123
|
+
|
|
124
|
+
Verifies, with NO trust in TWZRD's servers or code, that a receipt was authored by
|
|
125
|
+
TWZRD's published Ed25519 key and was not tampered with.
|
|
126
|
+
|
|
127
|
+
usage:
|
|
128
|
+
twzrd-receipt-verifier <receipt.json|-> [--pubkey KEY] [--base-url URL] [--self-test]
|
|
129
|
+
|
|
130
|
+
arguments:
|
|
131
|
+
<receipt.json> path to the receipt JSON, or "-" to read from stdin
|
|
132
|
+
--pubkey KEY trust this base58 Ed25519 pubkey (out-of-band) instead of fetching it
|
|
133
|
+
--base-url URL where to fetch the published key (default: ${DEFAULT_BASE_URL})
|
|
134
|
+
--self-test additionally confirm a tampered copy FAILS (proves the check works)
|
|
135
|
+
-h, --help show this help
|
|
136
|
+
|
|
137
|
+
exit code: 0 = VALID, 1 = INVALID / error
|
|
138
|
+
key source: ${DEFAULT_BASE_URL}/.well-known/x402`;
|
|
139
|
+
if (args.includes('-h') || args.includes('--help')) { console.log(HELP); process.exit(0); }
|
|
140
|
+
if (args.length === 0) {
|
|
141
|
+
console.error('usage: twzrd-receipt-verifier <receipt.json|-> [--pubkey KEY] [--base-url URL] [--self-test]');
|
|
142
|
+
console.error(' twzrd-receipt-verifier --help');
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
123
145
|
const receiptArg = args[0];
|
|
124
146
|
const getOpt = (name) => { const i = args.indexOf(name); return i >= 0 ? args[i + 1] : undefined; };
|
|
125
147
|
const selfTest = args.includes('--self-test');
|