EIPs Explained

ERC-3643 · Final · ERC · 2021-07-09

ERC-3643: T-REX - Token for Regulated EXchanges

T-REX: an ERC-20-compatible permissioned token standard for securities, where every transfer checks the receiver's on-chain identity claims and the issuer's compliance rules, with agent powers to freeze, recover and force-transfer.

What problem does it solve?

Plain ERC-20 tokens are permissionless: anyone can hold them and send them anywhere. Tokenized securities such as shares, bonds or fund units cannot work that way. Securities law requires the issuer to know who holds the asset, restrict it to eligible investors (KYC/AML, accreditation, jurisdiction), enforce limits such as a maximum number of holders, and be able to recover tokens if an investor loses their key.

ERC-3643, known as T-REX (Token for Regulated EXchanges), standardises how to do this on-chain while keeping the familiar ERC-20 interface, so wallets and tools can still read balances and send transfers.

How it works

The standard is a set of cooperating contracts:

Contract Role
Token (IERC3643) ERC-20 plus pause, freeze, mint/burn, forced transfer, recovery and batch functions
Identity Registry Maps each wallet to an on-chain Identity contract and an ISO-3166 country code; exposes isVerified(address)
Identity Registry Storage The whitelist itself, which can be shared by several tokens' registries
Claim Topics Registry Which claim types (e.g. KYC) an investor must hold
Trusted Issuers Registry Which claim issuers' signatures are accepted
Compliance Offering-wide rules via canTransfer(from, to, amount), e.g. holder caps per country or max balance per investor

A transfer succeeds only if the token is not paused, neither wallet is frozen, the sender has enough free balance (balance minus frozen tokens), the receiver isVerified, and canTransfer returns true. Afterwards the token calls compliance.transferred(...) so stateful rules can update.

Roles follow ERC-173: the owner (issuer) configures the system and appoints agents via addAgent. Agents can mint, burn, freeze wallets or partial amounts, forcedTransfer, and recoveryAddress (move a lost wallet's tokens to a new wallet of the same identity). mint and forcedTransfer still require a verified receiver but skip compliance rules; burn skips all eligibility checks.

Sample code

Pre-checking whether a transfer would pass before sending it (ethers v6):

import { Contract } from "ethers";

const token = new Contract(tokenAddr, [
  "function identityRegistry() view returns (address)",
  "function compliance() view returns (address)",
  "function paused() view returns (bool)",
  "function isFrozen(address) view returns (bool)",
  "function getFrozenTokens(address) view returns (uint256)",
  "function balanceOf(address) view returns (uint256)",
], provider);

const registry = new Contract(await token.identityRegistry(),
  ["function isVerified(address) view returns (bool)"], provider);
const compliance = new Contract(await token.compliance(),
  ["function canTransfer(address,address,uint256) view returns (bool)"], provider);

const free = (await token.balanceOf(from)) - (await token.getFrozenTokens(from));
const ok =
  !(await token.paused()) &&
  !(await token.isFrozen(from)) && !(await token.isFrozen(to)) &&
  free >= amount &&
  (await registry.isVerified(to)) &&
  (await compliance.canTransfer(from, to, amount));

Things to know

  • Status: Final. The spec points to Tokeny's T-REX repository as the reference implementation.
  • Agents hold significant power (freeze, force transfer, recover). That is intentional for regulated assets, but holders must trust the issuer and its agents.
  • Generic DeFi contracts that expect free transferability will see transfers revert unless they are themselves registered as verified identities.
  • Identities and claims build on the ONCHAINID contracts (ERC-734/735-style key and claim holders) shipped in the EIP's assets folder.
  • Earlier security-token efforts include ERC-1400 and ERC-1462.
  • Compliance logic is only as good as the rules configured; whether a given setup satisfies a particular jurisdiction's law is a legal question, not something the standard guarantees.

#security-token #rwa #compliance #identity #erc20

Details

Authors
Joachim Lebrun (@Joachim-Lebrun), Tony Malghem (@TonyMalghem), Kevin Thizy (@Nakasar), Luc Falempin (@lfalempin), Adam Boudjemaa (@Aboudjem)
Status
Final
Type
Standards Track / ERC
Created
2021-07-09
Requires

Machine-readable: Markdown · JSON