Skip to main content

How to Build a Decentralized KYC Oracle for DeFi with Didit

Verify the user off-chain with Didit, screen the wallet for sanctions and watchlists, and publish a reusable attestation. Full KYC costs $0.33, AML screening $0.20, wallet screening $0.15.

How to Build a Decentralized KYC Oracle for DeFi with Didit

Contents

In this guide

Jump to the part you need.

This guide fits DeFi developers and compliance leads who must verify a user off-chain before a contract lets them in. Didit prices the parts it performs: full KYC $0.33 per completed check, person AML screening $0.20, wallet screening $0.15. The caveat first: Didit returns a decision over API and webhook. Your oracle contract still has to publish and check the attestation.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

What a KYC oracle needs, and the Didit list price for each part
Step in the oracleDidit componentList price
Prove the person is real and holds a genuine IDFull KYC: ID document $0.15, passive liveness $0.10, face match $0.05, device and IP $0.03$0.33 per completed check
Screen the person against sanctions, PEP and watchlistsAML screening, 1,300+ lists$0.20 per check
Keep the person screened after onboardingOngoing AML monitoring$0.07 per user a year
Screen the deposit or withdrawal walletWallet screening, inside transaction monitoring$0.15 per screening
Let a second Didit application reuse the finished checkReusable KYC share and importFree
Orchestrate the steps aboveWorkflow Orchestrator, API, MCP serverFree

Start free in the sandbox at business.didit.me, no sales call. The sandbox is free and unlimited on every plan. Developers working with an AI assistant can connect Didit through the MCP server. The wallet half of this guide is documented in the wallet screening docs, the person half in the AML screening docs, and every number is on the pricing page.

What a decentralized KYC oracle is, and where Didit stops

A decentralized KYC oracle is two things bolted together: an off-chain verification service that proves who the person is and whether the wallet is clean, and an on-chain record small enough that no passport scan ever touches a public ledger. The DeFi protocol reads the record. The personal data stays with the verifier.

Didit returns the verification decision over API or webhook. Separate endpoints mint reusable-KYC share tokens, screen wallets, and create wallet-ownership widget sessions. Your protocol publishes its own attestation. The contract, the attestation format and any zero-knowledge circuit are yours to design, because they belong to your protocol's trust model.

Two rule sets push this work forward. EU measures including MiCA and the Transfer of Funds Regulation, and the FATF travel rule, move crypto providers toward identifying the counterparty before funds move. An oracle that can answer whether a wallet belongs to a verified person who is not sanctioned is a building block for those conversations; whether it also shortens your path to institutional counterparties is a protocol-specific possibility, not a product claim. We serve 4,000+ active companies, and the crypto questions we hear are consistent: can we prove the person, can we prove the wallet, and can we prove both without storing the data.

Prerequisites before you write any code

  • A Didit organization and an application API key with the privileges you need. Reading a decision requires the read:sessions privilege.
  • A KYC workflow with the steps you want, for example ID document verification, passive liveness, face match and AML screening. The workflow ID is a stable UUID from /v3/workflows/.
  • A screening provider configured for wallet screening, under Transactions, then Settings, then Provider Preferences. Without one the wallet endpoint answers 409 Conflict.
  • A callback URL on the application's allowed domains if you redirect users back to your app. Custom app deep links are always accepted.
  • A chain and contract where the attestation will live, plus the rule you will use to decide when an attestation is still valid.
  • Optionally, a coding agent connected to the Didit MCP server, which is free on every plan.

Build it in seven steps

Step 1: Create the workflow and keep its ID

Build the flow in the Didit Business Console and copy the workflow UUID. The workflow type decides what kind of session you get: a KYC workflow creates a user verification session, a KYB workflow creates a business verification session. There is no separate KYB endpoint, which matters if your protocol also onboards funds, market makers or issuing entities.

Step 2: Create a session bound to the wallet address

Send the wallet address as vendor_data. Using the address there is this article's integration choice, not a documented Didit requirement. Didit documents vendor_data as your stable identifier for the entity, used for duplicate detection across sessions and for later lookups; a user ID works equally well if that is what your database keys on. Whichever value you choose, keep it the same across sessions so duplicate detection keeps working. Put the chain and purpose in metadata, which is echoed back in responses and webhooks and never shown to the user.

curl -X POST https://verification.didit.me/v3/session/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "9f9b1234-aaaa-bbbb-cccc-1234567890ab",
    "vendor_data": "0x94f1b9b64e2932f6a2db338f616844400cd58e8a",
    "callback": "https://app.example.com/kyc/done",
    "metadata": {"chain": "ETH", "purpose": "oracle_attestation"}
  }'

Keep the returned session_id and session_url. At this point nothing has been verified and nothing has been billed.

Step 3: Send the user through the hosted flow

Redirect the user to session_url. When they finish, Didit appends verificationSessionId and status to your callback as query parameters. The link lifetime comes from the workflow unless you override it with session_expiration_time, a whole number of seconds between 3600 and 2419200. You can also set language and pre-fill expected_details so mismatches surface as decision warnings rather than silent passes.

Step 4: Read the decision and branch on the session kind

curl https://verification.didit.me/v3/session/SESSION_ID/decision/ \
  -H "x-api-key: YOUR_API_KEY"

Always branch on session_kind. A user session carries id_verifications, liveness_checks, face_matches and aml_screenings. A business session carries registry_checks and key_people_checks. Feature arrays are always arrays, and a step that did not run is absent or null, never a placeholder value.

What you act on is status, which is Approved, Declined or In Review in the normal case, plus decision_trace, which records whether the status came from an automatic rule, a manual reviewer or the Investigator agent, and how many warnings it carried. Poll when your app regains focus, or subscribe to the webhook and skip polling entirely.

A verification session in the Didit Business Console showing the overall status and the warnings raised
The decision object has a console twin. This is the session overview a reviewer opens before approving an attestation.

Step 5: Screen the wallet for sanctions and watchlist exposure

Wallet screening is a standalone call inside transaction monitoring. It screens one address and returns the full risk result without creating a transaction, which is what you want when a withdrawal address is being registered or a governance multisig is about to fund a pool. It writes nothing to the transactions table.

curl -X POST https://verification.didit.me/v3/wallet-screening/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_address": "0x94f1b9b64e2932f6a2db338f616844400cd58e8a",
    "blockchain": "ETH"
  }'

The response carries provider, screening_type, risk_score, severity and the funds-flow breakdown. A 0x address is valid on every EVM chain, so if you omit blockchain the call answers 422 with candidate_chains and nothing is screened or billed. Resend it with the network set. Typed Bitcoin, Tron and Solana addresses are read from their format. Each screening costs $0.15, and bringing your own screening provider to run inside Didit is described in the wallet screening docs.

A wallet screening result in the Didit Business Console with the risk score and provider shown
A screening result in the console: provider, risk score, severity and the exposure breakdown for one address.

Step 6: Publish the attestation, then let a second app reuse it

What goes on-chain is your decision, not ours. A workable pattern is a record holding the wallet address, a hash of the Didit session_id, the outcome, an expiry and whether a human reviewed it, written only after the API says Approved. Names, documents and biometrics stay in Didit. The chain only needs enough to answer whether this wallet satisfied this check, at this time. Treat the attestation contract, the revocation model and the expiry policy as protocol-specific implementation choices: two protocols holding the same Didit decision can reasonably publish different records, and only yours can define what happens when a person is later declined or a wallet is later flagged.

To let a second Didit-integrated application accept the same finished session without a second document upload, mint a share token on the application that holds the session.

curl -X POST 'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/share/' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "for_application_id": "a5f3bca2-46e2-411e-90ef-a580900a57ee",
    "ttl_in_seconds": 7200
  }'

Redeem it on the receiving side. The receiving application must have a workflow of its own, and trust_review decides who makes the call.

curl -X POST 'https://verification.didit.me/v3/session/import-shared/' \
  -H 'x-api-key: RECEIVING_APP_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "share_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "trust_review": false,
    "workflow_id": "9f9b1234-aaaa-bbbb-cccc-1234567890ab",
    "vendor_data": "user-1"
  }'

Set trust_review to true and the clone keeps the source status. Set it to false and the clone is forced to In Review so your own reviewers re-decide. The token lives between 60 and 86400 seconds, defaults to 3600, can be redeemed once per receiving application and cannot be revoked, it simply expires. The cloned session gets a fresh session_id and a shared_from_session pointer for audit. Reusable KYC itself is free on every plan.

Step 7: Keep the attestation current

An attestation with no expiry is a liability. Ongoing AML monitoring costs $0.07 per user a year and provides recurring monitoring for that person. Re-screen the wallet when the address changes, when a transaction rule fires, or on a schedule you can defend in a supervisory conversation. The decision object carries biometric_retention with the date the live biometric data of that session is deleted, so your retention policy can be read from the data rather than from a document. For travel rule, the wallet ownership widget proves control of a self-hosted wallet by message signing, satoshi test, screenshot or self declaration, and marks the address book entry is_ownership_verified: true.

Didit Academy lesson cover for AML screening across sanctions, PEPs and adverse media
Sanctions, PEP and adverse media screening is the part of the check that needs a refresh cycle, not just a one-time pass.

Expected output

After a completed session the decision endpoint returns one object. These are the fields a KYC oracle reads:

  • session_id and session_number, the values you hash into the on-chain record.
  • session_kind, either user or business, the branch you must take before reading anything else.
  • status: Approved, Declined, In Review, In Progress, Not Started, Expired, Abandoned, Kyc Expired, Resubmitted or Awaiting User.
  • decision_trace, with decided_by set to manual, automatic or investigator, plus the warning counts.
  • id_verifications, liveness_checks, face_matches and aml_screenings for the underlying evidence.
  • reviews and status_override, which preserve automatic_status when a human changed the outcome.
  • shared_from_session, present on sessions created by import, for audit.
  • biometric_retention, the deletion date for the live biometric data of that session.

Wallet screening returns provider, screening_type as WALLET_SCREENING, risk_score, severity and the flow breakdown, so your contract logic can threshold on a number instead of a sentence.

Inputs and outputs

The fields this build touches, where they go and what they control
FieldEndpointWhat it does
workflow_idPOST /v3/session/Selects the steps and the session kind
vendor_dataPOST /v3/session/Your stable identifier for the entity, used for duplicate detection. This build puts the wallet address there
callbackPOST /v3/session/Redirect target, must sit on the application's allowed domains for http or https
metadataPOST /v3/session/Your own JSON, echoed in responses and webhooks, hidden from the user
session_expiration_timePOST /v3/session/Overrides the link lifetime, 3600 to 2419200 seconds
statusGET /v3/session/{id}/decision/The outcome your contract gates on
session_kindGET /v3/session/{id}/decision/Tells you whether to read user or business feature arrays
wallet_address and blockchainPOST /v3/wallet-screening/The address to screen and the network it lives on
risk_score and severityPOST /v3/wallet-screening/The screening verdict you threshold on
share_tokenPOST /v3/session/import-shared/Single-use proof that a finished session may be cloned

Failure cases and recovery

What the API answers when the build goes wrong, and what to do next
SymptomCauseRecovery
401 on any callInvalid API keyIssue a new key for the right application
403 "You do not have permission to perform this action."The key lacks read:sessionsAdd the privilege to the key
404 "Not found."The session does not exist or belongs to another applicationCheck that the key and the session come from the same application
409 Conflict on wallet screeningNo screening provider configuredSet one in Transactions, Settings, Provider Preferences, then retry
422 with candidate_chainsA 0x address without a networkResend with blockchain set. Nothing was screened or billed
400 on a Lightning addressNo connected provider that supports LightningScreen the address on a supported chain, or connect a provider in the Marketplace
400 "Share token has expired."Past expMint a new token
403 "This session has already been shared with your application."The token was already redeemedMint a new token, one is allowed per receiving application
404 "Workflow does not exist for this application."The workflow_id belongs to a different applicationUse a workflow from the receiving application
400 "Only finished sessions (Approved, Declined, In Review) can be shared."The source session is still runningWait for the decision, then mint the token

You pay per completed check from prepaid credit, and only when a check finishes with a result. Plan credit is added monthly and does not roll over; top-ups last 12 months. The documentation notes that some no-match database lookups and retries are billable, so budget for them separately from the per-check prices below.

Billable events in this build
EventPriceCharged when
Full KYC$0.33 per completed checkThe session finishes with a decision
AML screening on the person$0.20 per checkThe AML step returns a result
Ongoing AML monitoring$0.07 per user a yearRecurring monitoring continues for that person
Wallet screening$0.15 per screeningAn address is actually screened, not on a 422 ambiguity
Reusable KYC share and importFreeNever billed

Some steps stop for a human, and your oracle should treat those as pending rather than as passes:

  • A session in In Review has a named assignee, a waiting_since timestamp and an sla_due_at. Do not write an attestation from that status.
  • An import with trust_review set to false always lands In Review, by design, so a second protocol's reviewers make their own call.
  • The AML result comes back in aml_screenings inside the decision payload, and the warnings a session carries are reported in decision_trace. Treat a warning-bearing session as pending rather than as a pass.
  • A screenshot wallet proof never auto-verifies. A compliance reviewer approves or rejects it, so the wallet stays unverified until someone acts.
  • A manual override is recorded in status_override with the automatic_status kept alongside it, so your audit trail shows both.

Worked cost example

Take a protocol that onboards 5,000 users a month, runs one full KYC and one person AML check on each, screens one withdrawal address each, and keeps everyone under ongoing monitoring. At list prices, counting per-check usage only:

  • Full KYC: 5,000 x $0.33 = $1,650.00
  • AML screening: 5,000 x $0.20 = $1,000.00
  • Wallet screening: 5,000 x $0.15 = $750.00
  • Monthly usage total: $1,650.00 + $1,000.00 + $750.00 = $3,400.00
  • Per user: $0.33 + $0.20 + $0.15 = $0.68, which is the published crypto bundle

Monitoring is billed per user per year and sits outside that monthly figure: 5,000 x $0.07 = $350.00 for a year, not part of the $3,400.00 and not part of any monthly total.

On the Scale plan, $299 a month with 10% off every price, the same month of usage is:

  • 5,000 x $0.297 = $1,485.00
  • 5,000 x $0.18 = $900.00
  • 5,000 x $0.135 = $675.00
  • Monthly usage total: $1,485.00 + $900.00 + $675.00 = $3,060.00

The full cash cost for that month on Scale is $3,009.00: the $299.00 plan fee plus $2,710.00 paid from top-ups after the plan's $350.00 monthly credit comes off the $3,060.00 usage. Top-ups are bought at face value and last 12 months. Monitoring on Scale is 5,000 x $0.063 = $315.00 a year, again separate from the monthly figure. On Enterprise, contracts start at $15,000 a year and usage beyond the credit is invoiced as overage. There is no separate charge for the workflow, the share flow or the MCP server. Usage charges are driven by completed checks and monitoring, while plan fees include member limits.

Add Didit to Claude · Open Didit in ChatGPT · MCP setup for every client

Sources

The next step is small: open the sandbox at business.didit.me, create the KYC workflow, and run the two curls above with a test address. No sales call. The sandbox is free and unlimited on every plan.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

What is a decentralized KYC oracle?

It is an off-chain identity verification service paired with a small on-chain record that any contract can read. The service proves the person is real, holds a valid ID and is not sanctioned; the record says whether that check passed, usually keyed to a wallet address and an expiry. The personal data stays off-chain with the verifier.

How do I screen an oracle trust fund wallet against watchlists and sanctions lists?

Call POST https://verification.didit.me/v3/wallet-screening/ with the wallet_address and the blockchain, and Didit returns risk_score, severity and the funds-flow breakdown for that address. The application must have a screening provider configured in Transactions, Settings, Provider Preferences, otherwise the call answers 409 Conflict. Each screening costs $0.15, and a 0x address sent without a network answers 422 and is not billed.

Can a user verify once and be accepted by a second DeFi protocol?

Yes, through Reusable KYC. The application holding the finished session mints a share token with POST /v3/session/{sessionId}/share/, and the receiving application redeems it with POST /v3/session/import-shared/. The token lasts between 60 and 86400 seconds, is redeemable once per application, and the clone records shared_from_session for audit. The feature is free.

How much does a decentralized KYC oracle cost per user?

At list prices a verified user costs $0.68: full KYC $0.33 plus AML screening $0.20 plus wallet screening $0.15. Keeping that person monitored adds $0.07 per user a year, which is billed annually and not part of the per-user check total. Growth takes 4% off every price and Scale takes 10%, and the workflow, the share flow and the MCP server are free.

Does Didit put identity data on-chain?

Didit returns the decision to your servers over API or webhook. Your protocol publishes its own attestation, for example a hash of session_id, the outcome and an expiry. Names, documents and biometrics stay in Didit, and biometric_retention tells you when the live biometric data of that session is deleted.

What happens when a session lands In Review?

A reviewer holds the session and the decision carries assignee, waiting_since and sla_due_at. Treat In Review as pending: do not write an approved attestation from it. When the reviewer decides, decision_trace records decided_by as manual and status_override keeps the automatic_status next to the new one.

How do we prove the user controls the wallet address?

Use the wallet ownership widget. It proves control by message signing, by a satoshi test where the user sends a small amount from the wallet, by screenshot review, or by self declaration where the jurisdiction allows it. A verified proof marks the address book entry is_ownership_verified: true, which releases a travel rule transfer stuck in UNCONFIRMED_OWNERSHIP.

Do we need a sales call to start building?

No. Create an organization at business.didit.me, build a workflow and call the API from the sandbox, which is free and unlimited on every plan. The Free plan adds $10 of monthly credit for organizations that sign up with a work email. Sales only enters the picture for Enterprise contracts, which start at $15,000 a year.

Which countries and documents does the identity step cover?

Didit covers 220+ countries and territories, 14,000+ document types and 54 languages in the verification flow and native SDKs. Detection and extraction run in sub-2-second p99 inference, and 200+ real-time fraud signals are evaluated on every session. Published prices do not by themselves establish production availability, so check the product page for the country and method you need.

Is Didit certified for regulated crypto work?

Didit holds SOC 2 Type 2, ISO/IEC 27001:2022 certification, and iBeta Level 1 presentation attack detection, with GDPR, DORA, MiCA, AMLD6 and eIDAS 2.0 alignment. Spain's Tesoro, Banco de España and SEPBLAC have attested the process as safer than in-person verification. The SOC 2 Type 2 report is shared under NDA.

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.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • 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.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • 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.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.