nirium-cli 3.2.3 → 3.2.5
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/README.md +2 -0
- package/bin/nirium.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ npm install -g nirium-cli
|
|
|
8
8
|
|
|
9
9
|
Audit Trail receipts: anchor a sha-256 hash (optionally signed with ed25519) to IPFS, and anyone can independently verify it with `nirium verify` or at [nirium.xyz/verify](https://nirium.xyz/verify) - no account, no trust in this CLI's own output required.
|
|
10
10
|
|
|
11
|
+
**What a receipt adds over the ledger:** a Stellar payment is already public, so a receipt that only repeats payer, payee and amount proves nothing new; link the transaction instead. Receipts are for what the ledger doesn't hold: policy decisions (including refused payments that were never signed), what a payment was for, off-chain records, and who declared them. More in the [design FAQ](https://github.com/nirium-protocol/nirium/blob/main/docs/DESIGN-FAQ.md).
|
|
12
|
+
|
|
11
13
|
## Anchor a record
|
|
12
14
|
|
|
13
15
|
```bash
|
package/bin/nirium.js
CHANGED
|
@@ -1686,7 +1686,7 @@ function verifyAuditDocument(doc, cid, { expectedHash } = {}) {
|
|
|
1686
1686
|
const anyFailed = hashStatus === 'mismatch' || signatureStatus === 'invalid';
|
|
1687
1687
|
const anyPassed = hashStatus === 'match' || signatureStatus === 'valid';
|
|
1688
1688
|
const ok = !anyFailed && anyPassed;
|
|
1689
|
-
return { ok, verified: ok, cid, mode, hashMatch: hashStatus === 'match', hashStatus, expectedHash: anchoredHash, computedHash, signatureStatus, signatureScheme, signerKey, statement, declaredStatement, agentId };
|
|
1689
|
+
return { ok, verified: ok, cid, mode, hashMatch: hashStatus === 'match', hashStatus, expectedHash: anchoredHash, computedHash, providedHash: expectedHash || '', signatureStatus, signatureScheme, signerKey, statement, declaredStatement, agentId };
|
|
1690
1690
|
}
|
|
1691
1691
|
|
|
1692
1692
|
// `gateways` may be a single URL string (back-compat for direct callers)
|
|
@@ -1778,7 +1778,16 @@ function formatVerifyOutput(result) {
|
|
|
1778
1778
|
} else if (result.hashMatch) {
|
|
1779
1779
|
lines.push(`✔ HASH: MATCH (${result.expectedHash.slice(0, 16)}...)${result.mode === 'hash-only' ? ' [hash-only]' : ''}`);
|
|
1780
1780
|
} else {
|
|
1781
|
-
|
|
1781
|
+
// Name each hash once: the anchored one, the one recomputed from the
|
|
1782
|
+
// record (only when it differs, i.e. the record itself was changed),
|
|
1783
|
+
// and the one passed with --hash/--evidence. Before, a record that was
|
|
1784
|
+
// intact but did not match --hash printed the anchored hash twice.
|
|
1785
|
+
const parts = [`Anchored: ${result.expectedHash}`];
|
|
1786
|
+
if (result.mode === 'record' && result.computedHash && result.computedHash !== result.expectedHash) {
|
|
1787
|
+
parts.push(`Recomputed from record: ${result.computedHash}`);
|
|
1788
|
+
}
|
|
1789
|
+
if (result.providedHash) parts.push(`Yours (--hash/--evidence): ${result.providedHash}`);
|
|
1790
|
+
lines.push(`❌ HASH: MISMATCH (${parts.join(', ')})`);
|
|
1782
1791
|
}
|
|
1783
1792
|
if (result.signatureStatus === 'valid') {
|
|
1784
1793
|
lines.push(`✔ SIGNATURE: VALID${result.signatureScheme === 'sep53' ? ' (SEP-53)' : ''} (Signed by ${result.signerKey})`);
|
package/package.json
CHANGED