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 a KYC/AML Integration for Security Tokens

A developer-focused tutorial on integrating third-party KYC and AML verification services into a security token issuance workflow. Includes API patterns, data handling for accreditation, and linking verified identity to blockchain addresses.
Chainscore © 2026
introduction
IMPLEMENTATION GUIDE

Setting Up a KYC/AML Integration for Security Tokens

A technical walkthrough for developers integrating KYC/AML verification into a security token offering (STO) pipeline.

Security Token Offerings (STOs) operate under strict regulatory frameworks that mandate investor verification. Unlike utility tokens, security tokens represent regulated financial instruments, making Know Your Customer (KYC) and Anti-Money Laundering (AML) checks a legal prerequisite for issuance and secondary trading. A robust integration automates this compliance layer, screening investors against sanctions lists, verifying identity documents, and assessing risk before allowing token purchase or transfer. Failure to implement this can result in severe penalties and token de-listing from regulated exchanges.

The integration architecture typically involves a compliance API gateway sitting between your application and specialized third-party KYC/AML providers like Jumio, Sumsub, or Onfido. When a user initiates onboarding, your smart contract or backend should redirect them to the provider's verification flow. This flow collects identity data (e.g., government ID, proof of address, liveness check) and returns a verification status and a unique user hash. This hash is the critical piece of data you will store on-chain or in your database to prove compliance.

For on-chain enforcement, you must modify your security token's smart contract logic. The most common pattern is to override the ERC-20 transfer and transferFrom functions in your token contract (or use the ERC-1400 standard for security tokens) to include a modifier that checks a registry. For example, you could implement a Registry contract that maps user addresses to their KYC status. A transfer would then revert unless both the sender and receiver are verified.

solidity
modifier onlyVerified(address _user) {
    require(registry.isVerified(_user), "KYC: User not verified");
    _;
}

function transfer(address to, uint256 amount) public override onlyVerified(msg.sender) onlyVerified(to) returns (bool) {
    return super.transfer(to, amount);
}

Key technical decisions involve choosing between on-chain and off-chain status storage. Storing status fully on-chain (like in the example above) provides maximum transparency and enforcement but incurs gas costs for updates. A hybrid approach stores only a cryptographic proof (like a Merkle tree root) on-chain, with the provider's API serving detailed reports off-chain. You must also plan for re-verification schedules, as KYC statuses expire. Your system needs cron jobs or event listeners to flag users for periodic re-screening, often managed through the provider's webhook notifications.

Finally, integrate the provider's webhooks to receive real-time updates on verification results and screening alerts. When a user's risk profile changes (e.g., they appear on a new sanctions list), the provider sends a POST request to your configured endpoint. Your backend must process this, update the user's status in your registry, and potentially trigger an on-chain transaction to freeze the associated tokens. Documenting this entire process—data flow, audit trails, and privacy measures—is essential for passing regulatory audits from bodies like the SEC or FINMA.

prerequisites
PREREQUISITES AND SETUP

Setting Up a KYC/AML Integration for Security Tokens

This guide outlines the technical and regulatory prerequisites for integrating Know Your Customer (KYC) and Anti-Money Laundering (AML) verification into a security token issuance platform.

Before writing any code, you must establish the legal and compliance framework. Security tokens represent regulated financial instruments, and the specific KYC/AML requirements depend on the jurisdiction of issuance (e.g., SEC Regulation D in the US, MiFID II in the EU) and the investor type (accredited vs. retail). You must engage legal counsel to define your investor accreditation criteria, geographic restrictions, and the required verification data points. This legal wrapper dictates the technical implementation, as your smart contracts must enforce these rules on-chain.

The core technical prerequisite is selecting and integrating with a KYC/AML provider API. Providers like Jumio, Sumsub, or Onfido offer services for identity document verification, liveness checks, and screening against global watchlists (PEPs, sanctions). You will need to create an account, obtain API keys, and understand their webhook system for asynchronous verification results. Your backend service must handle the secure transmission of user data, manage API call limits, and process the verification status (e.g., approved, rejected, pending) returned by the provider.

Your system architecture must separate sensitive Personally Identifiable Information (PII) from the blockchain. A typical flow involves: 1) A user submits KYC data via your frontend, 2) Your backend sends this data to the provider's API, 3) Upon receiving a verified webhook, your backend issues a verification credential (e.g., a signed message or a Merkle proof) to the user's wallet address. Only this proof, not the PII, is used on-chain. This design aligns with data privacy regulations like GDPR and ensures the blockchain acts as a verification ledger, not a data store.

For the on-chain component, you need a smart contract that gates access to token minting or transfer functions based on verified status. A common pattern is a registry contract that maps address => status. Your minting contract would then include a modifier like onlyVerifiedInvestor. For more complex rules (e.g., tiered investment limits based on jurisdiction), you may store a proof hash or use zero-knowledge proofs (ZKPs) to validate compliance without exposing the underlying data. Libraries like OpenZeppelin's AccessControl can form the basis for this gating mechanism.

Finally, set up a robust testing environment. Use the sandbox or staging API provided by your KYC vendor to simulate various verification scenarios (approval, document rejection, PEP flag). Develop comprehensive unit tests for your smart contract's access controls and integration tests for the full backend flow. Consider edge cases like revocation: your system must handle a scenario where a previously verified investor is later flagged, requiring a mechanism to freeze or burn their tokens on-chain to maintain continuous compliance.

key-concepts
DEVELOPER GUIDE

Core KYC/AML Integration Concepts

Essential technical components for integrating investor verification and compliance into security token platforms.

03

Accredited Investor Verification

Verify investor eligibility for private security offerings under regulations like Regulation D (506c). This requires:

  • Income/Net Worth Proof: Collect and review bank statements, tax returns, or third-party attestation letters.
  • Third-Party Verification Services: Use providers like Accredify or VerifyInvestor who confirm status and issue a verifiable attestation.
  • On-Chain Attestation: Store a proof of accreditation, such as a signed Verifiable Credential or a hash of the attestation document, on-chain (e.g., using Ethereum Attestation Service) to enable compliant DEX trading.
>200k
Accredited Investors Verified (US)
04

Jurisdictional Compliance & Whitelisting

Enforce investment restrictions based on investor geography (jurisdiction gating). Implementation involves:

  • IP & Document Analysis: Determine investor location from KYC documents and connection metadata.
  • Smart Contract Logic: Embed allow/deny lists in the token's transfer functions. For example, a modifier that checks an on-chain registry before allowing a transfer.
  • Dynamic Updates: Maintain an off-chain admin dashboard to update restricted jurisdictions, with changes reflected in contract state via a secure multisig or DAO vote.

This is critical for adhering to regulations like the EU's MiCA or specific country-level security laws.

architecture-overview
SYSTEM ARCHITECTURE AND DATA FLOW

Setting Up a KYC/AML Integration for Security Tokens

A technical guide to designing and implementing a compliant identity verification pipeline for blockchain-based securities.

A compliant security token platform requires a robust Know Your Customer (KYC) and Anti-Money Laundering (AML) integration. This system acts as a gatekeeper, verifying investor identity and screening for illicit activity before allowing participation in regulated offerings. The architecture must be non-custodial and privacy-preserving, meaning the platform should not store sensitive personal data on-chain. Instead, it relies on a trusted, accredited third-party verification provider. The core data flow involves submitting investor information, receiving a verification status, and recording only a cryptographic proof of that status—such as a verifiable credential or a signed attestation—on the blockchain.

The technical workflow begins when a user initiates onboarding through the platform's frontend. User-provided data—name, address, date of birth, government ID—is encrypted and transmitted via a secure API to the chosen KYC/AML provider (e.g., Jumio, Sumsub, Onfido). The provider performs checks against official databases and watchlists. Upon successful verification, the provider's backend service issues a cryptographic attestation. This is a signed message containing a unique user identifier (like a hash of their wallet address) and the verification result, often with an expiry timestamp. This attestation is sent back to your application server.

Your backend must then facilitate the on-chain record. A common pattern is to call a function on your security token's smart contract, passing the signed attestation as a parameter. The contract verifies the signature against a known public key of the KYC provider (pre-registered in the contract) and, if valid, stores the user's address in a whitelist mapping: mapping(address => bool) public isWhitelisted;. Subsequent token transfer functions will include a modifier like onlyWhitelisted that checks this mapping, enforcing compliance. For modularity, this logic is often separated into a dedicated KYC Registry Contract that multiple token contracts can reference.

Key architectural considerations include data privacy, gas optimization, and revocation. Never store raw PII on-chain. Using attestations or zero-knowledge proofs (ZKPs) like zkKYC solutions can enhance privacy. To save gas, consider storing attestations off-chain (e.g., on IPFS or a centralized server with a hash on-chain) and having the contract validate Merkle proofs. The system must also handle expirations and revocations; the KYC provider can issue a revocation attestation, prompting your backend to trigger a contract function that updates the user's whitelist status to false.

For developers, integration involves both off-chain and on-chain components. Your backend needs secure API client libraries for your KYC vendor and logic to handle webhooks for status updates. On-chain, you'll deploy and manage the verification contract. A basic whitelist modifier in Solidity looks like this:

solidity
modifier onlyWhitelisted() {
    require(kycRegistry.isWhitelisted(msg.sender), "Not KYC verified");
    _;
}

Testing is critical: simulate the full flow with provider sandboxes and use testnets to validate contract logic before mainnet deployment.

api-integration-walkthrough
STEP-BY-STEP API INTEGRATION

Setting Up a KYC/AML Integration for Security Tokens

A practical guide to programmatically verifying investor identity and compliance for tokenized securities using modern API-first solutions.

Integrating Know Your Customer (KYC) and Anti-Money Laundering (AML) checks is a non-negotiable requirement for issuing and trading security tokens. Unlike utility tokens, these digital assets represent regulated financial instruments like equity, debt, or funds. A robust API integration automates the collection, verification, and ongoing monitoring of investor data, ensuring compliance with regulations such as the SEC's Regulation D or the EU's MiCA. This process typically involves verifying government-issued IDs, screening against global sanctions lists (OFAC, UN), and assessing political exposure (PEP).

The technical workflow begins by selecting a compliance provider with a developer-friendly REST API, such as Chainalysis KYT, Elliptic, or Sumsub. Your application's backend will initiate the flow by calling an endpoint like POST /v1/verification/sessions to create a new verification session for an end-user. The API response will contain a unique URL or token you redirect the investor to, where they can upload their documents (passport, driver's license) and complete a liveness check via webcam. This delegated UI approach offloads the complex collection and biometric verification to the specialized provider.

Once the user submits their information, the provider's backend performs the checks. Your system must implement a webhook handler to receive the result asynchronously. A typical webhook payload will include a status field (e.g., "approved", "pending", "rejected"), a unique verificationId, and a detailed breakdown of the checks performed. It is critical to design your handler to be idempotent and secure; verify the webhook signature using a shared secret to ensure the request originates from your trusted provider.

For ongoing compliance, you must leverage transaction monitoring APIs. When an investor initiates a transfer of security tokens, your smart contract's transfer function should first query your backend. Your service should then call the compliance provider's API (e.g., POST /v1/screening/address) to screen the recipient's blockchain address against real-time risk databases. Only upon receiving a "clear" risk score should your backend authorize the on-chain transaction, creating a compliant and auditable trail. This pattern prevents transfers to sanctioned addresses.

Here is a simplified Node.js example for initiating a verification session using the Sumsub API:

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

async function createApplicant(externalUserId) {
  const url = 'https://api.sumsub.com/resources/applicants'; 
  const ts = Math.floor(Date.now() / 1000);
  const signature = crypto.createHmac('sha256', process.env.SUMSUB_SECRET)
                         .update(ts + 'POST' + '/resources/applicants')
                         .digest('hex');

  const config = {
    headers: {
      'X-App-Token': process.env.SUMSUB_APP_TOKEN,
      'X-App-Access-Sig': signature,
      'X-App-Access-Ts': ts
    }
  };

  const data = { externalUserId: externalUserId };
  const response = await axios.post(url, data, config);
  return response.data; // Contains applicantId and inspectionId
}

Finally, maintain a secure audit log. Record every API call, webhook receipt, and screening result in an immutable ledger or database, linking them to the on-chain transaction hashes. This log is essential for regulatory examinations. Regularly review your integration's performance and stay updated with your provider's API changelog, as regulatory lists and required checks evolve. A well-architected KYC/AML integration is not just a compliance checkbox but a foundational component that enables the secure, scalable growth of your security token platform.

KEY CONSIDERATIONS

KYC/AML Provider Feature Comparison

A technical comparison of major providers for integrating KYC/AML verification into security token platforms.

Feature / MetricJumioOnfidoSumsub

Document Verification

Liveness & Biometric Check

Global Watchlist Screening

Adverse Media Screening

PEP & Sanctions Lists

200+

180+

210+

API Latency (p95)

< 2 sec

< 3 sec

< 1.5 sec

SDK Customization

High

Medium

High

Regulatory Compliance

FATF, 5AMLD, GDPR

GDPR, SOC 2

FATF, 6AMLD, GDPR

Pricing Model (per check)

$1.50 - $3.00

$2.00 - $4.00

$1.00 - $2.50

Blockchain Address Screening

on-chain-linkage
SECURITY TOKEN COMPLIANCE

Linking Verification to On-Chain Identity

A technical guide to integrating KYC/AML verification with on-chain identity for compliant security token issuance and transfer.

Security tokens represent ownership in real-world assets like equity or real estate, making them subject to regulatory compliance. Unlike utility tokens, their transferability is restricted to verified, non-sanctioned individuals. This requires a trustless link between a user's off-chain identity verification (KYC/AML) and their on-chain wallet address. The core challenge is proving a user is verified without exposing their private personal data on the public blockchain. Solutions typically involve a verifiable credential or a signed attestation from a trusted verifier, which is then associated with the user's public address.

The technical architecture involves three main components: an Identity Verifier, a Registry/Attestation Contract, and the Security Token Contract. The verifier (a licensed KYC provider) performs checks and issues a proof. This proof, often a signed message or a Soulbound Token (SBT), is stored in a registry smart contract that maps address => verification status. The security token's transfer function then queries this registry before allowing a transaction. For example, a modifier in a Solidity contract might look like:

solidity
modifier onlyVerified(address _to) {
    require(verificationRegistry.isVerified(_to), "Recipient not KYC'd");
    _;
}

Implementing this requires choosing a verification standard. The ERC-3643 (T-REX) standard is a complete framework for permissioned tokens with on-chain identity. Alternatively, you can build a custom solution using EIP-712 for signed typed data, where the verifier signs a structured message containing the user's address and a expiry timestamp. The user submits this signature to the registry contract to register their status. It's critical to include expiry logic and revocation functions so the verifier can invalidate credentials if a user's status changes or sanctions are applied.

Key considerations for developers include privacy, gas costs, and decentralization. Storing only a proof hash or status flag on-chain preserves privacy. However, recurring verification renewals can lead to gas fees for users. Some projects use zero-knowledge proofs (ZKPs) to allow users to prove they are in a verified group without revealing who issued the credential. Always ensure your verifier is a legally recognized entity and that the system logic enforces transfer restrictions at the smart contract level, as this is the primary regulatory requirement for security tokens.

To test your integration, use a testnet with mock verifier contracts. Tools like OpenZeppelin's ERC1404 (a simpler restricted token standard) can be a starting point for logic. The final system should provide a seamless flow: user completes KYC with provider, receives a cryptographic proof, submits proof to blockchain registry, and can then freely interact with the security token within the bounds of your compliance rules. This creates a compliant, programmable financial instrument fully native to the blockchain ecosystem.

data-security-audit
DATA SECURITY AND AUDIT TRAIL

Setting Up a KYC/AML Integration for Security Tokens

A technical guide to implementing compliant identity verification and transaction monitoring for on-chain securities.

Integrating Know Your Customer (KYC) and Anti-Money Laundering (AML) checks is a non-negotiable requirement for issuing and managing security tokens on a blockchain. Unlike utility tokens, security tokens represent regulated financial instruments like equity or debt. A robust integration ensures only verified, non-sanctioned investors can participate, creating a legally defensible audit trail of compliance. This process typically involves connecting your smart contract or dApp frontend to a specialized, accredited third-party provider via their API.

The technical flow begins when a user attempts to interact with your token's restricted functions, such as purchasing during a Security Token Offering (STO) or transferring ownership. Your application should redirect the user to the KYC provider's hosted verification portal or use an embedded SDK. The user submits identity documents (passport, driver's license) and, for corporate investors, proof of incorporation and beneficial ownership. The provider performs checks against global watchlists (OFAC, UN, EU), PEP databases, and uses liveness detection to prevent fraud.

Upon successful verification, the provider returns a cryptographically signed attestation. This is the core of your on-chain audit trail. A common pattern is for the provider to sign a message containing the investor's whitelisted blockchain address and a unique user ID. Your smart contract's mint or transfer functions must then verify this signature against the provider's known public key before allowing the transaction. Store only the minimal necessary data on-chain, like the user ID and verification timestamp, to preserve privacy.

For ongoing AML monitoring, you must screen transactions against sanctions lists and suspicious patterns. This is often handled off-chain by your provider, who can alert you to newly sanctioned addresses or anomalous activity. Some advanced implementations use zero-knowledge proofs (ZKPs) to allow users to prove they are whitelisted without revealing their identity on-chain. However, most regulated deployments today rely on the signed attestation model for its auditability and relative simplicity.

Key technical considerations include gas optimization for signature verification, managing the whitelist state efficiently (using mappings), and implementing a secure upgrade path for the signer public key. Always use established, audit-tested libraries like OpenZeppelin for signature recovery (e.g., ECDSA.recover). Your off-chain backend must securely manage API keys and webhooks from the KYC provider to sync the on-chain whitelist, ensuring the system's state is consistent and tamper-evident.

DEVELOPER GUIDE

Frequently Asked Questions (FAQ)

Common technical questions and solutions for integrating KYC/AML into security token platforms. This guide addresses protocol-level challenges, smart contract patterns, and compliance automation.

On-chain verification stores proof of a user's KYC status directly on the blockchain, often as a signed attestation from a trusted provider (e.g., using EIP-712 signatures). This allows smart contracts to permission actions like token transfers based on a verifiable credential. The trade-off is potential privacy leakage.

Off-chain verification keeps sensitive PII (Personally Identifiable Information) in a compliant, centralized database. The blockchain interaction is typically a whitelist of approved wallet addresses managed by an admin key or a multi-sig. This is more private but introduces a central point of control and potential latency.

Most production systems use a hybrid model: off-chain verification with on-chain permissioning via a secure, upgradeable whitelist contract or a zero-knowledge proof attestation to preserve privacy.

conclusion-next-steps
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

This guide has walked through the core technical and compliance steps for integrating a KYC/AML framework into a security token platform. The next phase involves operationalizing these components.

Successfully implementing a KYC/AML system is not a one-time event but an ongoing operational commitment. Your integration, likely built with a provider like Jumio, Sumsub, or Onfido via their API, must be actively managed. This includes monitoring for failed verifications, handling manual review queues for edge cases, and ensuring your Sanctions and PEP screening lists are updated in real-time. Establish clear internal procedures for escalating high-risk flags identified by your chosen provider's risk engine.

The next critical step is integrating this verified identity data with your on-chain operations. For ERC-1400 or other security token standards, this typically means linking a user's verified address to their compliance status in an on-chain registry or within your platform's off-chain database. Permissioned functions, such as token transfers executed via require(registry.isPermitted(to), "Recipient not KYC'd") in your smart contract, depend on this link being accurate and current. Regularly audit this mapping to prevent discrepancies.

To maintain compliance, you must schedule periodic re-screening of existing users, a process often called ongoing monitoring. Regulatory expectations vary, but annual re-verification is a common baseline. Automate this process through your provider's API to check for new adverse media or changes in sanction status. Furthermore, ensure your system maintains a detailed, tamper-evident audit log of all KYC checks, decisions, and administrator actions to satisfy regulatory examinations.

Finally, consider the broader architecture. A robust security token platform extends beyond KYC/AML. You should evaluate integrations for accredited investor verification (using providers like Parallel Markets), tax compliance (e.g., tax form collection), and corporate action management (dividends, voting). Each layer adds complexity but is essential for a fully compliant, institutional-grade platform. Start by prioritizing requirements based on your target jurisdictions and investor types.