On-chain vs Off-chain Boundaries for RWA Compliance

Hook (keep visible before “see more”)

In regulated tokenization, the hardest design decision is not the token standard.

It is drawing a hard line: what must live on-chain, and what must never leave the off-chain compliance stack.


1. Why this boundary decides whether your RWA is real

Real-world asset (RWA) programs fail in two opposite ways:

Failure A — Everything on-chain

Teams put PII, documents, workflow state, and “KYC JSON” into contract storage or events “for transparency.”

Consequences:

  • GDPR conflict: public, replicated, hard-to-erase personal data
  • Irreversible disclosure: you cannot recall a mainnet event
  • Wrong trust model: the ledger becomes a CRM with worse UX and worse legal posture

Failure B — Everything off-chain

The “token” is a row in Postgres with a wallet UI. Transfer rules live in PDFs and if-statements inside a private API.

Consequences:

  • No cryptographic enforcement: a compromised API can mint/move value
  • Weak audit story: “trust our logs” is not what public-chain investors buy
  • Regulated theater: compliance language without enforceable state

Permissioned RWA needs a third path:

Proofs on-chain. People off-chain. Enforcement in the token path.


2. A precise definition of the boundary

Question | On-chain answer | Off-chain answer

  1. Who may hold? Identity registry / verification flag | KYC case file, vendor results.
  2. What may move? `canTransfer` + modules | Product policy, fee quotes, UX.
  3. What is the balance? Token ledger | Portfolio projections, fiat mirrors.
  4. What is the person? Hash / reference only | Name, docs, address, tax IDs.
  5. What if RPC dies? State unchanged, txs queue | BFF retries, degraded reads.
  6. What if BFF dies? Rules still enforced on next tx | Onboarding pauses; chain still gates.

One sentence:

Off-chain decides and evidences. On-chain enforces and proves.

If your backend can silently bypass transfer rules, you do not have a compliance token — you have a trusted database with a wallet skin.


3. What belongs on-chain (checklist)

Put on-chain only what must be globally consistent, adversarial-resistant, and auditable without trusting a single app server:

  1. Eligibility state — wallet verified / revoked (not the passport)
  2. Transfer constraints — pause, caps, jurisdiction/suitability modules
  3. Token economics — balances, supply, settlement semantics
  4. Agent roles (SoD) — who may register identity, mint, pause, force-transfer
  5. Events — immutable operational breadcrumbs (IdentityRegistered, Transfer, Paused)

In an ERC-3643 / T-REX–style design, the chain answers:

“Is this wallet allowed to send or receive right now?”

It does not answer:

“What is this person’s full legal file?”


4. What belongs off-chain (checklist)

  1. KYC/AML documents and raw PII
  2. Case management, reject reasons, analyst notes
  3. Sessions, MFA, device posture
  4. Wallet binding to an application user
  5. Bank/CRM/document-store integrations
  6. Product UX states: pending / approved / rejected / chain-error
  7. Heavy analytics and portfolio charts

Store references and hashes. Drive human workflow. Only then call a privileged compliance path to register or revoke on-chain.


5. End-to-end flow (VaultGuard mental model)

  1. Investor signs up (BFF session + MFA)
  2. Binds wallet (wallet ↔ user integrity header)
  3. Submits KYC reference (document stays off-chain)
  4. Compliance reviews → approve/reject in issuer console
  5. On approve: compliance agent registers identity hash on-chain
  6. Token path: _update / transfer → registry + modular compliance
  7. Events → BFF audit trail + UI status + explorer link
sequenceDiagram
    actor Investor
    participant UI as Next.js
    participant BFF as Spring BFF
    participant KYC as KYC refs
    participant RPC as RPC/Anvil
    participant IR as IdentityRegistry
    participant TK as PermissionedToken
    Investor->>UI: sign up / KYC
    UI->>BFF: session + doc reference
    BFF->>KYC: store hash/ref (no raw PII on-chain)
    Note over BFF,IR: issuer approve
    BFF->>RPC: registerIdentity(hash)
    RPC->>IR: verified wallet
    Investor->>UI: subscribe / transfer
    UI->>RPC: signed tx
    RPC->>TK: transfer gated by canTransfer
    TK-->>BFF: events / receipt

6. Threats this boundary reduces (and what it does not)

Threat and Boundary effect:

  1. API compromised: Still cannot make unverified wallet receive if gates hold.
  2. PII breach on chain: Avoided if PII never written.
  3. Insider abuse: Reduced by SoD roles + timelock on upgrades.
  4. Key leak of one agent: Blast radius limited vs god-owner.
  5. Wrong human approval: Still possible — process risk remains off-chain.

Architecture reduces technical bypass. It does not replace legal authorization, vendor diligence, or key custody discipline.


7. Interview / diligence questions that expose a weak boundary

  1. Can an unverified wallet receive if the API is compromised?
  2. Can we delete or minimize PII without breaking the ledger?
  3. Who can pause, register identity, or force-transfer — are roles separated on-chain?
  4. What is reconstructible from chain events alone vs what requires the BFF?
  5. Is upgradeability justified, and who holds UPGRADER_ROLE (timelock)?

If answers are fuzzy, the architecture is fuzzy.


8. How VaultGuard RWA applies this

Public PoC (active development – Layer | Stack | Responsibility):

  1. On-chain: Solidity, Foundry, ERC-3643 / T-REX–style | Registry, modular compliance, token gates, SoD agents.
  2. Off-chain: Java Spring Boot BFF | KYC refs, session, wallet binding, issuer ops.
  3. Client: Next.js, Wagmi/Ethers, MetaMask, Vercel | Investor + issuer UX.

Rule of the house: no raw PII on-chain — hashes and registry proofs only.

This is the same instinct used for years in banking architecture: clear trust zones, least privilege, auditability — now expressed as EVM state + BFF workflows.

9. Closing

RWA compliance is not “add KYC to a token.”

It is architecture: a deliberate on-chain / off-chain boundary, enforced by code, reviewable by auditors, and respectful of data protection.

I build this in public while expanding from enterprise solution architecture into Solidity / EVM. If you work on tokenization, regulated DeFi, or Web3 solutions in the EU — let’s compare boundary diagrams.


Educational content — not legal advice. Regulatory authorization remains the issuer’s responsibility.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.