Lattice-Based Signatures: A Post-Quantum How-To
Add an ML-DSA or FN-DSA signature over the SHA-256 digest of each identity artifact, next to the PAdES signature and evidence Didit returns. In this design, the lattice key stays in your custody.

Contents
In this guide
Jump to the part you need.
The lattice signature is the post-quantum replacement for the RSA and ECDSA signatures identity artifacts carry today. This guide fits teams that must keep signed records verifiable for a decade or more. Published here: the $0.33 full ID check and the $0.0685 Spain SMS code. The signing step's price is not in the supplied feed. The caveat: the E-signature docs list Simple, AES and QES, not a lattice option, so the lattice key stays on your side.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | What it is |
|---|---|
| Outcome | Every signed identity artifact carries a post-quantum signature over its digest, stored next to the Didit PAdES signature and evidence PDF. |
| Algorithm | ML-DSA (FIPS 204, derived from Dilithium) by default; FN-DSA, the Falcon-derived scheme, where signature size dominates. |
| Size you pay in | ML-DSA signatures run roughly 2.4 KB to 4.6 KB by parameter set; FN-DSA roughly 0.7 KB to 1.3 KB. |
| Where the private key lives | Your KMS or HSM. In this design, the lattice key stays in your custody. |
| What Didit provides | The verified identity before signing, the signed PDF, the evidence PDF and the SHA-256 digests you sign. If you separately use Didit Authentication, its tokens are documented in the Authentication API. |
| Published prices | Full ID check $0.33 per completed check; free Workflow Orchestrator and free MCP server. E-signature pricing is not published in the supplied feed. |
| Main caveat | The supplied E-signature documentation describes Simple, Advanced (AES) and Qualified (QES) signatures and does not document a lattice-signing option. The post-quantum layer in this guide runs on your side, over artifacts Didit returns. |
Start free in the sandbox at business.didit.me, no sales call. The signing step is documented on the E-signature API page. Pricing figures in this guide come from didit.me/pricing. Developers who want an assistant to drive the wiring can connect the Didit MCP server.
Add Didit to Claude · Open Didit in ChatGPT · MCP setup for every client
The outcome, and the method we recommend
The outcome is a signature bundle designed to remain verifiable against quantum attacks, subject to the algorithm and implementation remaining secure. You get it by signing the digest of each identity artifact with a lattice key you control, and keeping that signature beside the record of the signing ceremony.
The method we recommend is hybrid, in this order:
- Run the signer through a Didit workflow with identity verification, then an Advanced (AES) e-signature, so the signature is tied to a verified person and confirmed with a one-time code sent to a verified email or phone.
- Take the
sha256_signeddigest and theevidence_filefrom the decision, and store them with the signed PDF. - Sign a canonical manifest (the session ID, the signature node ID,
sha256_signedand a timestamp) with ML-DSA in your own key store, and keep the public key with the artifact. - Verify both signatures on every read: the PAdES signature through Didit, the lattice signature against your public key.
- Drop the classical half of the bundle only when every verifier in your chain supports ML-DSA or FN-DSA.
Hybrid first, because a pure post-quantum bundle today breaks every downstream tool that expects a classical certificate chain, and because the classical half still protects you against non-quantum attackers while the lattice half protects the record from a later quantum break.
| Family | Standard | Signature size (approximate) | Use it when |
|---|---|---|---|
| ML-DSA, derived from Dilithium | FIPS 204 | 2.4 KB to 4.6 KB depending on parameter set | Default choice. Integer arithmetic only, fast verification, broadest library support. |
| FN-DSA, derived from Falcon | Falcon-derived scheme, no final standard number cited here | 0.7 KB to 1.3 KB | Signature size or bandwidth dominates and every verifier supports it. |
| SLH-DSA | FIPS 205 | Kilobytes, hash-based | You want a second hardness assumption next to your lattice signature. Not a lattice scheme. |
| ML-KEM, derived from Kyber | FIPS 203 | Not a signature | Key establishment only. It cannot sign a document, despite what many summaries imply. |
Prerequisites
- A Didit sandbox application and an API key. Sandbox testing is free and unlimited.
- A workflow with an ID Verification step and, for Advanced (AES) signatures, Email Verification or Phone Verification so the one-time code reaches a verified contact. If the workflow has Liveness, that step must be Approved too.
- A document store for the source PDF or Word file, supplied per session or uploaded to the workflow.
- A key store for the lattice key: your KMS, an HSM, or at minimum a signing service your application cannot read the private key out of.
- A library that implements FIPS 204 ML-DSA or FN-DSA that you have evaluated yourself. Use csrc.nist.gov/pubs/fips/204/final to check ML-DSA implementations. FN-DSA has no final FIPS standard cited here, so evaluate its implementation against its own published specification.
- A decision on the manifest format you sign, because you need it byte-stable across years. JSON with sorted keys and no floating point is enough.
- A verifier you control, so a document read at any future date re-checks both signatures instead of trusting the archive.
Steps
-
Decide what you sign. Sign the digest Didit returns, not the PDF file. The PDF is the deliverable; the digest is the fixed value you can re-check in 2035 without re-parsing a document format. Didit returns
sha256_originalfor the file you sent andsha256_signedfor the file it produced. -
Put the identity steps before the signature step. In the Business Console, add the E-signature feature (
SIGNATURE) after ID Verification, and set the signature level toaes. For a company signing, a Key People step whose people complete their own KYC comes first, andsimpleis refused withsignature_simple_requires_verified_person, so the workflow will not save.
The ID document check has to be Approved before an Advanced signature step can run. -
Create the session with the document. This is the documented call for per-session documents:
curl -X POST 'https://verification.didit.me/v3/session/' \ -H 'x-api-key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "workflow_id": "YOUR_WORKFLOW_ID", "vendor_data": "signer-1042", "sign": { "documents": [ { "title": "Custody agreement", "file_name": "custody-agreement.pdf", "content_base64": "<base64 of the PDF>", "fields": [ { "key": "signature", "type": "signature", "page": 3, "x": 0.09, "y": 0.62, "width": 0.36, "height": 0.085 }, { "key": "credit_limit", "type": "data", "page": 1, "x": 0.34, "y": 0.31, "width": 0.3, "height": 0.03, "prefill": "api.credit_limit" } ] } ], "field_values": { "credit_limit": "3,000 EUR" } } }' -
Send the signer to the hosted flow. Open the
urlthe session call returns, or launch it with the Web or native SDK. The signer verifies identity, reviews each document, adds a signature and initials, and confirms with the one-time code sent to the verified email or phone.
If the workflow includes Liveness, it must be Approved as well before the signature completes. -
Read the decision. Wait for the
status.updatedwebhook, then fetch the decision. Every field below is from the documented decision surface.curl --fail-with-body 'https://verification.didit.me/v3/session/SESSION_ID/decision/' \ -H 'x-api-key: YOUR_API_KEY' -
Check the signing stage and level. Read
signatures[]: one item per signer and signature step. The fields that matter for the lattice layer are:{ "signatures": [ { "status": "signed", "verdict": "Approved", "level": "aes", "format": "pades", "profile": "PAdES-B-LT", "documents": [ { "sha256_original": "DIGEST_OF_SOURCE", "sha256_signed": "DIGEST_OF_SIGNED_PDF", "status": "signed", "signed_file": "DOWNLOAD_PATH" } ], "evidence_file": "DOWNLOAD_PATH", "warnings": [] } ] }The value names (
signed,Approved,aes,pades,PAdES-B-LT) are the documented ones. Your own digests and download paths appear in those slots. -
Download the signed PDF and the evidence file. The signed file comes from
/v3/session/{session_id}/signatures/{node_id}/documents/{document_id}/file/and the evidence PDF from/v3/session/{session_id}/signatures/{node_id}/evidence/?signature_id={id}. Both accept the samex-api-key. Keep them together with the decision payload, because the digests only mean something next to the file they describe. -
Sign the manifest with your lattice key. Build the manifest from
session_id, the signature node ID,sha256_signedand an RFC 3161 timestamp, then sign it with ML-DSA in your key store and record the key ID. Store four things per signer: the signed PAdES PDF, the evidence PDF, your lattice signature, and your public key. Nothing in this step touches Didit, and that is deliberate. The quantum-resistant half of the record must not depend on any single vendor staying in business. -
Verify both halves and keep the keys fresh. Re-check the PAdES signature with
POST /v3/session/{session_id}/signatures/{node_id}/validate/, verify your ML-DSA signature against the stored public key, and compare the digest of the bytes you serve tosha256_signed. If you also run Didit Authentication for the account that signed, verify its access token against your issuer JWKS cached for 5 minutes, keyed bykid, refetching at most once a minute when akidis unknown. Keys rotate every 30 days and Didit publishes the next key a day early, so a 5-minute cache verifies across a rotation.
Expected output
A finished run leaves you with a verdict of Approved on the identity steps and on the signature step, a PAdES-B-LT signed PDF, an evidence PDF naming who signed and how, and two digests. The lattice signature you add on top is a separate file of roughly 2.4 KB to 4.6 KB with ML-DSA, or 0.7 KB to 1.3 KB with FN-DSA, plus the public key you store once per key generation.
Inputs and outputs
| Direction | Field | What it holds |
|---|---|---|
| Input | workflow_id | The workflow with ID Verification and the SIGNATURE feature, signature level aes. |
| Input | vendor_data | Your own reference for the signer. |
| Input | sign.documents[].content_base64 | Base64 of the PDF or Word file when you send documents per session. |
| Input | sign.documents[].fields | Signature, initials, date, text and checkbox fields placed by page and position, or by anchor text. |
| Input | sign.field_values | Values for fields whose prefill is api.<key>. |
| Output | signatures[].status | Signing stage: intro, review, code, signing, signed or declined. |
| Output | signatures[].verdict | Not Finished, Approved, In Review or Declined. |
| Output | signatures[].level and format | simple, aes or qes; pdf for simple, pades for aes and qes. |
| Output | signatures[].documents[].sha256_signed | The digest you sign with your lattice key. |
| Output | signatures[].evidence_file | Download path for the evidence PDF that records who signed and how. |
| Output | signatures[].warnings[] | {code, node_id} pairs that decide review or decline. |
| Output, yours | ML-DSA signature and key ID | The post-quantum half of the bundle, produced outside Didit. |
Failure cases and recovery
| Symptom | Cause | Recovery |
|---|---|---|
signature_simple_requires_verified_person on save | A KYB workflow was saved with signature level simple. | Set signature_level to aes. Key people sign on behalf of the company and must be verified. |
SIGNATURE_IDENTITY_NOT_VERIFIED | The ID step is not Approved when the signature step starts. | Fix the verification first. A signature cannot be tied to an identity that failed. |
SIGNATURE_OTP_FAILED or SIGNATURE_OTP_NOT_CONFIRMED | The one-time code was wrong or never entered. | Resend the code to the same verified email or phone and let the signer retry inside the flow. |
SIGNATURE_NAME_MISMATCH | The name typed at signing differs from the ID document. | Route to review, or correct the workflow field and re-create the session. |
SIGNATURE_DECLINED | The signer declined. Defaults to REVIEW. | A person decides. Do not auto-approve a declined signature. |
SIGNATURE_DOCUMENT_CHANGED | The source document changed after upload. Defaults to DECLINE. | Re-create the session with the final file. Never patch the stored PDF, because sha256_signed would no longer match. |
400 invalid_grant on code exchange | The authorization code was reused or older than 60 seconds, or the PKCE verifier or redirect_uri does not match. | Start sign-in again and keep the verifier bound to the tab that began the flow. |
A token names a kid you do not have | Your JWKS cache predates a key rotation. | Refetch the JWKS, at most once a minute, and reject the token if the key is still missing. |
| Tokens fail after a custom domain goes live | The issuer changed to your domain, and tokens signed under the old host no longer pass GET /session/. | Update DIDIT_AUTH_ISSUER, or accept both issuers until the older tokens expire within 5 minutes. |
Paid steps and review boundaries
Free on every plan: the sandbox, the Workflow Orchestrator, the MCP server and the SDKs. Everything that produces the artifact is metered per completed check.
- ID Verification $0.15, Passive Liveness $0.10, Face Match 1:1 $0.05, Device and IP Analysis $0.03. Together they are the full ID check at $0.33.
- Email Verification $0.02, or Phone Verification from $0.02 plus the carrier price for the country and channel.
- E-signature: the supplied price feed does not publish a price for the signing step, so this guide does not quote one. Read the current price on didit.me/pricing before you commit. Qualified (QES) pricing is not published in the supplied materials either, and the documentation describes QES as an add-on where a qualified trust service provider issues the signer a qualified certificate.
- Business verification from $2.00 per company, plus $0.20 person AML per owner or officer, plus $0.33 linked KYC per person.
- Document AI $0.20 per document, if you parse the signed file back.
Two review boundaries are set by the product, not by you. SIGNATURE_DECLINED defaults to REVIEW, so a declined signature waits for a person. SIGNATURE_DOCUMENT_CHANGED defaults to DECLINE, so a file that changed after upload fails closed. A third boundary is yours: verifying the lattice signature is your code, your key and your incident response, and no Didit support ticket covers it.

Worked cost example
One signer, Advanced e-signature, ID check, SMS code to Spain. List price, using only the lines the feed publishes:
- Full ID check: $0.15 + $0.10 + $0.05 + $0.03 = $0.33
- SMS to Spain: $0.0685 (carrier $0.0485 + Didit fee $0.02)
- Per signer, published lines only: $0.33 + $0.0685 = $0.3985
- 1,000 signers: $0.3985 x 1,000 = $398.50
- The signing step is not in this total, because the supplied feed does not publish its price. Add it from the pricing page.
Same run on the Scale plan, where Didit prices take 10% off and the carrier price passes through at cost:
- Full ID check: $0.297
- SMS to Spain: $0.0485 + $0.018 = $0.0665
- Per signer, published lines only: $0.297 + $0.0665 = $0.3635
- 1,000 signers: $0.3635 x 1,000 = $363.50
The lattice signature itself adds no Didit cost. It adds CPU, a key store and storage of roughly 3 KB per signer with ML-DSA, so 1,000 signers is about 3 MB of signature material next to the PDFs.
Sources
- Didit docs: E-signature API, sign documents after KYC
- Didit docs: Tokens and JWKS, ES256, rotation and caching
- Didit docs: Authentication overview
- Didit docs: Pricing and billing rules
- Didit pricing page and pricing as JSON
- Didit MCP server
- NIST FIPS 204, Module-Lattice-Based Digital Signature Standard, final, August 2024, csrc.nist.gov/pubs/fips/204/final, read November 26, 2026
- NIST FIPS 203, Module-Lattice-Based Key-Encapsulation Mechanism Standard, final, August 2024, csrc.nist.gov/pubs/fips/203/final, read November 26, 2026
- NIST FIPS 205, Stateless Hash-Based Digital Signature Standard, final, August 2024, csrc.nist.gov/pubs/fips/205/final, read November 26, 2026
Open a free sandbox at business.didit.me and run one Advanced signature end to end before you build the lattice layer around it. No sales call.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
What is a lattice-based signature?
A lattice-based signature is a digital signature whose security rests on the hardness of problems in integer lattices, mainly finding short vectors and close vectors in high-dimensional grids. Shor's algorithm solves factoring and discrete logarithms, which is what RSA and ECDSA rely on, but it does not give a practical shortcut for these lattice problems. ML-DSA (FIPS 204, from Dilithium) is the standardized lattice signature family, and FN-DSA is the Falcon-derived alternative.
Does Didit sign documents with a lattice-based algorithm today?
The supplied E-signature documentation describes three levels, Simple, Advanced (AES) and Qualified (QES), and does not document a lattice-signing option. Didit Authentication tokens are signed with ES256, and AES and QES signatures come back as PAdES. That is why this guide puts the lattice key and the lattice signature on your side, over the digest Didit returns.
Should I use ML-DSA or FN-DSA?
Start with ML-DSA. It uses integer arithmetic only, which avoids the floating-point and constant-time concerns that make FN-DSA harder to deploy safely, and implementations are easier to find. Move to FN-DSA when signature size or bandwidth dominates, since it produces signatures roughly three times smaller. Both are believed to resist quantum attack at equivalent security levels.
Why is Kyber not a signature scheme?
Kyber, standardized as ML-KEM in FIPS 203, is a key-encapsulation mechanism, so it establishes a shared secret and cannot sign anything. Many summaries list Kyber next to Dilithium and Falcon as if all three were signatures, and that is wrong. For signatures you need ML-DSA, FN-DSA or a hash-based scheme such as SLH-DSA.
How much bigger are lattice signatures than RSA or ECDSA?
Much bigger. An ML-DSA signature runs roughly 2.4 KB to 4.6 KB depending on the parameter set, and FN-DSA roughly 0.7 KB to 1.3 KB, against about 64 bytes for ECDSA P-256 and 256 bytes for RSA-2048. Public keys grow too, to roughly 1.3 KB to 2.6 KB with ML-DSA. Plan for the storage and the larger tokens before you commit to a scheme.
What is the compact lattice gadget in hash-and-sign signatures?
A lattice gadget is the public matrix that a hash-and-sign scheme samples against, and a compact gadget is a smaller encoding of the same object. The compact construction reduces the public key size and the sampling work in GPV-style hash-and-sign signatures, the family Falcon belongs to. The practical takeaway is smaller public keys at the same security target, not a new hardness assumption.
Should I switch to post-quantum signatures now or wait?
Add the lattice signature now and keep the classical one next to it. Records you sign today must stay verifiable for years, and an attacker who can forge a classical signature later can backdate a document you archived yesterday. Hybrid bundles cost you a few kilobytes and remove that risk without breaking any verifier that expects a certificate chain.
How do I check a signature after the key rotates?
For your lattice signature, never rely on a stored key ID alone: store the public key with the artifact, because verification must work when your KMS has moved on. For Didit Authentication tokens, cache the issuer JWKS for 5 minutes, key by kid, and refetch at most once a minute when an unknown kid appears. Keys rotate every 30 days and the next key is published a day in advance, so a short cache survives a rotation.
How is the Didit signing step priced?
The supplied price feed publishes the full ID check at $0.33 and the Spain SMS code at $0.0685, but it does not publish an E-signature price, so this guide does not quote one. Qualified (QES) pricing is not published in the supplied materials either. Check didit.me/pricing for the current signing price before you commit, and remember that sandbox runs are free and unlimited.
Can I prove a document was signed by a specific person, not just by a key?
Yes, at the Advanced (AES) or Qualified (QES) level. AES requires approved ID verification and a verified email or phone. QES requires approved passport or national ID verification and a verified phone. The signer confirms with a one-time code, so the evidence PDF ties the signature to a verified identity. At Simple level there is no identity tie, which is why we do not recommend it for documents you may have to defend.
Compliance built in
Audited, certified and attested.
We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center
- Regulation encoded into your flows
Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.
- Ready for AMLR
Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.
- Tested in Spain's Treasury sandbox
Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.
- Audited, not self-declared
iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.
Your obligations · 3 regions
SOC 2 Type 2
ISO 27001
iBeta Level 1 and Level 2
EU regulator attestation
FSM youth protection
GDPR
EBA remote onboarding
MiCA compatible
FIDO Alliance member
- AMLREU AML Regulation ready
Integration · Didit MCP
Run Didit from your own AI agent
Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.
- Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
- Run investigationsAsk why a session was declined, review cases, search people and companies.
- Change rulesCreate payment rules, test them on past data and switch them on.
- Pull reportsAsk for numbers, exports or the audit log.
Didit Academy


