• SettleMintSettleMint
    • Introduction
    • Market pain points
    • Lifecycle platform approach
    • Platform capabilities
    • Use cases
    • Compliance & security
    • Glossary
    • Core component overview
    • Frontend layer
    • API layer
    • Blockchain layer
    • Data layer
    • Deployment layer
    • System architecture
    • Smart contracts
    • Application layer
    • Data & indexing
    • Integration & operations
    • Performance
    • Quality
      • Testing & quality gates
      • Security & validation
      • Compliance & certification
      • Compliance automation
      • Monitoring & disaster recovery
    • Getting started
    • Asset issuance
    • Platform operations
    • Troubleshooting
    • Development environment
    • Code structure
    • Smart contracts
    • API integration
    • Data model
    • Deployment & ops
    • Testing and QA
    • Developer FAQ
Back to the application
  1. Documentation
  2. Architecture
  3. Quality

Identity & compliance control plane - End-to-end verification architecture

The Asset Tokenization Kit implements a unified identity and compliance control plane that spans smart contracts, off-chain KYC workflows, and API enforcement layers. This architecture ensures that compliance rules defined once propagate consistently across all platform operations.

Problem

Traditional tokenization platforms separate identity verification (off-chain KYC systems), compliance rules (middleware databases), and transfer enforcement (smart contracts). This fragmentation creates synchronization gaps where:

  • KYC approvals in the admin panel don't automatically update on-chain permissions
  • Smart contract compliance checks can't access detailed verification documents
  • API-level transfer validation may differ from on-chain enforcement
  • Audit trails fragment across multiple systems with different timestamps

Solution

ATK's identity and compliance control plane unifies these concerns through:

  • OnchainID integration - Decentralized identity contracts store verifiable claims on-chain
  • Shared compliance modules - Smart contract rules reference the same identity registry as API procedures
  • Synchronized workflows - KYC approval in the dApp triggers on-chain claim issuance atomically
  • Unified audit trail - All compliance events (off-chain and on-chain) flow into a single event log

Key concepts

  • Identity registry: On-chain mapping of wallet addresses to identity contracts containing verifiable claims
  • Claim topics: Standardized claim types (KYC_VERIFIED, ACCREDITED_INVESTOR, COUNTRY) that compliance modules check
  • Compliance orchestration: Smart contract layer that evaluates multiple module rules before allowing transfers
  • ORPC enforcement: API middleware that pre-validates transactions against the same rules before submission
  • Registration states: The dApp surfaces Registered and Pending registration badges to mirror on-chain registration progress for each identity

Architecture layers

Rendering chart...

Layer responsibilities

LayerComponentsResponsibility
User interactiondApp UI, walletCollect KYC documents, initiate transfers
API layerORPC procedures, middlewarePre-validate compliance, manage KYC workflow state
Off-chain dataPostgreSQL databasesStore KYC documents, application status, user profiles
Smart contractsIdentity registry, compliance, tokensEnforce on-chain compliance rules, store verifiable claims
Compliance modulesPluggable rule contractsImplement specific compliance checks (country, limits, verification)

Identity verification flow

KYC application lifecycle

Rendering chart...

Key workflow characteristics

Atomic operations: KYC approval triggers multiple on-chain transactions within a single API call. If any step fails, the entire operation rolls back and the application remains in "pending" status.

Idempotent retries: If on-chain deployment succeeds but database update fails, retry logic detects existing identity contract and updates the database record without duplicating on-chain state.

Audit completeness: Every state transition (application submitted, under review, approved, identity deployed, claim issued) generates an audit log entry with timestamp, actor, and transaction hash.

Transfer compliance enforcement

Dual-layer validation

Every token transfer passes through two compliance checks:

Pre-flight validation (API layer): Before submitting a transaction, ORPC procedures query the compliance contract to check if the transfer would succeed. This prevents wasting gas on transactions that will revert.

On-chain enforcement (smart contract): The token contract's _beforeTokenTransfer hook calls the compliance contract, which evaluates all configured modules. If any module returns false, the transfer reverts.

Rendering chart...

Why dual validation matters

Gas efficiency: Pre-flight checks prevent users from spending gas on transfers that will fail on-chain compliance.

Better UX: Users receive immediate, detailed error messages ("Recipient not KYC verified" instead of generic "transfer failed").

Audit accuracy: Failed pre-flight checks still log to the audit database with reason codes, even though no on-chain transaction occurs.

Compliance module architecture

Pluggable module system

The compliance contract acts as an orchestrator that delegates checks to individual modules. Each module implements a standard interface:

interface IComplianceModule {
    function canTransfer(
        address token,
        address from,
        address to,
        uint256 amount,
        bytes calldata params
    ) external view returns (bool);

    function transferred(
        address from,
        address to,
        uint256 amount
    ) external;
}

Standard modules

ModulePurposeChecksState Updated
Identity verificationEnsure participants have valid OnchainID claimsReceiver has required claim topicsNo
Country allow/block listRestrict transfers by jurisdictionSender/receiver country claims against listsNo
Transfer limitsCap per-transaction or daily volumesAmount against configured limitsYes (daily counters)
Supply capsLimit total token supply or per-investor holdingsTotal supply or receiver balance against capsNo (read-only)
Time locksEnforce holding periodsCurrent time against token unlock timestampsNo

Module configuration

Modules are configured per-token through ORPC procedures:

// Add a country allow list module
await orpc.token.addComplianceModule.mutate({
  tokenAddress: "0x...",
  moduleAddress: "0xCountryAllowListModule",
  parameters: encodeAbiParameters(
    [{ type: "uint16[]", name: "allowedCountries" }],
    [[840, 276, 826]] // USA, Germany, UK
  ),
});

The same module contract instance can be shared across multiple tokens, each with different parameters.

Integration with external KYC providers

Provider adapter pattern

ATK supports integration with third-party KYC providers through a standardized adapter pattern:

Rendering chart...

Adapter responsibilities

Submit applications: Transform ATK KYC application data into provider-specific API format

Handle webhooks: Listen for provider status updates and sync to ATK database

Map verification levels: Convert provider verification tiers into ATK claim topics

Error handling: Retry failed API calls, handle rate limits, log provider errors

Audit trail architecture

Unified event log

All compliance-related events flow into a unified audit log stored in PostgreSQL:

Event TypeSourceData Captured
KYC application submittedORPCApplication ID, user ID, timestamp, document hashes
KYC status changedORPCApplication ID, from status, to status, reviewer ID, reason
Identity deployedSmart contract (indexed)Investor address, identity contract address, transaction hash
Claim addedSmart contract (indexed)Identity address, claim topic, issuer, expiry timestamp
Transfer attemptedORPCToken, from, to, amount, pre-flight result
Transfer completedSmart contract (indexed)Token, from, to, amount, transaction hash, block number
Compliance violationORPC or Smart contractToken, from, to, amount, violated rule, reason code

Query patterns

The audit log supports regulatory reporting queries:

  • "Show all transfers for token X in date range Y"
  • "List investors who failed KYC verification"
  • "Identify compliance violations by rule type"
  • "Generate monthly transaction volume report"

All queries execute against PostgreSQL with indexed columns for performance, avoiding expensive on-chain log scanning.

Security considerations

Claim issuer key management

The claim issuer private key has the authority to add claims to any OnchainID. Key security measures:

  • HSM storage: Private key stored in hardware security module, never in application code
  • Multi-signature approval: High-value claims (ACCREDITED_INVESTOR) require multiple issuer signatures
  • Key rotation: Claim issuer can be changed by governance, old claims remain valid until expiry
  • Audit logging: Every claim issuance logs to immutable audit trail with issuer identity

ORPC authorization

API procedures that modify identity or compliance state require specific roles:

  • GOVERNANCE_ROLE: Add/remove compliance modules, change identity registry
  • COMPLIANCE_OFFICER_ROLE: Approve/reject KYC applications, issue claims
  • EMERGENCY_ROLE: Freeze addresses, pause token operations

Identity operators without a connected wallet can still review entity identities; the dApp skips privileged token lookups when authentication falls back to identity permissions or when the identity record lacks an associated account.

Middleware validates roles before executing procedures, preventing unauthorized compliance changes.

Limitations

On-chain storage costs

Storing detailed KYC documents on-chain is prohibitively expensive. ATK stores only verifiable claim hashes on-chain (32 bytes), with full documents in off-chain storage.

Identity recovery complexity

If an investor loses wallet access, identity recovery requires:

  1. Identity registry manager initiates recovery to new wallet address
  2. Investor reclaims tokens using the custodian recovery mechanism
  3. All off-chain user accounts must be manually updated to associate with new wallet

This two-step process prevents unauthorized identity transfers but adds operational overhead.

Real-time claim expiry

Compliance modules check claim validity on every transfer, but expired claims remain in the identity contract until explicitly removed. This creates a window where transfers may succeed with expired claims if not removed promptly.

See also

  • Identity & compliance smart contracts - OnchainID and compliance module implementation details
  • Backend API - ORPC procedures for KYC workflow management
  • Database model - KYC application and audit log schemas
  • Compliance certification - Jurisdiction-specific compliance requirements and certification processes
Compliance & certification
Monitoring & disaster recovery
llms-full.txt

On this page

ProblemSolutionKey conceptsArchitecture layersLayer responsibilitiesIdentity verification flowKYC application lifecycleKey workflow characteristicsTransfer compliance enforcementDual-layer validationWhy dual validation mattersCompliance module architecturePluggable module systemStandard modulesModule configurationIntegration with external KYC providersProvider adapter patternAdapter responsibilitiesAudit trail architectureUnified event logQuery patternsSecurity considerationsClaim issuer key managementORPC authorizationLimitationsOn-chain storage costsIdentity recovery complexityReal-time claim expirySee also