Status: Draft
Version: 1.0.0
Date: 2025-12-20
Extends: QWED-SPEC v1.0
Table of contents
- Introduction
- Attestation model
- Attestation format
- Cryptographic operations
- Verification chain
- Trust anchors
- Transport & storage
- Implementation guidelines
1. Introduction
1.1 Purpose
QWED-Attestation defines a standard format for cryptographic proofs of verification. An attestation is a signed statement that a specific verification was performed by a trusted verifier at a specific time.1.2 Use cases
| Use Case | Description |
|---|---|
| Audit Trail | Prove that verification occurred for compliance |
| Trust Transfer | Third party can verify without re-running |
| Offline Verification | Validate attestation without network |
| Chain of Custody | Track verification through system handoffs |
| Non-Repudiation | Verifier cannot deny issuing attestation |
1.3 Terminology
| Term | Definition |
|---|---|
| Attestation | Signed proof of verification result |
| Issuer | QWED verifier that creates the attestation |
| Subject | The content that was verified |
| Holder | Entity that possesses the attestation |
| Verifier | Party validating the attestation |
| Claim | Statement within the attestation |
2. Attestation model
2.1 Conceptual model
2.2 Trust flow
2.3 Attestation lifecycle
| State | Description |
|---|---|
issued | Attestation created and signed |
valid | Within validity period, signature valid |
expired | Past expiration time |
revoked | Explicitly invalidated by issuer |
3. Attestation format
3.1 Structure (JWT)
QWED Attestations use JSON Web Token (JWT) format per RFC 7519.3.2 Header schema
| Field | Required | Description |
|---|---|---|
alg | REQUIRED | Signature algorithm (ES256, EdDSA) |
typ | REQUIRED | Token type (MUST be qwed-attestation+jwt) |
kid | REQUIRED | Key identifier (DID-based) |
3.3 Payload schema
3.4 Example attestation (decoded)
Header:4. Cryptographic operations
4.1 Algorithms
| Algorithm | Usage | Requirement |
|---|---|---|
| ES256 | Attestation signing | REQUIRED |
| EdDSA | Attestation signing | RECOMMENDED |
| SHA-256 | Content hashing | REQUIRED |
| SHA-384 | Content hashing | OPTIONAL |
4.2 Key types
Issuer Keys:4.3 Signing process
The signing process accepts an optionaltimestamp parameter. When provided, it overrides the default iat value (which is current_timestamp()). This is useful for deterministic testing and replaying attestations.
4.4 Verification process
5. Verification chain
5.1 Chained attestations
For complex verifications, multiple attestations can be chained:5.2 Chain reference
5.3 Multi-engine attestation
When multiple engines verify the same query:6. Trust anchors
6.1 Issuer registry
QWED maintains a registry of trusted issuers:6.2 Decentralized identifiers (DIDs)
QWED uses DIDs for issuer identification:6.3 Key rotation
Issuers SHOULD rotate keys annually. Old keys remain valid for attestation verification until their designated expiry.7. Transport & storage
7.1 HTTP header
Attestations can be returned in HTTP headers:7.2 Response body
Attestations can be included in the response:7.3 Standalone document
Attestations can be stored as standalone files:7.4 Blockchain anchoring (optional)
Attestation hashes can be anchored to public blockchains:8. Implementation guidelines
8.1 Request attestation
Request attestation in verification request:8.2 SDK example (Python)
8.3 Storage recommendations
| Use Case | Recommended Storage |
|---|---|
| Short-term audit | In-memory / Redis |
| Long-term compliance | Database with indexing |
| Immutable record | Blockchain anchor |
| Offline verification | File system |
8.4 Security recommendations
- Protect Private Keys - Use HSM or secure key management
- Provide a Valid Secret - The core
AttestationGuardrequires asecret_keyor theQWED_ATTESTATION_SECRETenvironment variable. Insecure fallback secrets are no longer supported; initialization raises aValueErrorif no secret is provided - Validate Issuers - Only trust registered issuers
- Check Expiration - Reject expired attestations
- Verify Chains - Validate all attestations in a chain
- Monitor Revocations - Check revocation status
Appendix A: Error codes
| Code | Description |
|---|---|
ATT-001 | Invalid attestation format |
ATT-002 | Untrusted issuer |
ATT-003 | Invalid signature |
ATT-004 | Attestation expired |
ATT-005 | Attestation not yet valid |
ATT-006 | Attestation revoked |
ATT-007 | Missing required claim |
ATT-008 | Chain validation failed |
Appendix B: MIME types
| Type | Usage |
|---|---|
application/qwed-attestation+jwt | Attestation JWT |
application/qwed-attestation+json | Decoded attestation |
Appendix C: DID method
Thedid:qwed method specification will be published separately.
© 2025 QWED-AI. This specification is released under Apache 2.0 License.