ERC-8106 Event-Based Compliance Framework for RWAs (RWA Event-based Compliance Framework)
Draft · Tokens · created 2025-12-16
A standard event scheme recording whether a counterparty in a real-world asset (RWA) token transfer is a regulated entity or a general participant, enabling compliance auditing without blocking transactions.
Why it is needed
ERC-20 alone provides no standard way to distinguish whether a transfer counterparty is a regulated entity (e.g., a corporate treasury or custody account) or a general participant, nor a unified event scheme to track only compliance-related transfers. Existing compliance token standards tend to forcibly revert transactions on a violation, which is difficult to reconcile with differing regulatory interpretations across jurisdictions and institutions, and requires a contract upgrade to change the rules, making it rigid. State-based enforcement logic also costs more gas than event logging.
What to implement
function entityTypeOf(address entity) external view returns (EntityType);: Queries the entity type (CE or DE) of an address. An address that has not been explicitly registered must return DECENTRALIZED_ENTITY.
In depth
Entity Classification Registry
Implementations MUST provide a registry that classifies addresses as DECENTRALIZED_ENTITY or COMPLIANCE_ENTITY. entityTypeOf MUST return DECENTRALIZED_ENTITY for any address not explicitly registered as COMPLIANCE_ENTITY. Only explicitly registered addresses SHOULD return COMPLIANCE_ENTITY. An EntityTypeUpdated event MUST be emitted whenever an entity type changes. reasonHash MUST point to offchain documentation such as a KYC record. operator MUST identify who authorized the change. The registry MAY be embedded within the token contract, implemented as a separate contract, or shared across multiple tokens.
ComplianceObserved Event Requirements
Implementations MUST emit a ComplianceObserved event containing information about compliance-related transfers. Each event MUST include all specified parameters (bizId, token, from, to, amount, fromType, toType, flag, policyTag). fromType and toType MUST reflect the actual entity types at the time of transfer. All legs of a multi-leg transfer forming a single business flow MUST use the same bizId. The token parameter MUST be the address of the relevant ERC-20 token contract.
Compliance Flag Types
ComplianceFlag is defined with four values: OK, DIRECT_DE_TO_CE, DIRECT_CE_TO_DE, and POLICY_CUSTOM. As a non-normative recommendation (SHOULD), use DIRECT_DE_TO_CE when fromType is DECENTRALIZED_ENTITY and toType is COMPLIANCE_ENTITY, and DIRECT_CE_TO_DE for the reverse direction. Transfers that do not cross a compliance boundary, such as DE-to-DE or CE-to-CE, use OK, and project-specific special cases use POLICY_CUSTOM.
Event-Based, No Forced Reverts
Implementations SHOULD NOT revert a transaction based solely on a compliance flag. Actions such as reverting transactions, freezing accounts, or regulatory reporting SHOULD be handled through separate mechanisms such as offchain monitoring systems, onchain governance modules, or dedicated compliance management contracts. The event-based approach allows for differing interpretations across jurisdictions, costs less gas than state-based enforcement (roughly 2000 gas per event), and also enables delayed enforcement such as a 24-hour review period.
Auditability Design
Auditors can query all ComplianceObserved events for a given bizId to construct a directed graph from from/to/amount, use the flag field to check for direct transfers between CE and DE, and cross-reference reasonHash against offchain KYC/AML systems. Every ComplianceObserved event must correspond to an actual ERC-20 balance change.
Implementation Patterns and Policy Tags
The registry can be embedded within the token contract (Embedded Registry) or implemented as a separate contract shared across multiple tokens (Separate Registry). It is recommended that policyTag use a fixed hash such as keccak256("PAYMENT") by convention to improve interoperability. As a reference example, the purchaseRWA pattern is presented, in which a single transaction routing a user payment through the treasury to the operating account emits a ComplianceObserved event for each leg grouped under the same bizId, though this pattern is not itself part of the standard.
Proposal status
This proposal is currently in Draft status and has not yet been finalized; its content may change or progress may stall.
Things to watch out for
- Event Integrity: A ComplianceObserved event must only be emitted after an actual ERC-20 balance change has occurred. Emitting the event without an actual transfer of value undermines auditability.