ERC-8485 NFT-controlled app runtime standard (NFT Controlled Application Spaces)
Draft · NFTs & multi-token · created 2026-11-04
A standard in which an ERC-721 NFT controls the toll policy of an app's runtime, independent publishers register gateways, users execute via execute(), and tolls are automatically distributed.
Why it is needed
Owning a single NFT does not by itself determine how the application linked to that NFT should be executed or who should be paid. A wallet or app seeking to integrate has no way to know where to find the runtime, how to distinguish the publisher who deployed the app from the NFT owner, how to look up the toll owed per execution and limit a user's payment ceiling, or how to handle existing revenue-split settings when the NFT is transferred. If every project implements these differently, it can lead to confusion over who controls the app, stale settings being approved unchanged, or tolls being confused with app purchase costs or network gas fees.
What to implement
function supportsInterface(bytes4 interfaceId) external view returns (bool);: Checks whether this contract supports a specific interface (ERC-165).event Published(uint256 indexed tokenId, address indexed gateway, address indexed publisher, address implementation);: Records the token ID, gateway, publisher, and implementation address when a new gateway is created and registered.event Removed(address indexed gateway);: Emitted when a gateway is removed.event Executed(uint256 indexed tokenId, address indexed gateway, address indexed user, uint256 toll, uint256 revision);: Records the token ID, gateway, user, toll, and revision when an execution completes successfully.event Paid(uint256 indexed tokenId, address indexed recipient, uint256 amount);: Emitted when a native asset payment to a recipient succeeds.event Redirected(uint256 indexed tokenId, address indexed rejectedRecipient, uint256 amount);: Emitted when a recipient refuses payment and their share is redistributed to the treasury.event TreasuryPaid(uint256 indexed tokenId, uint256 amount);: Records the amount actually paid to the treasury.event TreasuryChanged(address indexed previousTreasury, address indexed newTreasury, uint256 revision);: Records the previous address, new address, and changed revision when the treasury address is replaced.function spaceIdentity() external view returns (uint256 chainId, address tokenContract, uint256 tokenId);: Returns the chain ID, NFT collection address, and token ID identifying this space.function configuration() external view returns (Configuration memory);: Returns configuration information containing the current owner, revision, toll, treasury, protocol split ratio, and recipient list.function treasuryAuthority() external view returns (address);: Returns the fixed deployment authority account that can replace the treasury address.function setTreasury(address newTreasury) external;: Callable only by the treasury authority account; replaces the treasury address with a new address.function applications(address gateway) external view returns ( address publisher, address implementation, uint64 publishedBlock, bool registered );: Returns the publisher, implementation, issuance block, and registration status of a given gateway.function appCount() external view returns (uint256);: Returns the total number of registered gateways, including removed ones.function appAt(uint256 index) external view returns (address);: Looks up the gateway address registered at an index.function publish(address implementation, bytes calldata initialization, bytes32 salt) external returns (address gateway);: Creates and registers a new gateway using a new implementation.function remove(address gateway) external;: Removes your own registered gateway so it can no longer be executed (publisher only).function payoutGasLimit() external view returns (uint256);: Returns the fixed gas allowance used for native payments.function quote() external view returns (uint256 toll, uint256 revision);: Returns the current toll and revision.function execute(Execution calldata request) external payable;: The entry point through which a user actually executes the app and pays the toll and app value.function executingUser() external view returns (address);: Returns the address of the user who called the current execution (has a value only during dispatch).function executingApp() external view returns (address);: Returns the address of the gateway currently being dispatched.function runtime() external view returns (address);: Returns the Runtime address this gateway belongs to.function implementation() external view returns (address);: Returns the implementation address this gateway uses.function implementationCodehash() external view returns (bytes32);: Returns the current EVM code hash of the implementation address.function query(bytes calldata data) external view returns (bytes memory);: Performs a static call to look up the application's read-only data.
In depth
Three roles: owner, publisher, and user
This standard distinguishes between the Owner (the NFT owner), the Publisher (the entity that registered the gateway), and the User (the user who calls the execution). The NFT owner controls only economic settings such as the toll policy and recipient list, and ERC-721 transfer approval alone does not grant this authority. Administrative rights over the app, token approvals, stored assets, and app state, on the other hand, remain with the publisher. Holding the NFT does not automatically create a general withdrawal path to the app's assets.
Fixed native toll and exact payment
nativeToll is set as an integer denominated in the chain's native asset and remains fixed until the owner raises the revision through an approved configuration change. It is not converted to an external price such as USD, so exchange rate fluctuations do not change the payment amount. When calling execute(), msg.value must exactly equal the sum of toll and appValue; a toll exceeding maxToll or an overpayment reverts without refund.
NFT transfer and revision updates
When actual ownership changes, the collection's transfer integration updates the owner in the economic state, increments the revision, and atomically clears the previous owner's custom recipient list. This processing must complete before any external recipient callback executes. Comparing ownerOf alone, off-chain logs, or a delayed synchronization transaction cannot substitute for this requirement. Even if A transfers to B and then back to A, both changes must increment the revision, and A's prior recipient list is not restored.
Treasury account and replacement authority
The treasury must be an ordinary externally owned account (EOA) with no code, and cannot be the zero address, the Runtime, a gateway, a precompile, or a chain-specific system address. Only the deployment account designated by treasuryAuthority() can replace the treasury via setTreasury(), and this authority is fixed at Runtime creation and never changes for its lifetime. Replacement is prohibited during execution, and before paying out a nonzero amount it is re-verified that the treasury has no code. If this authority is leaked, it becomes a trust dependency that can redirect protocol revenue and redistributed shares elsewhere.
Gateway publication and removal
publish(implementation, initialization, salt) can be called by anyone, and the caller is recorded as the publisher. Each gateway has independent storage and a fixed Runtime/implementation address, and the first execution must occur in a block later than publication. Only the registered publisher can remove their own gateway via remove(), removal is irreversible, and it cannot be revived with the same publisher/salt combination. Removal only blocks execution; it does not move assets or storage.
Eight execution validation steps
Before dispatch, execute() checks all of the following: whether the gateway is registered, that the implementation code exists, the deadline, that the submitted revision matches, that nativeToll is at or below maxToll, that msg.value exactly equals toll + appValue, data and gas resource limits, and that enough gas remains for settlement. Nested or reentrant execute calls are rejected. Even if the NFT is transferred during execution, that request settles against the configuration snapshotted at validation time; only subsequent requests use the new revision.
Native revenue distribution
The toll is split into protocol = floor(toll * protocolBps / 10000) and ownerShare = toll - protocol. If a recipient list exists, the amount is distributed proportionally, with the last recipient receiving the remainder; if no list exists, the owner receives the entire ownerShare. Successful recipient payouts are recorded as Paid, rejected distributions are recorded as Redirected and added to the treasury payout, and the treasury payout is recorded as TreasuryPaid. If the treasury payout fails, the entire request is atomically reverted.
A proposal that has not yet been finalized
This proposal currently has a status of Draft. The details may change or discussion may stall, so the functions and figures described in this article may differ from the final version.
Things to watch out for
- Registration does not guarantee safety: Gateway registration does not certify the safety of an application. An app may hold approved assets, expose an unsafe initialization function, or call external contracts. The fact that an implementation address is fixed does not by itself prove that its underlying behavior is immutable.
- An empty-code check does not guarantee permanent safety: Checking that a treasury address has no code does not prove account control or permanent availability. Between transactions, that account can receive a code delegation, in which case it is blocked by the check at settlement time and execution is halted until it recovers.
- The deployment authority remains a trust dependency: Replacing the treasury via the deployment authority cannot change the owner recipient, toll rate, app custody, or removal authority, but it can redirect the protocol revenue and redistribution shares elsewhere or invalidate pending requests. If this key is lost, this proposal provides no recovery mechanism.
- External callbacks must not execute before transfer integration completes: An unauthenticated transfer notification path can forge economic state, and if the transfer path is skipped or delayed, a stale revision may still be accepted even if ownerOf shows the previous owner again. Even if a transfer occurs during execution, the snapshot of an already-validated request must not be overwritten.
- Signature-based extensions require separate safeguards: If signature-based configuration changes or meta-transaction extensions are introduced, they must separately provide domain separation, nonce/replay protection, contract wallet support, expiration, and clear rules for user identity, since the default direct-call interface does not provide these automatically.