Expand description
FEP-8b32 Object Integrity Proof verification (eddsa-jcs-2022 and
mldsa44-jcs-2024).
Fedify-based servers (GoToSocial, hackers.pub, …) attach a Data Integrity
proof to the activities they deliver, authenticating the activity itself
rather than the HTTP transport. This lets a recipient accept an activity
whose HTTP Signature it can’t verify (a different signature spec, a shared
inbox, or a forwarded/relayed delivery) as long as the author’s proof holds.
The algorithm mirrors Fedify’s verifyProof
(packages/fedify/src/sig/proof.ts) and the W3C “Data Integrity EdDSA
Cryptosuites” eddsa-jcs-2022 suite:
proofConfig= the document’s@contextplus the fixed proof metadata (type,cryptosuite,verificationMethod,proofPurpose,created).unsecuredDocument= the activity with everyproofform removed.hashData= SHA-256(JCS(proofConfig)) ‖ SHA-256(JCS(unsecuredDocument)).- Verify the
proofValueoverhashDatawith the key resolved from the proof’sverificationMethod.
mldsa44-jcs-2024 (W3C “Verifiable Credential Data Integrity — Quantum
Resistant Cryptosuites”) is the same algorithm over ML-DSA-44 instead of
Ed25519, with one deliberate difference in step 1 that the specification
itself calls out: the proof configuration always takes the document’s
@context, rather than keeping whatever the proof carried.
Enums§
- Cryptosuite
- The cryptosuites this module can verify.
- Public
Key - A public key resolved from a proof’s
verificationMethod.
Constants§
- DATA_
INTEGRITY_ CONTEXT - The Data Integrity context that defines
proof, version 1: what a document is to carry before a proof is attached to it, for a JSON-LD reader to find the proof at all.
Functions§
- decode_
ed25519_ multikey - Decode a Multikey
publicKeyMultibasevalue into a raw 32-byte Ed25519 key. - decode_
mldsa44_ multikey - Decode a Multikey
publicKeyMultibasevalue into an ML-DSA-44 public key. - decode_
multikey - Decode whichever key type a Multikey carries.
- ed25519_
public_ key - The public key of a raw 32-byte Ed25519 seed.
- encode_
ed25519_ multikey - The Multikey
publicKeyMultibasefor an Ed25519 public key: theed25519-pubmulticodec header, base58btc, with multibase’szprefix. - extract_
integrity_ proof - Find a usable assertion-method integrity proof on
document, if present, and not expired atnow, in seconds since the Unix epoch. - generate_
ed25519_ key - Generate an Ed25519 signing key, returned as a PKCS#8 PEM.
- generate_
ed25519_ seed - A fresh raw 32-byte Ed25519 seed.
- integrity_
proofs - Every usable assertion-method integrity proof on
document, in order, asextract_integrity_proofreturns one. A document may carry several, in different suites or by different keys, and one that does not verify says nothing about the others. - parse_
ed25519_ key - The raw 32-byte seed and public key of a PKCS#8 PEM Ed25519 key.
- sign_
object_ integrity_ proof - Attach an
eddsa-jcs-2022integrity proof todocument. - verify_
object_ integrity_ proof - Verify an integrity
proofondocumentagainstpublic_key, the key resolved from the proof’sverificationMethod. - with_
data_ integrity_ context documentwithDATA_INTEGRITY_CONTEXTin its@context, however that is shaped — added to an array, made an array with a single context, or set when there is none — and as it was if it is there already.Nonewhendocumentis not an object.