verify-layer: verify-consistency names the signer of each head (or unsigned); identity: Travel Rule requires a replay store

- verify-consistency without --signer now says whether each head is signed and by which key, and that no expected signer was
  checked (verify-inclusion already did; the README said the output does)
- openMessage opens nothing without a replay store (seen: an object with has/add that keeps the ids for at least maxAgeS);
  before, the same signed and sealed message could be opened any number of times when no store was given

Tests: verify-layer tree 20/20, negative control 14/14; sidecar 44/44, 9/9; travel rule 19/19, negative control 19/19.
This commit is contained in:
Aere Network committed 2026-09-30 10:31:23 +03:00
1 parent 082b862d78
commit 8f5f0bd00d
9 files changed
+57 -14

No files matched your search

+3 -1
View File
@@ -84,6 +84,8 @@ export function verificaConsistenta(d, { vechi, nou, semnatar = null }) {
if (vechi.statement.treeSize !== d.firstSize || vechi.statement.rootHash !== d.firstRoot) return { ok: false, motiv: 'the proof does not start at the old head' };
if (nou.statement.treeSize !== d.secondSize || nou.statement.rootHash !== d.secondRoot) return { ok: false, motiv: 'the proof does not end at the new head' };
if (!verifyConsistency(d)) return { ok: false, motiv: `the new head (${d.secondSize}) does not extend the old one (${d.firstSize}): the history was rewritten` };
return { ok: true };
// B-25 (2026-09-30): cine semneaza fiecare cap se intoarce si se spune; fara `semnatar`, doua capete nesemnate (sau semnate de
// oricine) care se continua trec, si cititorul trebuie sa vada asta, nu doar "EXTENDS"
return { ok: true, semnatVechi: a.semnatDe, semnatNou: b.semnatDe };
} catch (x) { return { ok: false, motiv: 'the proof cannot be read: ' + x.message }; }
}