Skip to main content
← Back to Learn

Building a Crypto Compliance Stack: KYT, Wallet Screening, and Transaction Monitoring

How to build a compliance stack using public APIs — KYT integration, wallet screening workflows, and transaction monitoring setup for OFAC and AML compliance.

If you operate a virtual asset service provider (VASP) — an exchange, a custodian, a payment processor, a DEX frontend with fiat off-ramps — you are subject to anti-money-laundering (AML) and sanctions obligations. The U.S. Treasury's Office of Foreign Assets Control (OFAC) made this explicit in its 2021 Sanctions Compliance Guidance for the Virtual Currency Industry: technology companies, administrators, exchangers, and wallet providers must develop a tailored, risk-based compliance program that includes sanctions list screening.

This article walks through how to build a compliance stack using publicly documented APIs. We cover three layers: wallet screening at onboarding, Know Your Transaction (KYT) for real-time transfer monitoring, and ongoing transaction monitoring with alerting. Every tool referenced here has public documentation. The integration patterns are generic.

The Regulatory Floor

Before writing any code, understand what regulators actually require. OFAC's framework identifies five essential components of a sanctions compliance program: management commitment, risk assessment, internal controls, testing and auditing, and training, and blockchain companies pursuing federal contracts should also complete SAM.gov registration.

For engineering teams, the relevant piece is internal controls — the technical mechanisms that screen counterparties, monitor transactions, and produce audit trails, often built on top of a wallet attribution pipeline. OFAC's FAQ 560 states that U.S. persons must block property of persons named on the Specially Designated Nationals (SDN) List and must not engage in transactions with blocked persons. OFAC also adds digital currency addresses to the SDN List, though these listings are explicitly "not likely to be exhaustive."

Two enforcement actions illustrate what happens when screening is inadequate. In 2022, OFAC settled with Bittrex for approximately 24millionandwithKrakenforapproximately24 million and with Kraken for approximately 362,000 (later increased). Both cases highlighted the same failure: screening customers only at onboarding, not continuously. OFAC expects lifetime-of-the-relationship screening, including in-process geolocational checks of IP addresses and physical addresses.

The SDN List and the Consolidated Sanctions List are available for public download in multiple data formats from OFAC's website. OFAC also provides a free Sanctions List Search tool. These are the baseline data sources. Commercial blockchain analytics tools layer entity attribution and heuristic clustering on top.

Layer 1: Wallet Screening at Onboarding

Wallet screening is the first gate. When a user provides a deposit address or requests a withdrawal, you screen that address against risk databases before allowing the transaction.

Three providers dominate this space, all with public API documentation:

  • Chainalysis Address Screening API — Returns categorized exposure (darknet markets, sanctions, scams, stolen funds) and a risk score for a given address. Base URL: https://api.chainalysis.com. Authentication is via API key.
  • TRM Labs — Screens wallet addresses against known risk indicators and entities in real time. Documentation at docs.trmlabs.com.
  • Elliptic AML API — Submits wallets or transactions for analysis, returns risk scores. Documentation at developers.elliptic.co. Supports both synchronous single-analysis and batch endpoints.

Generic Integration Pattern

The workflow is the same regardless of provider. Here is a generic pseudocode pattern:

function screenWallet(address, asset):
    response = POST to screening API:
        body: { address, asset, customer_reference }
        headers: { Authorization: API_KEY }
    
    risk_score = response.risk_score
    exposure_categories = response.exposure
    
    if risk_score > THRESHOLD:
        flagForReview(address, risk_score, exposure_categories)
        return "BLOCK"
    
    return "ALLOW"

For Chainalysis, the Address Screening API returns a risk score and categorized exposure. For Elliptic, the synchronous wallet analysis endpoint (POST /v2/analyses with type: "wallet_exposure") returns the result in the same request. Elliptic's documentation notes that synchronous analysis is recommended only for low volumes due to API rate limiting; high-volume operations should use the batch endpoint.

Screening at the Right Points

Screen at three points:

  1. Onboarding — When a user first registers a deposit address.
  2. Pre-transaction — Before processing each deposit or withdrawal.
  3. Periodic rescreening — On a schedule, because risk scores change. A wallet that was clean at onboarding may later be linked to a sanctioned entity.

Chainalysis does not charge for rescreens via API. Elliptic offers automatic rescreening where wallets are rescreened three times over a configurable timeframe, plus system rescreening for analyses that errored. Both providers support webhook alerting when a rescreen crosses your configured risk threshold.

Webhook Alerting

When a rescreen changes a wallet's risk status, you need to know immediately. Elliptic's alerting service sends HTTP POST messages to a URL you configure. The event body includes the event type (wallet.analysis.automaticrescreening.completed, for example), the risk score, the risk score change, and a URL to the analysis. Elliptic retries non-2xx responses with exponential backoff, starting at 2 minutes and capping at 1 hour, up to 10 retries.

Your webhook handler should:

  1. Validate the webhook signature using the provider's SDK.
  2. Parse the event and update the wallet's risk status in your database.
  3. If the new risk score exceeds your threshold, freeze the account or flag for manual review.
  4. Return a 200 response to stop retries.

Layer 2: KYT Integration for Real-Time Transfer Monitoring

Wallet screening tells you whether an address is risky. KYT tells you whether a specific transaction is risky. This distinction matters because a clean address can receive funds from a sanctioned source, and a risky address can send funds to a clean one.

KYT works by registering each transfer with the analytics provider. The provider traces the funds through the blockchain, identifies the source and destination entities, and returns a risk assessment.

Registering Transfers

Chainalysis KYT API uses a registerTransfer endpoint. The generic pattern:

function registerTransfer(userID, asset, transferReference, direction, amount):
    response = POST to KYT API:
        body: {
            userID,
            asset,
            transferReference: "${txHash}:${outputAddress}",
            direction: "received" | "sent",
            assetAmount: amount
        }
    
    transferId = response.transferId
    return transferId

The transferReference format combines the transaction hash and the output address. The direction field indicates whether the transfer is a deposit (received) or withdrawal (sent). Chainalysis processes valid transfers within approximately 30 seconds.

After registration, you poll for the transfer summary or wait for an alert. The KYT API provides a getTransferSummary endpoint that returns the risk assessment, and a getAllAlerts endpoint that returns all alerts in your organization.

Alert Handling

Alerts are the core output of KYT. When a registered transfer is flagged, the provider generates an alert with a severity level and a category (sanctions exposure, darknet market interaction, scam involvement, etc.).

Your alert handling workflow should:

  1. Fetch the alert via the API.
  2. Classify the severity against your risk policy.
  3. For high-severity alerts: freeze the funds, suspend the user, and escalate to the compliance team.
  4. For medium-severity alerts: flag for manual review within a defined SLA.
  5. For low-severity alerts: log and monitor.
  6. Update the alert status in the provider system with a comment documenting the action taken.

TRM Labs takes a rule-based approach to alerting. Their transaction monitoring product allows you to create multi-condition rules with inputs including transaction amounts, aggregation to a category, velocity, blockchain, and counterparty risk indicators. This lets you tune alerts to your organization's risk tolerance rather than accepting a one-size-fits-all threshold.

Daily Rescreening

Risk assessments are not static. A transaction that was clean yesterday may be flagged today if new entity attributions are published. TRM performs daily rescreening of transactions to catch these changes. Your stack should account for this: store the original risk assessment, but also check for updated assessments on a schedule.

Layer 3: Transaction Monitoring Configuration

Transaction monitoring goes beyond individual transfer screening. It looks at patterns of behavior across a user's transaction history.

Rule Configuration

TRM's transaction monitoring allows configurable rules with multiple conditions. A typical rule set might include:

  • Velocity rules — Flag users who make more than N transactions per hour.
  • Aggregation rules — Flag users whose total transaction volume in a 24-hour window exceeds a threshold.
  • Counterparty risk rules — Flag transactions where the counterparty has a risk score above a threshold.
  • Cross-chain rules — Flag users who move funds across multiple blockchains in a short window, a common money laundering pattern.

Each rule generates an alert when triggered. TRM provides case management within its platform: assign an owner, record notes, view transaction details and what triggered the alert, and follow a workflow through to closure.

Building Your Own Monitoring Layer

If you need custom monitoring beyond what the providers offer, you can build on top of their APIs. The pattern:

  1. Ingest — Pull transaction data from your internal systems and from the blockchain via public RPC endpoints or indexers.
  2. Enrich — For each transaction, call the screening API to get risk scores and entity attributions.
  3. Aggregate — Store enriched transaction data in a database (Postgres works fine for moderate volumes).
  4. Detect — Run rule queries against the aggregated data on a schedule.
  5. Alert — Generate alerts and route them to your case management system or Slack.

TRM's BLOCKINT API provides a single endpoint for blockchain intelligence at scale, returning balance, transaction volume, activity windows, and transaction history for addresses. This is useful for building a complete picture of how an address interacts on-chain.

OFAC-Specific Requirements

OFAC compliance has specific technical requirements that your stack must address:

SDN List Screening

The SDN List includes digital currency addresses for some designated persons. You must screen against these addresses. The list is available for download in CSV, XML, and other formats from OFAC's website. Update your local copy daily.

The 50 Percent Rule

OFAC's 50 Percent Rule states that any entity owned 50 percent or more in the aggregate, directly or indirectly, by one or more blocked persons is itself blocked, even if it is not separately listed on the SDN List. This is difficult to enforce technically for crypto addresses because ownership structures are opaque. Document your approach and your limitations.

Geolocation Screening

OFAC's enforcement actions against Bittrex and Kraken emphasized in-process geolocational checks. This means screening IP addresses and physical addresses at transaction time, not just at onboarding. Users who opened accounts from non-sanctioned locations but later changed their locations to sanctioned jurisdictions must be caught.

Implement geolocation screening by:

  1. Checking the user's IP address against a geolocation database at every transaction.
  2. Comparing the geolocation against your list of sanctioned jurisdictions.
  3. Blocking transactions from sanctioned jurisdictions.
  4. Flagging users whose geolocation has changed since onboarding for review.

Recordkeeping

OFAC requires records of all blocked and rejected transactions. Your stack must produce an audit trail that includes:

  • The transaction details (hash, amount, asset, addresses).
  • The screening result (risk score, exposure categories).
  • The action taken (blocked, rejected, allowed, escalated).
  • The timestamp.
  • The analyst who reviewed the alert (if manual review occurred).
  • The rationale for the decision.

Retain these records for at least five years.

Architecture: Putting It Together

A production compliance stack has these components:

  1. Screening service — A microservice that wraps the provider APIs (Chainalysis, TRM, or Elliptic). Exposes internal endpoints for wallet screening and transfer registration.
  2. Rules engine — Evaluates transaction monitoring rules against enriched data. Can be the provider's built-in rules or a custom engine.
  3. Alert queue — A message queue (e.g., RabbitMQ, SQS) that routes alerts to the appropriate handler.
  4. Case management — A system for compliance analysts to review alerts, add notes, and close cases. Can be the provider's UI or a custom system.
  5. Audit log — An append-only log of all screening decisions, stored for regulatory retention periods.
  6. Webhook receiver — An endpoint that receives rescreening alerts from providers and updates internal state.
  7. Geolocation service — Checks IP addresses against sanctioned jurisdiction lists at transaction time.

Failure Modes

Plan for these failure modes:

  • API downtime — If the screening API is down, do you block all transactions or allow them through with a flag? Most compliance programs choose to block. Implement a circuit breaker and a fallback queue.
  • Rate limiting — Elliptic's documentation explicitly notes rate limits on synchronous analysis. Use batch endpoints for high volumes. Implement exponential backoff.
  • False positives — Screening APIs will flag legitimate addresses. Your case management workflow must handle appeals efficiently.
  • Delayed alerts — A rescreening alert may arrive hours or days after the original transaction. Your system must handle retroactive freezes.

Choosing a Provider

All three providers — Chainalysis, TRM Labs, and Elliptic — offer similar core functionality, as compared in our blockchain compliance tools comparison. The differences are in coverage breadth, entity attribution quality, API ergonomics, and pricing.

  • Chainalysis — The most established provider. Strong entity attribution. The KYT API and Address Screening API are well-documented REST APIs. Good for exchanges and custodians.
  • TRM Labs — Strong transaction monitoring with configurable rules. Good case management UI. The BLOCKINT API provides a single endpoint for blockchain intelligence at scale.
  • Elliptic — Flexible API with both synchronous and batch endpoints. Strong rescreening and alerting. Good for teams that need custom workflows.

Many compliance programs use two providers, a strategy detailed in our blockchain compliance tools comparison for 2026. OFAC's enforcement actions have emphasized using "multiple blockchain analytics tools" to identify sanctioned actors. Running two providers in parallel and comparing results reduces false negatives.

Travel Rule Considerations

The FATF Travel Rule requires VASPs to exchange originator and beneficiary information for transactions above a threshold (typically USD 1,000). This is separate from KYT but interacts with it. Your compliance stack should include a Travel Rule messaging layer (e.g., the TRP standard from Sygna, or Notabene) that sits alongside your KYT integration.

Summary

Building a crypto compliance stack is an engineering problem with regulatory constraints. The core components are wallet screening, KYT transfer monitoring, transaction monitoring rules, alert handling, and audit logging. Public APIs from Chainalysis, TRM Labs, and Elliptic provide the risk intelligence layer. OFAC's requirements — SDN screening, the 50 Percent Rule, geolocation checks, and recordkeeping — define the compliance floor.

The stack is not a one-time build. Risk databases update daily. New entity attributions change historical assessments. Sanctions lists change. Your stack must handle continuous rescreening, retroactive alerts, and evolving rules. Build for change, and if your company is pursuing government contracts, ensure your SAM.gov registration is active alongside your compliance stack.

If you are building compliance infrastructure for a crypto-native product, Orkid is one project working in this space. But the tools and patterns described here are publicly available and applicable to any VASP or crypto business that needs to meet its compliance obligations.

Frequently Asked Questions

What is KYT?

KYT (Know Your Transaction) is a compliance methodology that screens blockchain transactions in real time to detect interactions with known illicit addresses such as sanctioned entities, darknet markets, or stolen-fund wallets. Unlike traditional KYC, which verifies the identity of a customer at onboarding, KYT monitors the flow of funds on-chain to assess the risk of each transaction. It uses labeled address databases and heuristic clustering to assign risk scores to incoming and outgoing transfers. KYT is a core component of crypto compliance for exchanges, custodians, and financial institutions handling digital assets.

What is transaction monitoring in crypto?

Transaction monitoring in crypto is the continuous surveillance of on-chain and off-chain transactions to detect suspicious activity such as structuring, layering, or transfers to high-risk jurisdictions. It extends traditional financial transaction monitoring to the blockchain domain by ingesting on-chain data, correlating it with customer records, and applying rule-based and anomaly-detection logic. The system generates alerts when transactions match risk patterns, which compliance teams investigate and disposition. Monitoring must cover both fiat on-off ramps and internal crypto-to-crypto transfers.

What is blockchain screening?

Blockchain screening is the process of checking addresses and transactions against databases of known illicit or high-risk entities to determine whether a transfer involves tainted funds. Screening services maintain continuously updated label sets covering sanctioned addresses, exchange hack proceeds, scam contracts, and other risk categories. When a counterparty address matches a labeled entity, the screening system flags the transaction with the associated risk category and severity. Screening is typically performed at deposit, withdrawal, and counterparty onboarding checkpoints.

What is a risk scoring engine?

A risk scoring engine is a system that assigns a quantitative risk score to an address, transaction, or customer based on weighted signals from multiple data sources. Inputs include screening matches, transaction graph analysis, exposure to flagged entities, behavioral anomalies, and customer risk factors. The engine applies configurable rules and models to combine these signals into a score that determines whether a transaction is approved, held for review, or blocked. Risk scoring engines must be tunable to reflect an institution's risk appetite and regulatory obligations.

What are FATF travel rule requirements?

The FATF travel rule requires virtual asset service providers to transmit originator and beneficiary information alongside virtual asset transfers, mirroring the correspondent banking requirements that apply to traditional wire transfers. For transactions above a threshold, the sending institution must share the sender's name, account number, and physical address or national identity number, and the receiving institution must store the beneficiary's corresponding information. The rule is designed to make crypto transfers traceable between regulated institutions and to prevent sanctioned or illicit actors from exploiting the pseudonymity of blockchain transfers. Implementation timelines and thresholds vary by jurisdiction.

Put it to work

The research above powers the product — try it or compare it: