DEV Community

facilishz
facilishz

Posted on

Data Integrity proofs: verificationMethod and proofPurpose both carry authority

Data Integrity proofs: verificationMethod and proofPurpose both carry authority

A signature over a Verifiable Credential or other structured document does not prove everything by itself. W3C Data Integrity separates the cryptographic proof from the authority expressed by the document. Two fields are especially easy to under-check: verificationMethod identifies the key material, and proofPurpose states what relationship the proof is meant to establish.

A verifier should resolve the verification method from a trusted controller document, confirm that it belongs to the expected controller, and confirm that the method is authorized for the stated purpose. An assertion method used to make claims is not automatically an authentication method. A key listed for one service or controller should not become a universal signing key because the proof document names it.

The proofPurpose value itself must be compared with policy. A proof created for authentication should not be accepted as a credential assertion simply because the signature verifies. If the verifier expects assertionMethod, the controller document must express that relationship. If a proof uses a domain or challenge, those values need to be included in verification and checked against the intended interaction. They are not decorative metadata.

Cryptosuite selection also needs an allowlist. The proof must name a suite the verifier supports and trusts. Its canonicalization, hashing, and signature encoding must be deterministic. Implementers should use a maintained library and reject unsupported proof types rather than attempting a best-effort parse. W3C's Data Integrity threat model treats the signing, holder, and verifier systems as separate trust boundaries, which is useful when assigning review duty.

Key lifecycle changes deserve explicit treatment. If a controller rotates a key, a verifier should know which version was active when the proof was created. An old proof is not automatically invalid, and a newly rotated key does not retroactively rewrite history. The policy for proof creation time, key status, and controller updates should be written down and tested. A compromised method may need both deactivation and a decision about earlier signatures.

For a practical review, take one signed document and record the exact key, controller, purpose, creation time, and suite. Resolve each of those values independently. Then alter only proofPurpose in a test fixture and confirm the verifier rejects it. Replace the method with another key controlled by the same organization and confirm the expected policy result. Finally, run the verifier against a key that has been deactivated and inspect whether the failure is clear.

The goal is not to make every proof expensive to check. It is to prevent a valid signature from becoming a substitute for an authorization decision. Data Integrity works best when the verifier states which controller, purpose, time window, and cryptosuite it accepts before it looks at the signature.

References

Top comments (0)