Lesson 04 · The Heart of the Mission

ERC-3643: How a Token Enforces Compliance

Take ERC-20's permissionless transfer and make non-compliant transfers architecturally impossible. This is the standard your team builds on — $28bn+ of tokenized assets run on it.

Why this is the keystone. Marketnode tokenizes funds, structured products, and credit — all regulated securities. ERC-3643 (a.k.a. the T-REX protocol) is the dominant standard for exactly this. If you understand its three-layer shape and the agent's powers, you can read your team's contracts, run the design review, and interview the engineers who write them. Everything in Lessons 1–3 was scaffolding for this.1

The one idea: a transfer must pass a checkpoint

Recall the toy registry: transfer checked only the balance. ERC-3643 keeps the ERC-20 interface (so all tooling still works) but inserts a two-part checkpoint before any tokens move:

// ERC-3643 transfer — conceptually
function transfer(address to, uint256 amount) public returns (bool) {
    require(!frozen[msg.sender] && !frozen[to], "wallet frozen");
    require(identityRegistry.isVerified(to), "receiver not an eligible identity");   // ① WHO
    require(compliance.canTransfer(msg.sender, to, amount), "breaks a rule");   // ② WHETHER
    // ...only now move the tokens (same as ERC-20)
}

Those two requires are the whole game. ① asks "is the receiver a verified, eligible holder?" ② asks "does this specific transfer break any rule right now?" If either fails, the transaction reverts (Lesson 2) — the transfer simply cannot happen. Compliance isn't checked by a back-office process after the fact; it's enforced by the token itself, atomically, on-chain.

The three layers

1 · The Token — "the asset + the agent's powers"

ERC-20-compatible, plus privileged operations a regulator demands: mint / burn, freeze, forced transfer, and recovery. These live on the token and are callable only by the agent (see below).

2 · Identity — "who is allowed to hold this" (the WHO)

The Identity Registry maps each wallet address to an ONCHAINID — an on-chain identity contract holding signed claims ("this person passed KYC", "is accredited", "is in Singapore"). A Trusted Issuers Registry says whose claims count (which KYC provider you trust); a Claim Topics Registry says which claims are required. isVerified(addr) returns true only if the address's identity has all required claims from trusted issuers.

3 · Compliance — "what rules apply to a transfer" (the WHETHER)

A modular contract holding pluggable rule modules: max holders, max balance per investor, country restrictions, lock-up periods, daily volume caps. canTransfer(...) runs every module; all must pass. New rule → new module, no token rewrite.

Memorise the split: Identity = WHO may hold. Compliance = WHETHER this transfer is allowed. Token = the asset and the powers to intervene. Nearly every ERC-3643 question decomposes into those three.

The agent's powers — where blockchain bows to regulation

This is the part that shocks people coming from permissionless crypto, and the part your regulators require. An agent (an accountable, named operator — at Marketnode, the transfer-agent function) can:

PowerWhy regulation needs it
Freeze (whole wallet or partial)Sanctions, court orders, suspected fraud, disputes.
Forced transferCourt-ordered reassignment; correcting an erroneous holding; estate succession.
RecoveryInvestor loses their private key → reissue their balance to a new verified wallet. The shares are not lost.
Mint / burnIssue new shares (subscription) or remove them (redemption).

This directly resolves the Lesson 1 tension — "a blockchain removes a trusted intermediary; regulation requires one." ERC-3643's answer: keep the shared, tamper-evident ledger, but grant a named, accountable agent the surgical powers law demands. Not trustless — accountable. Note the security flip side: whoever controls the agent key controls these powers → this is exactly the Fireblocks / custody question from our chat, and we'll dedicate a lesson to it.

Mapping to Marketnode roles

ERC-3643 conceptMarketnode / fund world
OwnerIssuer / platform — deploys the token, sets the rules and registries.
AgentTransfer agent / registrar — mint, burn, freeze, force-transfer, recover.
Identity Registry + ONCHAINIDThe KYC'd investor whitelist — only eligible investors may hold shares.
Trusted IssuersThe KYC/AML providers whose verification the fund accepts.
Compliance modulesOffering terms encoded: jurisdiction limits, investor caps, lock-ups.
Token holdersInvestors — but only ones the registry has verified.

Notice what's still off-chain: the legal KYC documents, the issuer's authority, the oracle feeding NAV. ERC-3643 puts the enforcement on-chain while the source of truth for identity and law stays off-chain — the recurring institutional pattern.

Retrieve it (don't peek)

From memory. Q3 interleaves Lessons 1 & 3.

1. In ERC-3643, what is the division of labour between the Identity layer and the Compliance layer?
2. An investor loses the private key to their wallet holding fund shares. Under ERC-3643, what happens?
3. Why can ERC-3643 keep the ERC-20 interface yet still block non-compliant transfers?

Primary source

The definitive read for your role — skim the architecture sections: ERC-3643 / T-REX Whitepaper (v4). For a quick orientation first, Chainalysis — Intro to ERC-3643. The source contracts live at github.com/ERC-3643 if you want to read real code.

I'm your teacher — ask me. Want to read the real T-REX transfer / canTransfer from GitHub line-by-line? Or build a set of ERC-3643 interview questions (with model answers) you can use when hiring? Or see how a compliance module is actually written? Just ask.