ERC-8461 Agent loan default registry (Agent Default Registry)
Draft · Vaults & DeFi · created 2026-10-20
Lets lending institutions record on-chain the defaults on loans they made to ERC-721 identities, and lets anyone look up open/cured/provisional default counts by identity or by owner, based on a set of trusted reporters.
Why it is needed
The fact that a loan was not repaid is the strongest signal a lender can have, but today it stays with that one lender. An agent that defaulted with one lender can borrow again from another, and an owner whose agent defaulted can borrow again through another identity. Reputation systems that average scores or keep only the single most recent rating per issuer cannot answer the question a lender asks before lending: according to the reporters I trust, how many times has this identity or this owner failed to repay? Moreover, since the lender must read this answer within the transaction that opens the loan, it has to be a fixed-cost contract read, not something requiring downloading and parsing a file.
What to implement
event DefaultRecorded(uint256 indexed recordId, address indexed reporter, uint256 indexed agentId, address primary, address owner, address asset, uint256 principal, bytes32 loanRef);: Emitted when a new default record is created, announcing the record id, reporter, identity, primary, owner at the time, asset, principal, and loan reference.event DefaultCureRecorded(uint256 indexed recordId, address indexed reporter, uint256 recovered);: Emitted when a default is cured, announcing the amount recovered.event DefaultVoided(uint256 indexed recordId, address indexed by);: Emitted when a record is voided, announcing who voided it.event PrimaryProposed(address indexed reporter, address indexed primary);: Emitted when a reporter proposes a specific address as its primary.event PrimarySet(address indexed reporter, address indexed primary);: Emitted when a reporter's primary is actually confirmed.function identityRegistry() external view returns (address);: Returns the address of the ERC-721 identity registry that agentId points to.function voidWindow() external view returns (uint64);: Returns the allowed time (in seconds) after recordedAt during which a record can be voided.function primaryOf(address reporter) external view returns (address);: Returns the primary address under which that reporter's new records are stored.function setPrimary(address primary) external;: Proposes another address as one's own primary, or specifying the zero address or oneself immediately reverts the caller's own primary to themselves.function acceptPrimary(address reporter) external;: When that reporter has proposed itself as a primary, accepts that proposal.function dropReporter(address reporter) external;: Lets a primary detach one of its member reporter addresses, reverting that address's primary back to itself.function recordDefault(uint256 agentId, address owner, address asset, uint256 principal, bytes32 loanRef) external returns (uint256 recordId);: Creates a new default record by entering the identity, the owner at loan time, the asset, the principal, and the loan reference.function recordCure(uint256 recordId, uint256 recovered) external;: Marks that default record as cured by recording a recovered amount against it.function voidRecord(uint256 recordId) external;: Voids a wrongly recorded default within the void window.function getRecord(uint256 recordId) external view returns (DefaultRecord memory);: Returns the full contents of a specific default record.function agentDefaults(uint256 agentId, address[] calldata trustedPrimaries) external view returns (uint256 open, uint256 cured, uint256 provisional);: Returns the open/cured/provisional default counts for that identity, based on a given list of primaries.function ownerDefaults(address owner, address[] calldata trustedPrimaries) external view returns (uint256 open, uint256 cured, uint256 provisional);: Returns the open/cured/provisional default counts for that owner address, based on a given list of primaries.function recordsOfAgent(uint256 agentId, uint256 start, uint256 limit) external view returns (uint256[] memory);: Returns the default record ids for that identity, paginated.function recordsOfOwner(address owner, uint256 start, uint256 limit) external view returns (uint256[] memory);: Returns the default record ids for that owner address, paginated.
In depth
Reporters and primaries
A lender may report from multiple addresses (its own contract, a servicer, and so on), and if it designates one of them as primary, readers group the records under that primary's name. Calling setPrimary to propose another address only emits PrimaryProposed and does not take effect immediately; it is confirmed and emits PrimarySet only once that address calls acceptPrimary. Specifying the zero address or oneself makes one immediately one's own primary. Primary resolution applies only one level, so a primary's own primary is not followed further. Records already made keep the primary stored at that time, and are not moved even if the link changes later. When a primary uses dropReporter to detach one of its member addresses, that address becomes its own primary again.
The contents and constraints of recording (recordDefault)
Anyone can call recordDefault; the caller becomes the reporter, and primaryOf(caller) at that moment becomes the record's primary. It reverts if owner is the zero address, if principal is zero, or if loanRef is zero, and it reverts if a not-yet-voided record already exists with the same loanRef under the same primary. It does not revert regardless of the value of agentId or asset, and the identity need not exist in identityRegistry() at that moment. owner must be the address that was the owner of that identity at the time the loan was executed, not the current owner. Readers can verify this by cross-checking the lender's own records against the identity registry's Transfer logs.
Recommended construction of loanRef
loanRef is a reference value by which the reporter points to a loan, and is recommended to be constructed as keccak256(abi.encode(chainId, lendingContract, loanId)). Here chainId (uint256) is the chain the lending contract is on, lendingContract (address) is the contract that executed the loan, and loanId (uint256) is the loan identifier used by that contract. This way, recording the same loan from any of the lender's addresses produces the same reference value, and readers can locate the loan's own logs. Putting personal information into loanRef is prohibited.
Cure and void
recordCure can only be called by that record's reporter or its primary, and reverts if the record does not exist or has already been cured or voided. On the call it sets curedAt to the block timestamp and records recovered, which may be zero or may exceed principal. voidRecord can likewise only be called by the reporter or its primary, and only while recordedAt plus voidWindow has not yet elapsed (recommended range of 1 to 7 days); it reverts for records that have been cured, already voided, or whose window has passed. Once voided, the record itself remains but is excluded from aggregation, and the same loanRef can be reused under the same primary.
Aggregation: open, cured, provisional
agentDefaults and ownerDefaults aggregate only non-voided records stored under primaries included in the supplied trustedPrimaries list. A record that has not been cured and whose recordedAt+voidWindow() has not yet elapsed is provisional; one that has not been cured and whose window has passed is open; a cured record is cured. Duplicate addresses in the list are counted only once, and records from addresses not in the list are not counted at all, nor do they cost anything.
List lookups and pagination
recordsOfAgent and recordsOfOwner return up to limit ids starting from position start, in recorded order, returning an empty list if start is past the end. If limit is zero the result is an empty list, and this list includes records that have been cured or voided. Unlike the aggregation functions, this list lookup can grow long, so it is designed to be paginated.
Cross-chain aggregation is outside the registry's scope
The registry aggregates only what is recorded on the chain it is deployed on, and the check run inside a loan approval transaction also reads only that chain. Combining records from other chains requires another trust assumption, such as a bridge or an oracle, so this is left to the reader. A reader that wants to aggregate across multiple chains must read each registry at a specified block (a finalized block if needed), match records of the same loan using a loanRef built the recommended way so it is counted only once, and when publishing the aggregated result must also disclose which chains, registries, and blocks were read so it can be verified.
Proposal status
This proposal is currently in Draft status, an early-stage standard whose details may still change or be discontinued.
Things to watch out for
- False records: Anyone can record a default against any identity or address. Readers must include in aggregation only the reporters they trust, and before trusting a reporter, must verify that reporter's records against the loan's own logs.
- Harassment of an innocent owner: Even a trusted reporter can be wrong or have its key compromised. Readers should treat a reporter's key the way they would treat their own lender's key, and prefer reporters whose records can be cross-checked against public logs.
- Evasion via a new address: An owner who defaulted can create a new address and a new identity. An aggregated count of zero only means that the reporters on the list have recorded no defaults, not that the borrower has been verified.
- Spam: The list of records for a single identity can grow arbitrarily long, so the list lookup functions are designed to be paginated. The cost of the aggregation functions is independent of this list length and depends only on the records within the window of the primaries included in the list.
- Manipulation via recording then voiding: A reporter can record a default timed to when another lender checks, then void it within the window to alter the aggregation. Aggregation marks such records separately as provisional, so readers can exclude them if they wish.