Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Setting Up KYC/AML Verification for On-Ramps

A step-by-step developer guide for implementing Know Your Customer (KYC) and Anti-Money Laundering (AML) checks in a fiat-to-crypto gateway. Covers provider integration, risk rules, data flows, and audit trails.
Chainscore © 2026
introduction
COMPLIANCE

Introduction to KYC/AML for On-Ramps

A technical guide to implementing Know Your Customer (KYC) and Anti-Money Laundering (AML) verification for cryptocurrency on-ramps, covering core concepts, integration patterns, and developer considerations.

KYC (Know Your Customer) and AML (Anti-Money Laundering) are mandatory regulatory frameworks for financial services, including cryptocurrency on-ramps. KYC involves verifying a user's identity—typically requiring government-issued ID, proof of address, and sometimes a live selfie. AML refers to the ongoing processes of monitoring transactions for suspicious activity and reporting it to authorities like FinCEN in the US or the FCA in the UK. For on-ramps, which convert fiat currency to crypto, these checks are a legal requirement in most jurisdictions to prevent fraud, terrorist financing, and sanctions evasion. Non-compliance can result in severe penalties, license revocation, and exclusion from the traditional banking system.

Integrating KYC/AML into an on-ramp involves several technical components. The core is a third-party verification provider like Sumsub, Jumio, or Onfido. These services offer APIs that accept user-submitted documents, perform automated checks (liveness detection, document authenticity), and return a verification status. A typical flow involves: 1) User initiates a fiat deposit, 2) Your platform redirects them to the provider's hosted verification page or SDK, 3) The provider returns a verificationId and status (approved, pending, rejected), 4) Your backend processes this webhook to unlock the user's deposit limit or transaction capability. You must also integrate AML screening services like Chainalysis or Elliptic to screen wallet addresses against sanctions lists and monitor transaction patterns.

For developers, key implementation considerations include data privacy, user experience, and regulatory scope. User data must be encrypted in transit and at rest, with clear retention policies per regulations like GDPR. The verification step should be frictionless; using a provider's mobile SDK can streamline the process by allowing document capture via a phone's camera. Crucially, you must determine your jurisdictional obligations. A user in the European Union triggers different requirements (e.g., 5th AML Directive) than one in a different region. Your integration must be able to apply geographic rulesets and adjust the required verification steps—such as identity document type or enhanced due diligence for high-value transactions—accordingly.

Beyond initial verification, ongoing transaction monitoring is required. This involves setting risk rules based on transaction amount, frequency, destination addresses, and geographic origins. For example, you might flag any deposit over $10,000, rapid successive deposits from a new account, or transfers to wallets associated with OFAC-sanctioned entities. These rules should be configurable and trigger manual review workflows. Implementing a risk scoring system helps automate this: each user gets a score based on their verification data and transaction behavior, which determines their limits or whether their activity requires further scrutiny. This system must generate Suspicious Activity Reports (SARs) for filing with the relevant financial intelligence unit when mandated.

Finally, maintaining compliance is an active process. Regulations and sanctions lists update frequently. Your integration with AML screening providers must poll for and apply these updates in near real-time. Regular audits of your KYC/AML procedures are necessary, both internally and by external regulators. For on-ramps operating globally, a compliance-first architecture is essential, designed to adapt to new regional laws without major code refactors. The technical stack should separate compliance logic from core transaction logic, allowing rules engines and provider APIs to be swapped or updated as the regulatory landscape evolves.

prerequisites
KYC/AML SETUP

Prerequisites and Compliance Scope

This guide outlines the foundational requirements and regulatory considerations for integrating KYC/AML verification into your on-ramp solution.

Before implementing a Know Your Customer (KYC) and Anti-Money Laundering (AML) verification flow, you must first define your compliance scope. This is dictated by the jurisdictions you operate in, the type of assets you handle (e.g., fiat, crypto), and the services you offer. Key regulations include the Bank Secrecy Act (BSA) in the US, 5AMLD/6AMLD in the EU, and FATF Travel Rule requirements for cross-border transactions. Your legal team must perform a jurisdictional analysis to determine which specific rules apply to your business model, as requirements for a non-custodial swap service differ significantly from those for a fiat-to-crypto exchange.

The technical prerequisite is establishing a relationship with a licensed VASP (Virtual Asset Service Provider) or a specialized KYC provider. You cannot legally perform identity verification or sanction screening yourself without the proper licenses. Providers like Sumsub, Jumio, or Onfido offer APIs that handle document verification, liveness checks, and watchlist screening. Your first integration step is to create a developer account, obtain API keys, and typically set up a webhook endpoint (e.g., https://your-api.com/kyc/webhook) to receive asynchronous verification results and status updates for each user session.

From a development standpoint, you need to design a user flow that collects the necessary Personally Identifiable Information (PII). This typically involves a frontend component to capture: a government-issued ID (passport, driver's license), a proof of address (utility bill), and a selfie for liveness verification. The backend must securely transmit this data to your KYC provider's API and store only the resulting verification status and a unique applicant ID—never store raw ID images or PII on your own servers unless you have commensurate security and data protection compliance (like SOC 2 or ISO 27001).

Your code must handle the verification lifecycle. After initiating a check by posting user data to your provider's /v1/applicants endpoint, you will receive a applicantId and a review status (e.g., pending, completed). You must poll their status endpoint or, more efficiently, listen for webhook events. A common practice is to update the user's on-chain allowance or fiat deposit limit based on the finalReviewStatus. For example, a GREEN result might enable higher tiers, while a RED result triggers an automatic block and a compliance review ticket.

Finally, you are responsible for maintaining audit trails. Regulatory examinations will require you to demonstrate how you verified a user's identity at a specific point in time. This means securely logging the verification request ID, timestamp, decision, and the rationale for any manual overrides. Implement data retention and deletion policies in line with GDPR or CCPA if applicable. Non-compliance risks severe penalties, including loss of banking partnerships and regulatory fines, making a robust, documented KYC/AML integration a critical business prerequisite, not just a technical feature.

architecture-overview
IMPLEMENTATION GUIDE

System Architecture for KYC/AML Verification for On-Ramps

A robust verification system is critical for compliant on-ramps. This guide outlines the core architectural components and data flows required to integrate identity verification into your fiat-to-crypto gateway.

A compliant on-ramp verification system is a multi-layered architecture that separates concerns for security, scalability, and regulatory adherence. At its core, it consists of three primary layers: the client-facing interface (your application), a backend orchestration layer (your server logic), and external verification providers (specialized KYC/AML services). The client interface collects user data and documents. Your backend acts as the secure conduit, managing sessions, encrypting sensitive data, and routing requests to the appropriate third-party vendor via their API. This decoupled design allows you to switch providers or add redundancy without disrupting the user experience.

The data flow begins when a user initiates a transaction exceeding a compliance threshold. Your frontend should trigger the verification workflow, capturing: - Government-issued ID (via document scan), - A live selfie for liveness checks, - Proof of address, and - Basic personal information (name, DOB). This data is sent via a secure, encrypted HTTPS POST request to your backend. Never send PII directly from the client to the verification provider; your backend must act as a proxy to maintain control over data logging, audit trails, and to apply additional business logic, such as checking internal watchlists before proceeding.

Your backend service must integrate with one or more KYC provider APIs, such as Sumsub, Jumio, or Onfido. The integration involves managing API keys securely (using environment variables or a secrets manager), handling webhooks for asynchronous result delivery, and normalizing responses into a consistent internal data model. A critical pattern is to implement a provider abstraction layer. This allows you to define a common interface for verification tasks, making your system agnostic to the specific provider's API nuances. For example, a verifyUser function in your code would call the configured provider's SDK, but the rest of your application only interacts with the standardized response.

Handling Verification Results and Webhooks

Most providers process checks asynchronously. After submitting a verification request, they will send a result via a webhook to an endpoint you configure. Your system must: 1. Validate the webhook signature (using a secret from the provider) to ensure authenticity. 2. Parse the payload to determine the verification status (APPROVED, PENDING, REJECTED, RESUBMISSION_REQUIRED). 3. Update the user's compliance status in your database. 4. Trigger downstream actions, such as enabling the wallet address for funding, notifying the user, or escalating the case for manual review. Log all webhook events immutably for audit purposes.

Security and data privacy are paramount. Ensure all PII is encrypted at rest and in transit. Adopt a data minimization principle: only request and store the absolute minimum data required for compliance in your own database. Consider using the verification provider's data storage solution to avoid being the custodian of sensitive documents. Implement strict access controls and audit logs for any internal access to verification data. Furthermore, design for graceful degradation; if your primary KYC provider is down, your system should be able to route traffic to a secondary provider or queue requests without failing the user's onboarding journey.

Finally, the architecture must support ongoing monitoring and transaction screening. After initial identity verification (KYC), you need to screen each transaction for AML risks. This involves sending wallet addresses and transaction details to a screening service like Chainalysis or Elliptic in real-time, before processing the on-ramp. The decision engine in your backend should evaluate combined KYC and AML signals to make a final PASS/FLAG/BLOCK decision. Document every step of this process clearly to demonstrate your compliance program to regulators and auditors.

verification-providers
ON-RAMP COMPLIANCE

KYC/AML Provider Comparison

Choosing the right KYC/AML provider is critical for secure and compliant fiat-to-crypto on-ramps. This guide compares leading solutions based on integration, coverage, and verification speed.

06

Choosing Criteria for Developers

Evaluate providers based on your specific technical and business needs.

  • Coverage & Docs: Does it support your target countries and required document types (e.g., Aadhaar for India)?
  • Integration Complexity: Assess API/SDK documentation, sandbox availability, and estimated dev time.
  • Cost Structure: Understand pricing models—per verification, monthly active user (MAU), or flat fee.
  • Compliance Certifications: Look for ISO 27001, SOC 2, and GDPR compliance assurances.
  • Fraud & AML Depth: Check screening list coverage and customization options for risk rules.
KEY COMPARISON

KYC Provider Feature Matrix

A technical comparison of major KYC/AML providers for crypto on-ramps, focusing on integration, compliance, and cost metrics.

Feature / MetricSumsubOnfidoVeriffJumio

Document Verification

Liveness & Biometric Check

Database AML Screening (PEPs, Sanctions)

Transaction Monitoring (Post-KYC)

Average Verification Time

< 30 sec

45-90 sec

< 60 sec

2-3 min

API Latency (p95)

< 1 sec

< 1.5 sec

< 2 sec

< 3 sec

SDK Customization (UI/UX)

High

Medium

High

Low

Geographic Coverage (Countries)

190+

195+

180+

200+

Pricing Model (per verification)

$0.50 - $2.50

$1.00 - $4.00

$0.80 - $3.00

$1.50 - $5.00

Regulatory Certifications (SOC2, ISO)

SOC2, ISO 27001

SOC2, ISO 27001

SOC2

SOC2, ISO 27001

integration-workflow
SETUP

Step 1: Integrating the Verification API

This guide details the initial integration of a KYC/AML verification API into your on-ramp flow, covering endpoint configuration, request signing, and handling the initial user session.

Begin by obtaining your API credentials from your KYC provider's dashboard. You'll typically receive an API Key for identification and a Secret Key for signing requests. For production environments, always use the live API base URL (e.g., https://api.verification-provider.com/v1/) instead of sandbox endpoints. Store these credentials securely using environment variables or a secrets manager—never hardcode them in your frontend client. Most providers offer SDKs for popular languages like Node.js, Python, and Go to simplify the integration process.

The core of the integration is the session initialization call. You will make a POST request to an endpoint like /sessions from your secure backend server. This request must include a payload with a unique userId (your internal reference) and the desired flow type (e.g., kyc_aml_tier2). Crucially, the request must be signed using your Secret Key, often via an X-Signature header using HMAC-SHA256. A successful response returns a sessionId and a clientToken, which your frontend will use to load the verification widget.

Here is a Node.js example using the axios library to create a session:

javascript
const crypto = require('crypto');
const axios = require('axios');

const apiKey = process.env.KYC_API_KEY;
const secretKey = process.env.KYC_SECRET_KEY;
const apiBaseUrl = 'https://api.verification-provider.com/v1';

async function createVerificationSession(userId) {
  const payload = {
    userId: userId,
    flow: 'kyc_aml_tier2'
  };
  const payloadString = JSON.stringify(payload);
  const signature = crypto.createHmac('sha256', secretKey)
                         .update(payloadString)
                         .digest('hex');

  const response = await axios.post(
    `${apiBaseUrl}/sessions`,
    payload,
    {
      headers: {
        'X-API-Key': apiKey,
        'X-Signature': signature,
        'Content-Type': 'application/json'
      }
    }
  );
  return response.data; // Contains { sessionId, clientToken }
}

Once you have the clientToken from the backend response, you must pass it to your frontend application. The standard method is to embed a verification widget provided by the KYC vendor. You load their JavaScript SDK and initialize it with the token. This widget handles the entire user-facing process: document capture, liveness checks, and data collection. Your frontend code does not handle sensitive KYC data directly; it merely hosts the secure iframe or component. Ensure your frontend listens for the widget's completion events to update your UI and notify your backend.

After the user completes the steps in the widget, the KYC provider will send a webhook to a callback URL you configured in their dashboard. This is how you receive the final verification result asynchronously. The webhook payload will contain the sessionId, userId, and a status (e.g., approved, rejected, pending). Your backend must verify the webhook's signature (using the same Secret Key) to ensure it's legitimate before updating the user's verification status in your database and triggering any subsequent on-ramp processes.

For a robust integration, implement proper error handling for network timeouts, invalid signatures, and provider-side errors. Log all API interactions (obfuscating sensitive data) for debugging. Finally, conduct end-to-end testing in the provider's sandbox environment using test documents and IDs before deploying to production. This ensures your integration correctly handles all possible status flows and edge cases.

risk-screening-rules
COMPLIANCE ENGINE

Step 2: Configuring Risk-Based Screening Rules

Define automated rules to flag and block high-risk transactions before they reach your on-ramp, balancing security with user experience.

Risk-based screening rules are the core logic of your compliance engine. They are if-then statements that automatically evaluate incoming user data against your risk policy. For example, a rule might state: IF a user's IP address originates from a sanctioned jurisdiction AND the transaction amount exceeds $1,000, THEN block the transaction and flag for manual review. These rules allow you to move beyond binary checks, applying stricter scrutiny only where the risk profile warrants it.

Effective rule configuration requires defining clear risk parameters. Common parameters include: transaction amount thresholds, geographic location (IP, document country), source of funds, wallet age and transaction history, and PEP (Politically Exposed Person) status. You should calibrate these thresholds based on your risk appetite and regulatory requirements. A service like Chainalysis KYT or Elliptic can provide the on-chain intelligence needed to assess wallet risk scores programmatically.

Here is a conceptual example of how a rule might be structured in a configuration file or via a provider's API dashboard:

yaml
rule_id: "high_risk_geo_block"
condition:
  all_of:
    - user.geo_country_code in ["CU", "IR", "KP", "SY"] # Sanctioned countries
    - transaction.amount_fiat > 5000
    - user.wallet_risk_score == "HIGH"
action: "BLOCK"
review_channel: "HIGH_PRIORITY_QUEUE"

This rule blocks any transaction over $5,000 from a high-risk wallet in a sanctioned country, escalating it immediately for analyst attention.

It's critical to implement a tiered review system. Not all flagged transactions should be outright blocked. Configure rules to route medium-risk cases (e.g., large first-time deposits) to a manual review queue, while auto-approving low-risk activity. This reduces friction for legitimate users. Continuously monitor the false positive rate of your rules; if too many good users are being blocked, adjust your thresholds to reduce friction while maintaining security.

Finally, document every rule, its purpose, and the regulatory requirement it addresses. This audit trail is essential for demonstrating your compliance program's effectiveness to regulators. Rules are not static; regularly review and update them based on new typologies, regulatory changes, and the evolving behavior of your user base to ensure your on-ramp remains both secure and competitive.

user-flow-design
KYC/AML INTEGRATION

Step 3: Designing the User Verification Flow

Implementing a secure and compliant identity verification process is a core requirement for integrating fiat on-ramps. This step defines the user journey from initiation to approval.

The verification flow begins when a user attempts a deposit exceeding the platform's anonymous transaction limit, typically around $1000 USD equivalent. Your application must intercept this action and redirect the user to the KYC provider. This is done by calling the provider's API to generate a unique verification session URL. For example, with a provider like Sumsub or Veriff, you would use their SDK or REST API to create an applicant and retrieve a one-time accessToken. The user is then redirected to this secure, hosted verification page.

On the provider's page, the user completes the required steps, which commonly include: - Submitting a government-issued ID (passport, driver's license) - Taking a live selfie for liveness detection - Providing proof of address (utility bill, bank statement). The provider's AI and manual review teams then analyze the documents for authenticity and check the user's details against global sanctions lists and PEP (Politically Exposed Person) databases. The entire process typically takes from a few seconds for automated checks to several hours for manual review.

Your backend must implement a webhook endpoint to receive the final verification result asynchronously. The KYC provider will send a POST request to your configured URL with a payload containing the applicant's ID and a reviewStatus (e.g., "completed", "pending", "rejected"). It is critical to validate the incoming webhook signature (using a shared secret) to ensure the request is authentic and has not been tampered with.

Upon receiving a "completed" status with an outcome of "GREEN" or "APPROVED", your system should update the user's internal status, often by setting a kyc_verified: true flag and storing the provider's unique applicant ID. You can then allow the suspended transaction to proceed or notify the user they may now initiate larger deposits. For "rejected" outcomes, your application should inform the user of the failed verification and provide instructions, which may include contacting support or re-applying.

A robust design also includes re-verification triggers. Regulatory requirements often mandate periodic checks. You should schedule jobs to flag users whose verification is older than a certain period (e.g., 1 year) or who have been added to a sanctions list since their last check. Triggering a new session for these users maintains ongoing compliance. Always log all verification attempts and outcomes for audit purposes.

Finally, consider the user experience. A clear progress indicator, transparent communication about data usage (linking to your Privacy Policy), and helpful support channels for stuck users reduce abandonment. The goal is a seamless flow that feels secure but not obstructive, balancing regulatory demands with user onboarding conversion.

data-security-audit
KYC/AML INTEGRATION

Step 4: Securing Data and Maintaining Audit Trails

Implementing a secure and compliant KYC/AML verification flow is a critical component for any regulated on-ramp. This step ensures user identity is verified while protecting sensitive data and creating immutable audit logs.

A robust KYC (Know Your Customer) and AML (Anti-Money Laundering) system for on-ramps involves several key components: identity document verification, liveness checks, sanction list screening, and risk scoring. Services like Sumsub, Jumio, or Onfido provide APIs that handle the complex verification logic, allowing you to integrate a verifyUser() function that submits user data and returns a verification status. The core technical challenge is designing a secure data flow where Personally Identifiable Information (PII) is transmitted via encrypted channels (HTTPS/TLS) and never stored on your application servers longer than necessary for processing.

For blockchain applications, it's crucial to maintain a cryptographically verifiable link between the off-chain KYC verification and the on-chain user address. A common pattern is to issue a verification credential or attestation upon successful KYC. This can be a signed message from your verification service's private key, stored in a decentralized identity protocol like Verifiable Credentials (VCs) or a non-transferable soulbound token (SBT). Your smart contract's deposit function can then require a valid, unexpired credential signature before allowing fiat-to-crypto conversions, enforcing compliance at the protocol level.

Maintaining a secure audit trail is non-negotiable for regulatory compliance. Every verification attempt—success or failure—along with the associated user ID (a hash, not raw PII), timestamp, risk score, and decision reason must be logged. These logs should be written to an immutable system. While a traditional database is used for querying, consider periodically committing hashes of these log batches to a public blockchain like Ethereum or a data availability layer. This creates a tamper-evident proof that your audit records have not been altered after the fact, which is valuable evidence for regulators and auditors.

Data retention and privacy are governed by regulations like GDPR and CCPA. You must define clear policies for how long you retain raw PII versus anonymized audit data. After the verification process, sensitive documents should be purged from your temporary storage, with only the verification result and a reference ID kept. All data in transit and at rest must be encrypted. For on-chain components, ensure that any emitted events or stored data do not accidentally leak PII; always use hashes (like keccak256(email)) or zero-knowledge proofs for on-chain references to private data.

ON-RAMP COMPLIANCE

Typical Verification Tier Specifications

Comparison of common KYC/AML verification levels used by on-ramp providers to balance user experience with regulatory requirements.

Verification FeatureTier 0 (Basic)Tier 1 (Standard)Tier 2 (Enhanced)

Daily Deposit Limit

$500

$5,000

$50,000+

Identity Verification

Proof of Address

Liveness Check (Biometric)

Source of Funds Check

PEP/Sanctions Screening

Basic List

Enhanced Monitoring

Continuous Monitoring

Average Processing Time

< 1 min

2-10 min

1-24 hours

Data Retention Period

30 days

5 years

7+ years

ON-RAMP INTEGRATION

KYC/AML Implementation FAQ

Common questions and solutions for developers integrating KYC/AML verification into crypto on-ramps. Covers compliance, technical implementation, and user experience.

KYC (Know Your Customer) and AML (Anti-Money Laundering) are distinct but interconnected compliance pillars for on-ramps.

KYC is the identity verification process. It involves collecting and verifying user data like government ID, proof of address, and a selfie. Its primary goal is to confirm the user is who they claim to be.

AML is the ongoing monitoring and analysis of user activity to detect and report suspicious financial behavior that could indicate money laundering or terrorist financing. AML checks typically run against:

  • Sanctions lists (OFAC, UN, EU)
  • PEP (Politically Exposed Person) databases
  • Adverse media and watchlists

While KYC is a one-time (or periodic) verification event, AML screening is continuous, often triggered by transaction size or frequency. A robust on-ramp must implement both to meet global regulatory standards like the Travel Rule (FATF Recommendation 16).