--- eip: 8506 title: AI Inference Token Onchain description: Consumable entitlements to AI inference supply with versioned specification, metering, authorized consumption and settlement author: Gary Yang (@garyyang-finchip) discussions-to: https://ethereum-magicians.org/t/erc-8506-ai-inference-token-onchain-aito/30453 status: Draft type: Standards Track category: ERC created: 2026-11-20 requires: 20, 165, 712, 1155, 1271 --- ## Abstract This proposal defines AI Inference Token Onchain (AITO), a framework for holding, transferring and consuming entitlements to AI inference supply on chain. An AITO unit expresses, under a versioned execution specification, metering rules and delivery conditions, an authorizable and consumable entitlement to AI inference supply. The "token" in the name is the inference token, the unit in which inference usage is counted. It is the denomination of the entitlement, not a blockchain token; entitlements that meet their transfer conditions are held and circulated through blockchain tokens. AITO defines five core objects (Unit, Grade, Source, Instrument, Receipt) and three optional modules (Method, Assessment, Token Binding); a series model in which every term that affects a holder's rights is part of the series identifier; a consumption model in which an authorization is a ceiling, a hold reserves units for one logical request, and a settlement deducts what was accepted and releases the rest exactly once; a native [ERC-1155](./eip-1155.md) binding and an [ERC-20](./eip-20.md) wrapper under which no unit can be exercised twice; and two optional entitlement profiles, periodic allowance and reserved capacity. AITO fixes no price, no conversion rate between suppliers and no ranking of quality. It makes explicit and checkable what is counted, what is promised, who owes it, who may consume it and what was consumed. ## Motivation Inference supply is the fuel that agents run on. Today it is bought as account credit inside one provider and cannot be held, transferred or spent by another agent without that provider's cooperation. Proposals to put it on chain meet the same obstacles each time: 1. **A token count is not yet a quantity.** Counters differ between tokenizers. Reasoning tokens may be billed without being shown. Cached input is charged at another rate. "One million tokens" names a determined amount only together with a counting rule and a schedule that says how each kind of usage is deducted. 2. **Equal counts stand for unequal supply.** The same count can come from different models, quantizations, execution configurations, context limits, latencies and data-retention terms. Collapsing these into one grade number hides exactly the differences a buyer needs to see. 3. **Supply passes through intermediaries.** A reseller may or may not hold a right to resell, and may or may not route to the model it names. A holder needs to know who owes the supply and on what ground the units were issued. 4. **A prepaid entitlement is a liability of its supplier.** Nothing on a balance sheet of credits shows whether more was sold than can be delivered. 5. **Usage is mistaken for an asset.** A log of tokens already generated is a record of the past. Treating it as a source of new entitlements creates supply out of consumption. An agent that receives an AITO-bound token is able to answer five questions from chain data and content-addressed records alone: which entitlement the token stands for; who owes the supply; whom the holder may authorize to consume; which balance decreases when it is used; and how a partial delivery or a failure is charged. The same framework serves a large provider, a reseller, and a single agent that issues against one machine it runs itself. This proposal does not define prices, market making, indices, cash-settled derivatives, proof systems for inference, or the legal classification of an entitlement. A product that reuses AITO records for such purposes does not thereby become an AITO entitlement. ## Specification The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119) and [RFC 8174](https://www.rfc-editor.org/rfc/rfc8174). ### 1. Terms and scope - **Inference**: the execution of an AI model on an input to produce an output. Text, image, audio, video and action inference, and mixtures of them, are all inference. - **Inference token**: a unit in which an inference system counts usage. A text token is one example; a kilopixel-step of image generation is another. - **Unit** (capitalized): the record that defines what is counted and how. - **unit** (lower case): one denomination unit of a series, the smallest amount of entitlement the series accounts for. - **Entitlement**: an authorizable, consumable right to AI inference supply under a versioned execution specification, metering rules and delivery conditions. - **Series**: the set of units that share identical terms. - **Instrument**: a series taken as what a holder relies on, which is its terms on the home ledger (section 4) together with its Terms record (section 3.5). - **Home ledger**: the contract that keeps the authoritative balances and consumption state of a series. A series has exactly one home ledger. - **Carrier**: a token contract whose tokens stand for units of a series. - **Issuer**: the account that may issue units of a series. - **Responsible party**: the account that owes supply to the holders of a series. - **Fulfiller**: an account allowed by the responsible party to run inference for a series, reserve units and claim usage. - **Holder**: the account that owns units. - **Consumer**: the account a holder authorizes to consume units. A holder may be its own consumer. - **Resolver**: the account, if any, that decides a disputed usage claim. - **Record**: a content-addressed JSON document (section 3). - **Receipt**: the record of one logical request, with its usage claim, its evidence, its acceptance and its settlement effect. Three things are kept apart throughout. An inference token is a unit of measure. An Instrument is an entitlement that can still be exercised. A Receipt records execution, usage and settlement that have already happened. An entitlement issued against a supplier's promise may have the character of a claim on that supplier, but this specification does not fix one legal form for all implementations. The native profiles of this specification concern consumable inference supply. Inference that is not counted in text tokens is in scope without qualification. Compute resources that are not themselves inference supply, such as accelerator-hours, MAY be expressed with the same records through extension profiles and related to inference supply through Methods (section 3.7). A lease of raw compute does not conform to a native inference profile merely because it uses the same records and accounting. A series belongs to this framework because of what it promises to deliver, which is inference supply. Whether another supplier could deliver the same thing decides whether two series are interchangeable, not whether either is an entitlement. An arrangement that promises an accepted result of a task, or a right to run a particular skill, promises something else and is out of scope. ### 2. Conformance #### 2.1 Objects and modules AITO has five core objects and three optional modules. | Object or module | Status | Depends on | Expressed by | | --- | --- | --- | --- | | Unit | core | nothing | Unit record (section 3.2) | | Grade | core | Unit | Grade record (section 3.3) | | Source | core | nothing | Source record (section 3.4) | | Instrument | core | Unit, Grade, Source | terms of a series on its home ledger (section 4) and Terms record (section 3.5) | | Receipt | core | Instrument | request record and events on the home ledger (section 5), and optionally a Receipt record (section 3.6) | | Method | optional | the Units it relates | Method and Method Application records (section 3.7) | | Assessment | optional | its subject, and a Method where it reports a measurement | Assessment record (section 3.7) | | Token Binding | optional | Instrument | carrier contract (section 6) | The members each record requires are listed, with their presence, in section 3. #### 2.2 Parts of an implementation Conformance is stated per part. A larger number of implemented parts does not imply a more trustworthy implementation, a stronger kind of evidence, or a better backed supply; those are expressed in the records. | Part | What an implementation provides | Identified by | | --- | --- | --- | | Core | Series, issuance, authorized consumption with hold, settlement and release, accounting views, and the invariants of section 9, for the stock-quota entitlement shape | `IAITOInstrument`, `IAITOConsumption` | | Records registry (OPTIONAL) | Anchoring of records | `IAITORecords` | | Token Binding module (OPTIONAL) | A carrier that resolves to a series: the native ERC-1155 binding, the ERC-20 wrapper, or another carrier | `IAITOBinding`, and `IAITOWrapper20` for the wrapper | | Method and Assessment modules (OPTIONAL) | Records of the kinds Method, Method Application and Assessment | record kinds | | Periodic allowance profile (OPTIONAL) | Section 8.1 | `IAITOPeriodic` and the extension identifier | | Reserved capacity profile (OPTIONAL) | Section 8.2 | `IAITOPeriodic` and the extension identifier | 1. A home ledger MUST implement [ERC-165](./eip-165.md) and MUST report an interface or an extension as supported only if it implements it. A part that is specified here but not implemented MUST NOT be reported. 2. An implementation that presents units as transferable or tradable MUST implement the Core and at least one Token Binding. 3. A system that only produces or checks records, for example usage metering or Receipts, MAY state compatibility with the record formats it implements. It MUST NOT describe itself as an implementation of the Core. 4. An optional module or profile is supported when its own interface and its own invariants are implemented, and is stated as supported on that ground alone. 5. ERC-165 identifies which interfaces a contract implements. It is no evidence that an economic commitment has been or will be honoured. The interface identifiers are: | Interface | Identifier | | --- | --- | | `IAITORecords` | `0xf4fcb5c6` | | `IAITOInstrument` | `0x66712ec4` | | `IAITOConsumption` | `0x109be9a0` | | `IAITOBinding` | `0x56f6d175` | | `IAITOWrapper20` | `0xd18ceaa3` | | `IAITOPeriodic` | `0xfa30b184` | #### 2.3 Dependencies Each of the five proposals this specification requires binds only the implementations named for it. | Proposal | Role in this specification | Binds | | --- | --- | --- | | ERC-165 | Reporting the interfaces and extensions a contract actually implements | every home ledger, registry and carrier | | ERC-1155 | The native binding of section 6.1 | implementations that state support for the native binding | | ERC-20 | The wrapper of section 6.2 | ERC-20 carriers | | [EIP-712](./eip-712.md) | The typed messages and the domain of section 5.6 | home ledgers and the accounts that sign | | [ERC-1271](./eip-1271.md) | Checking messages signed by contract accounts | home ledgers, which call `isValidSignature` on the signing account | An implementation of the Core that offers no carrier is bound by neither ERC-1155 nor ERC-20. No registry, ledger or carrier is required to act as a signing account. ### 3. Records #### 3.1 Canonical form and identifiers A record is a JSON object. Its canonical form is the JSON Canonicalization Scheme of [RFC 8785](https://www.rfc-editor.org/rfc/rfc8785), with one restriction: a record MUST NOT contain a number that is not an integer between -(2^53 - 1) and 2^53 - 1. Quantities that may exceed that range, and all decimal quantities, are written as strings. The identifier of a record is `keccak256` of the UTF-8 bytes of its canonical form. A record is immutable: a change of any member is another record. A new version of a record names the one it replaces in its `supersedes` member, and does not alter the meaning of the record it replaces. Every record has the members `aito` (the string `"1"`) and `kind` (one of `unit`, `grade`, `source`, `terms`, `receipt`, `method`, `method-application`, `assessment`), and MAY have `name`, `description` and `supersedes`. Accounts are written as CAIP-10 account identifiers. Record identifiers are written as `0x` followed by 64 lower-case hexadecimal digits. Times are written as UTC in the form `YYYY-MM-DDThh:mm:ssZ`. JSON Schemas are provided for [Unit](../assets/eip-8506/schemas/unit.schema.json), [Grade](../assets/eip-8506/schemas/grade.schema.json), [Source](../assets/eip-8506/schemas/source.schema.json), [Terms](../assets/eip-8506/schemas/terms.schema.json), [Receipt](../assets/eip-8506/schemas/receipt.schema.json), [Method](../assets/eip-8506/schemas/method.schema.json), [Method Application](../assets/eip-8506/schemas/method-application.schema.json) and [Assessment](../assets/eip-8506/schemas/assessment.schema.json). The schemas list every member; the tables below give the members that carry normative meaning. In the tables, the column Nature says what kind of statement a member makes: a **definition** fixes meaning; a **commitment** is something a party promises; an **observation** reports something found; an **authorization** says who may do what; an **effect** is a change of state that has taken place. A commitment is not an observation and an observation is not a commitment: what a supplier promises is written in a Grade or in Terms, and what somebody measured is written in an Assessment. **Unknown values.** A member whose value is not known or not disclosed MUST be written explicitly, with the string `undeclared`, `undisclosed` or `none` as the tables permit. A value that is unknown never satisfies a requirement. A member marked REQUIRED MUST be present and determined. #### 3.2 Unit A Unit defines what is counted and how. It proves nothing about any particular usage claim. | Member | Meaning | Nature | Presence | | --- | --- | --- | --- | | `quantityKind` | Nature of the quantity: `inference-usage`, `compute-time`, `energy`, `outcome-count`, or another declared kind | definition | REQUIRED | | `modality` | For inference usage: `text`, `image`, `audio`, `video`, `action`, `multimodal`, or another declared modality | definition | REQUIRED for `inference-usage` | | `basis` | What is counted, in which system and under which counting rule | definition | REQUIRED | | `denomination` | What one denomination unit stands for | definition | REQUIRED | | `components` | Ordered list of at most 32 usage components, each with an `id` of at most 31 characters from `a` to `z`, `0` to `9` and `_`, and a description | definition | REQUIRED, even for a single component | | `relations` | For each pair of components that could overlap: `includes`, `disjoint` or `additive` | definition | REQUIRED when there is more than one component | | `boundary` | What one count covers: the scope (request, session) and what is and is not counted (system prompt, tool results, reasoning, retries) | definition | REQUIRED | | `precision`, `rounding` | Smallest counted amount, and whether a deduction is rounded `up` or `down` to whole units | definition | REQUIRED | | `counterRef` | Name, version and digest of the tokenizer or counting program | definition | REQUIRED for text inference | Quantities of different kinds are not interchangeable. A relation between two Units is stated only through a Method. #### 3.3 Grade A Grade is a versioned set of deliverable specifications, applicable conditions and constraints. It states what is promised, never what was measured. | Member | Meaning | Nature | Presence | | --- | --- | --- | --- | | `unit` | Identifier of the Unit | definition | REQUIRED | | `ordering` | `none`, or the identifier of a profile that defines a comparison between Grades | definition | REQUIRED | | `executionObject.kind` | `fixed-model`, `service-version`, `routing-policy`, `qualifying-pool`, or another declared kind | definition | REQUIRED | | `executionObject.identity` | Weights digest, service version commitment, or policy digest | definition | REQUIRED | | `executionObject.config` | Execution configuration: reasoning budget, sampling, system prompt policy, tools | definition | REQUIRED, MAY be `undeclared` | | `requirements` | What is promised to be reached. Each entry has a statement, an optional comparator, value and method, a `scope` and a `compensable` flag | commitment | OPTIONAL; an entry that is present MUST be determined | | `obligations` | Duties that are not established by measurement, such as data retention, privacy mode and use restrictions, each with its obligor and a `compensable` flag | commitment | OPTIONAL | | `verificationPolicy` | For each of the five propositions `origin`, `metering`, `execution`, `quality` and `deliverySettlement`: the kind of evidence required and the rule by which it is accepted | authorization | REQUIRED; every entry MAY be `self-attested` | | `attributes` | Further descriptive attributes by family | definition | OPTIONAL, MAY be `undeclared` | 1. A Grade has no default global ordering. Two Grades are compared only under a profile that says how, and `ordering` names it. 2. A requirement or obligation with `compensable` set to false is a hard condition. It MUST NOT be offset by any other attribute, by a discount, or by a larger quantity. 3. The `scope` of a requirement is `per-request`, `window` or `sample`. A requirement stated per request MUST NOT be treated as met by an average over a window or a sample. 4. Efficiency, meaning how many units a stated workload needs under stated quality and conditions, MAY be the subject of an Assessment. The usefulness of an output to a particular consumer is not a property of a Grade and is not part of what a unit stands for. 5. Evidence that is self-attested is valid and MUST be labelled as such. 6. Two series under the same Unit and Grade are comparable. They are not thereby one obligation: responsibility for supply, validity and consumption terms can still differ, and units of one series are not units of the other. Treating them as interchangeable takes an explicit mechanism of joint responsibility, which this version does not define. The attribute families used by the examples are identity, capability, efficiency, robustness, speciality, energy, delivery, terms and verification. The list is a descriptive catalogue. It is open, and the families are not coordinates of one scale. #### 3.4 Source A Source states who issues, who owes supply, who fulfils, and on what grounds units may be issued. A statement that an upstream supplier exists is not an authorization from that supplier. | Member | Meaning | Nature | Presence | | --- | --- | --- | --- | | `issuer` | Who may issue under this statement | authorization | REQUIRED | | `responsibleParty` | Who owes supply to holders | commitment | REQUIRED | | `fulfillers` | Who runs the computation | definition | REQUIRED, MAY be `undisclosed` | | `issuanceBases` | One entry per ground of issuance (below) | commitment | REQUIRED, at least one | | `capacity` | Declared capacity by shape: total, rate, window; reserved, best-effort or shared | commitment | REQUIRED by profiles that promise capacity | | `exclusivity` | Reference to an Assessment of whether the capacity is committed elsewhere | observation | REQUIRED, MAY be `undeclared` | | `collateral` | Collateral or margin | commitment | REQUIRED, MAY be `none` | Each entry of `issuanceBases` has an `id` that is unique within the record, and MUST determine: who has the right to issue against it (`issuanceRight`); who owes the supply issued against it (`supplyObligation`); the origin or commitment it rests on (`origin`); its bounds in quantity and time (`quantityBound`, `timeBound`); whether an upstream authorization to resell or reissue was obtained (`authorization`, which MAY be `not-obtained` or `not-applicable`); and how the same entitlement is kept from being issued twice (`doubleIssuanceControl`). The origins `own-capacity`, `reserved-upstream-capacity`, `transferable-upstream-quota`, `credit`, `shared-redemption-pool` and `protocol-budget` are defined for use by the first profiles. The list is neither exhaustive nor exclusive: the origin of supply, the way it was acquired, its authorization and its backing are separate members and combine freely. Issuance on credit and issuance against shared capacity are permitted when disclosed as such, and MUST NOT be described as reserved capacity. The identifier of an issuance basis is `keccak256` of the canonical form of its entry. #### 3.5 Terms The Terms record holds the terms of a series that its home ledger does not enforce by itself. Together with the on-chain terms of section 4 it determines everything a holder is entitled to. | Member | Meaning | Nature | Presence | | --- | --- | --- | --- | | `profile` | Entitlement shape: `stock-quota`, `periodic-allowance`, `reserved-capacity`, or another declared profile | definition | REQUIRED | | `denomination` | What one unit entitles its holder to | commitment | REQUIRED | | `quantity` | Quantity structure: form and cap | commitment | REQUIRED | | `time` | Validity, period and reservation; `none` is written explicitly where there is no period or reservation | commitment | REQUIRED | | `transferRule` | Whether and under which restrictions units may be transferred | commitment | REQUIRED | | `issuanceRule` | Who may issue and by which mechanisms: purchase, credit issuance, burn-and-mint, stake-and-mint, or issuance against underlying entitlements | authorization | REQUIRED | | `consumptionRule` | Who authorizes consumption, who may place a hold and for how long, who meters and with what tolerance, how a claim is accepted, what triggers execution and who bears the risk of a chain reorganization | authorization | REQUIRED | | `outcomeCharging` | What is charged when a request completes, is partly delivered, is refused, times out, is cancelled by the consumer, or fails through the provider | commitment | REQUIRED | | `substitutionPolicy` | Whether the execution object may be replaced, and if so: what must hold, what may change, by which method version this is judged, who decides, how new and existing units are affected, how the denomination continues, and what holders receive when the conditions cannot be met | commitment | REQUIRED, including when substitution is not allowed | | `remedies` | What happens at expiry, what happens when the responsible party fails to supply, and how disputes are handled | commitment | REQUIRED, MAY be `none` when written explicitly | | `extensions` | Extensions of the terms, in the order they appear on chain | definition | REQUIRED, MAY be empty | 1. Unused units at expiry and supply the responsible party failed to provide are separate cases with separate remedies. 2. Where a tolerance on metering is allowed, the terms MUST fix who meters, who accepts and how a disagreement is decided. A tolerance MUST NOT raise a deduction above the hold of the request. A tolerance applies once to a logical request and MUST NOT be applied again to its fragments, retries or cumulative claims. It settles an agreed difference in metering and is not a right to charge more. 3. A substitution MUST NOT be justified by a method adopted after issuance, unless the terms authorized that change of method. Continuity of the denomination requires three things to be preserved or expressly changed by the terms: the balance, what one unit stands for, and the quality, time and consumption conditions. Keeping the number in an account is not keeping the right. 4. An entitlement to supply by a named model and an entitlement to supply that meets stated requirements are different things. A model that scores higher does not thereby replace a named model. A Terms record SHOULD have `name` and `description` members so that it also serves as the metadata document of the native ERC-1155 binding. #### 3.6 Receipt A Receipt keeps four things distinguishable: the usage claim, the evidence, the acceptance, and the settlement effect. The existence of a claim or of evidence authorizes no deduction. The on-chain part of a Receipt is the request record and events of section 5. A Receipt MAY also be published as a record with the members below, alone or in batches (section 3.8). | Member | Meaning | Nature | Presence | | --- | --- | --- | --- | | `request` | Logical request identifier, request key, home ledger, series, holder, consumer, fulfiller, authorization, Unit, and the consumption period where the profile has one | definition | REQUIRED | | `claim` | Who claims, the usage per component, the outcome class, and the execution object actually used | observation | REQUIRED; the execution object MAY be `undisclosed` | | `evidence` | Zero or more entries, each naming the proposition it supports, the mechanism, what it relies on and what it does not show | observation | REQUIRED, MAY be empty | | `acceptance` | The rule applied, who accepted, and the amount accepted | authorization | REQUIRED | | `effect` | Units deducted, units released, and the receipt hash | effect | REQUIRED | Evidence is classified by the proposition it supports, which is one of `origin`, `metering`, `execution`, `quality` and `delivery-settlement`. Kinds of evidence are not ranked. #### 3.7 Method, Method Application and Assessment These records form the optional Method and Assessment modules. A **Method** defines a way of measuring, calibrating, converting or combining. Its `methodType` is one of `unit-conversion`, `conditional-calibration`, `measurement-procedure` and `combination`. It MUST state its inputs, its outputs, its domain of applicability and its known limitations, and a calibration MUST state whether its basis is on the output side, the input side or mixed. Registering a Method grants no right to issue and discharges no obligation. An exchange at a market price is not a Method, and neither is the replacement or assumption of a supply obligation. A **Method Application** pins everything that decides the result of one use of a Method: the Method, its parameters, the subjects it was applied to, the identifiers of the input records, the conditions, the period of validity and the events that require recalibration. Wherever a result of a Method is relied on, the Method Application MUST be cited, not the Method alone. An **Assessment** states who found what, about which subject, under which conditions. It has a `standing` of `self`, `counterparty` or `third-party`, and a `state` of `measured`, `not-observed`, `not-applicable` or `undeterminable`. An empirical measurement MUST state its conditions (task domain, input conditions, compute budget, execution configuration, run conditions), its Method, its sample or statistical scope and its time. A measurement of marginal capability MUST state its baseline. An Assessment is an observation. It does not become a commitment of the supplier, and after a substitution it does not carry over to the new execution object. #### 3.8 Records registry Records are resolved by identifier. The interface below anchors a record under the address of the account that stands behind it. Anchoring proves nothing about the content of a record. ```solidity /// @title Anchoring of content-addressed AITO records /// @notice A record identifier is the keccak256 hash of the canonical form of the record. /// Anchoring states that `publisher` stands behind the record; it proves nothing about its content. interface IAITORecords { /// @notice `publisher` anchored record `id`. event RecordAnchored( bytes32 indexed id, RecordKind indexed kind, address indexed publisher, bytes32 supersedes, string uri ); /// @notice `publisher` changed where record `id` can be fetched. The content is unchanged. event RecordRelocated(bytes32 indexed id, address indexed publisher, string uri); /// @notice `publisher` anchored a Merkle root over `count` records of one kind. event BatchAnchored( bytes32 indexed root, RecordKind indexed kind, address indexed publisher, uint256 count, string uri ); /// @notice Anchor record `id` under the caller's address. /// @param supersedes Identifier of the record this one replaces, or zero. /// @param uri Where the record can be fetched. function anchor(bytes32 id, RecordKind kind, bytes32 supersedes, string calldata uri) external; /// @notice Change the location of a record the caller anchored. function relocate(bytes32 id, string calldata uri) external; /// @notice Anchor a Merkle root over `count` records of one kind under the caller's address. function anchorBatch(bytes32 root, RecordKind kind, uint256 count, string calldata uri) external; /// @notice The record `publisher` anchored under `id`. `anchoredAt` is zero when there is none. function recordOf(address publisher, bytes32 id) external view returns (RecordKind kind, uint64 anchoredAt, bytes32 supersedes, string memory uri); /// @notice The batch `publisher` anchored under `root`. `anchoredAt` is zero when there is none. function batchOf(address publisher, bytes32 root) external view returns (RecordKind kind, uint64 anchoredAt, uint256 count, string memory uri); } ``` 1. A record is anchored under its publisher. An account MUST NOT be able to anchor, replace or relocate a record under another account's address. 2. A record that has been anchored MUST NOT be replaced. `relocate` changes where it can be fetched and nothing else. 3. The issuer of a series SHOULD anchor the Unit, Grade and Terms records of the series under its own address, and the responsible party SHOULD anchor the Source record under its own address. A party that cannot resolve a record a series refers to MUST treat the members of that record as unknown. 4. Several records of one kind MAY be anchored together with `anchorBatch`, by the root of a Merkle tree. The leaves are the record identifiers in ascending numerical order, without duplicates, each hashed as `keccak256(abi.encodePacked(bytes1(0x00), id))`. A parent is `keccak256(abi.encodePacked(bytes1(0x01), left, right))`. A level with an odd number of nodes carries its last node up unchanged. The root of a batch of one record is its leaf. The document at the `uri` of the batch lists the identifiers. ### 4. Series #### 4.1 Types ```solidity /// @notice Kinds of content-addressed record. /// Unit, Grade, Source, Terms and Receipt are the five core objects. /// Method, MethodApplication and Assessment belong to the optional modules. enum RecordKind { Unit, Grade, Source, Terms, Receipt, Method, MethodApplication, Assessment } /// @notice How a usage claim becomes an accepted deduction. /// CoSign the consumer signs the claim; no signature, no deduction. /// Optimistic the claim stands after the objection window unless the consumer or holder objects. /// ProviderMetered the fulfiller's claim is accepted as made, bounded by the hold. enum AcceptanceRule { CoSign, Optimistic, ProviderMetered } /// @notice Result class of one request. Each class selects which usage components are charged. enum Outcome { Completed, Partial, Refused, TimedOut, CancelledByConsumer, ProviderError } /// @notice State of one logical request on the home ledger. enum RequestState { None, Held, Claimed, Disputed, Settled, Released } /// @notice How a carrier token relates to a series. enum BindingType { Native, Wrap } /// @notice How units reached through a carrier are consumed. /// Direct consumed on the home ledger from the carrier balance itself. /// UnwrapFirst the carrier must be converted back to native units before consumption. enum ConsumptionPath { Direct, UnwrapFirst } /// @notice An extension of the terms of a series. struct SeriesExtension { /// Identifier of the extension. A new version of an extension has a new identifier. bytes32 id; /// True when a party that does not understand the extension must not operate on the series. bool critical; /// Parameters of the extension, in the encoding its definition gives. bytes data; } /// @notice Machine-enforced terms of a series. The series identifier is /// `uint256(keccak256(abi.encode(terms)))`, so any change to any member is a new series. /// Terms that the ledger does not enforce live in the terms document committed by `termsHash`. struct SeriesTerms { /// The only account that may issue units of the series. address issuer; /// The account that owes supply to holders. address responsibleParty; /// Record identifiers of the Unit, Grade and Source this series is issued under. bytes32 unit; bytes32 grade; bytes32 source; /// Identifier of the full terms document. bytes32 termsHash; /// Maximum total issuance, in denomination units. uint256 cap; /// Units are consumable from `validFrom` to `validUntil`, both inclusive. uint64 validFrom; uint64 validUntil; /// Whether holders may transfer units to other accounts. bool transferable; /// Whether any party may change the deduction schedule after creation. bool scheduleMutable; /// Rounding of a deduction to whole denomination units: up when true, down when false. bool roundUp; AcceptanceRule acceptanceRule; /// Seconds during which a claim may be objected to (Optimistic). uint32 objectionWindow; /// Seconds the resolver has to decide a disputed claim. uint32 resolutionWindow; /// Longest permitted hold, in seconds. uint32 maxHoldDuration; /// Account that decides disputed claims, or zero for none. address resolver; /// Usage components of the Unit, in the order usage vectors are reported. bytes32[] components; /// Denomination units deducted per component unit, scaled by 1e6. uint256[] weights; /// One bitmask per Outcome: bit i set means component i is charged for that outcome. uint256[] outcomeMasks; /// Extensions of the terms, with their parameters. SeriesExtension[] extensions; } /// @notice A holder's permission for a consumer to consume. It is a ceiling, not a reservation. struct Authorization { address holder; address consumer; uint256 seriesId; /// Cumulative ceiling across all requests made under this authorization. uint256 cap; uint64 validAfter; uint64 validUntil; /// Zero for unrestricted; otherwise only requests carrying the same scope may use it. bytes32 scope; uint256 nonce; } /// @notice A consumer's instruction to reserve units for one logical request. struct ConsumptionRequest { bytes32 authorizationId; /// Chosen by the consumer. Retries and mirrors of the same logical request reuse it. bytes32 requestId; /// The fulfiller allowed to place the hold and claim usage. address fulfiller; /// Upper bound of the deduction for this request. uint256 maxAmount; uint64 holdUntil; bytes32 scope; } /// @notice The on-chain part of a Receipt. struct RequestRecord { RequestState state; Outcome outcome; uint64 holdUntil; uint64 claimedAt; uint64 disputedAt; uint256 seriesId; address holder; address consumer; address fulfiller; bytes32 authorizationId; /// Units reserved by the hold. uint256 held; /// Deduction computed from the claimed usage, before the hold bound is applied. uint256 computed; /// Deduction claimed, never above `held`. uint256 claimed; /// Units finally deducted. uint256 deducted; bytes32 claimHash; bytes32 evidenceRoot; bytes32 receiptHash; } ``` #### 4.2 Terms and identifier 1. The identifier of a series is `uint256(keccak256(abi.encode(terms)))`, where `terms` is the `SeriesTerms` value. The terms of a series MUST NOT change after creation. Any difference in any member, including the Terms record identified by `termsHash` and the parameters of an extension, is another series. 2. A home ledger MUST refuse to create a series unless these are determined: the execution object and its specification version (through `grade`); the Unit, its counting boundary and what a unit stands for (through `unit` and the deduction schedule); the issuance basis and the responsible party (through `source` and `responsibleParty`); quantity, validity and, where the profile has them, period and allowance rules; how consumption is authorized; who meters, with what tolerance, and how a claim is accepted; how failure, cancellation, unused units and disputes are handled; and transfer, exit and substitution. Members that the ledger does not hold itself are determined by the Terms record. A term MAY be determined by an explicit default of an immutable profile that the series names, and then need not be repeated. 3. A value that the specification allows to be unknown, such as independently verified physical capacity, MAY be marked unknown. What the entitlement promises MUST NOT be left out on that ground. 4. `components`, `weights` and `outcomeMasks` form the deduction schedule. `components` lists the identifiers of the Unit's components, each as an ASCII string left-aligned in 32 bytes, in the order in which usage is reported. `weights[i]` is the number of units deducted per unit of component `i`, multiplied by 1,000,000. `outcomeMasks[o]` has bit `i` set when component `i` is charged for outcome `o`. 5. A series whose deduction schedule can be changed by any party after creation MUST set `scheduleMutable`. The quantity of inference such a series entitles to is undetermined, and a party relying on a determined quantity MUST treat it so. A home ledger that cannot change a schedule MUST refuse such a series. 6. A series is consumable from `validFrom` to `validUntil`, both inclusive, once its responsible party has accepted responsibility. #### 4.3 Extensions 1. An extension is identified by `keccak256` of its versioned name. A new version is a new identifier. The identifier, the `critical` flag and the parameters are part of the terms and therefore of the series identifier. 2. A party that does not understand a critical extension of a series MUST NOT perform an operation the extension can affect. It MAY still read, display and discover the series. A home ledger MUST refuse to create a series with a critical extension it does not implement, and a carrier MUST refuse to bind one. 3. An extension that this specification defines as critical MUST be listed as critical. A party that recognizes such an extension listed as not critical MUST treat the series as invalid. An issuer cannot make a semantic of this specification ignorable by relabelling it. 4. An extension that is not critical MAY be ignored by a party that does not understand it. #### 4.4 Issuance 1. Only the issuer of a series issues units, and only after the responsible party has accepted responsibility for the series. Where the two are the same account, creating the series is that acceptance. 2. Every issuance MUST cite, in `basisRef`, the identifier of an issuance basis declared in the Source of the series. Total issuance MUST NOT exceed `cap`, and units MUST NOT be issued after `validUntil`. 3. A Receipt of past usage alone MUST NOT give anyone the power to issue new unconsumed entitlements. A reward, a compensation, a re-issue or a restoration that is triggered by a Receipt MUST rest on a supply commitment, a budget or an adjustment rule that applies independently of that Receipt and is stated in the Source or the Terms. A home ledger MUST refuse an issuance whose `basisRef` is the receipt hash of a request it has settled. 4. A Method yields no right to issue. That one unit of a series is found comparable to two units of another gives nobody the power to issue either. #### 4.5 Accounting For every series a home ledger MUST expose the totals issued, consumed, retired and lapsed, the total currently held, and for every holder the units available and held. At all times: ```text issued = consumed + retired + lapsed + held + sum over all holders of available ``` A unit is issued as available. An available unit is transferred, held, retired or, after expiry, lapsed. A held unit is consumed by a settlement or becomes available again by a settlement or a release. Consumed, retired and lapsed are final. The state of a unit and the state of a request (section 5.5) are two different things: the end of a request is never the end of an entitlement that still has units or periods left. That these totals are readable and consistent shows that the ledger does not let a unit be consumed twice. It does not show that physical capacity exists, that the capacity is not committed elsewhere, or that the supplier has not promised the same supply through another ledger. Those are matters for the Source, for Assessments and for profiles that add collateral or capacity audits. #### 4.6 Interface ```solidity /// @title Series of AI inference entitlements and their home ledger interface IAITOInstrument { event SeriesCreated( uint256 indexed seriesId, address indexed issuer, address indexed responsibleParty, bytes32 termsHash, string termsURI ); event ResponsibilityAccepted(uint256 indexed seriesId, address indexed responsibleParty); event FulfillerSet(uint256 indexed seriesId, address indexed fulfiller, bool allowed); event Issued(uint256 indexed seriesId, address indexed to, uint256 amount, bytes32 basisRef); event Retired(uint256 indexed seriesId, address indexed holder, uint256 amount); event Lapsed(uint256 indexed seriesId, address indexed holder, uint256 amount); /// @notice Create a series. The caller MUST be `terms.issuer`. /// @return seriesId `uint256(keccak256(abi.encode(terms)))`. function createSeries(SeriesTerms calldata terms, string calldata termsURI) external returns (uint256 seriesId); /// @notice The identifier a series with these terms has. function seriesIdOf(SeriesTerms calldata terms) external pure returns (uint256); /// @notice Called by the responsible party to take on the supply obligation of the series. function acceptResponsibility(uint256 seriesId) external; /// @notice Called by the responsible party to allow or disallow a fulfiller. function setFulfiller(uint256 seriesId, address fulfiller, bool allowed) external; /// @notice Issue units. `basisRef` cites an issuance basis declared in the Source record. function issue(uint256 seriesId, address to, uint256 amount, bytes32 basisRef) external; /// @notice Give up the caller's own units without consuming them. function retire(uint256 seriesId, uint256 amount) external; /// @notice Remove the unconsumed units of `holder` after the series has expired. function lapse(uint256 seriesId, address holder) external; function seriesOf(uint256 seriesId) external view returns (SeriesTerms memory); function termsURI(uint256 seriesId) external view returns (string memory); function responsibilityAccepted(uint256 seriesId) external view returns (bool); function isFulfiller(uint256 seriesId, address account) external view returns (bool); /// @notice Whether this ledger implements `extension`. function supportsExtension(bytes32 extension) external view returns (bool); /// @notice The deduction, in denomination units, that the series schedule gives for `usage` and `outcome`. function quoteCharge(uint256 seriesId, uint256[] calldata usage, Outcome outcome) external view returns (uint256); // Accounting. For every series: // issuedOf == consumedOf + retiredOf + lapsedOf + heldOf + sum of availableOf over all holders. function issuedOf(uint256 seriesId) external view returns (uint256); function consumedOf(uint256 seriesId) external view returns (uint256); function retiredOf(uint256 seriesId) external view returns (uint256); function lapsedOf(uint256 seriesId) external view returns (uint256); /// @notice Units of the series currently reserved by holds. function heldOf(uint256 seriesId) external view returns (uint256); /// @notice Units of `holder` currently reserved by holds. function heldBy(uint256 seriesId, address holder) external view returns (uint256); /// @notice Units of `holder` that are neither reserved nor consumed. function availableOf(uint256 seriesId, address holder) external view returns (uint256); /// @notice `availableOf` while the series can be consumed, otherwise zero. function consumableOf(uint256 seriesId, address holder) external view returns (uint256); } ``` ### 5. Consumption Consumption has the logical steps authorize, hold, execute, claim, accept and settle or release. Execution happens off chain. An implementation MAY perform several steps in one transaction, and MAY settle a stream of usage cumulatively under one request key, provided the rules of this section hold for the logical request. #### 5.1 Authorization 1. Units are consumed only under an `Authorization` of their holder. An authorization is a ceiling on what one consumer may consume from one series. It reserves nothing: the holder can still transfer every unit. 2. A consumption authorization MUST NOT be inferred from an ERC-20 allowance, an ERC-1155 operator approval or any other approval to transfer. One signed message MAY grant both a transfer approval and a consumption authorization, provided each is stated as a separate grant. 3. An authorization is given either by a signature of the holder over the typed data of section 5.6, valid under [EIP-712](./eip-712.md) for an externally owned account and under [ERC-1271](./eip-1271.md) for a contract account, or by the holder calling `authorize`. For a contract account the home ledger calls `isValidSignature` on that account. Nothing in this specification requires a ledger, a registry or a carrier to validate signatures as an account itself. 4. The amount in use under an authorization is the sum of the units currently held and the units already deducted under it. It MUST NOT exceed `cap`. Units released return to the ceiling. 5. A holder MAY revoke an authorization. Revocation prevents new holds and does not affect a request that is already held. #### 5.2 Request and hold 1. A consumer asks for units to be reserved by signing a `ConsumptionRequest`. The request names one fulfiller, an upper bound `maxAmount` and a time `holdUntil`. 2. One logical request has one request key on a home ledger, `keccak256(abi.encode(consumer, requestId))`. Retries, batched submissions and mirrored submissions of the same logical request MUST use the same `requestId`. A home ledger MUST refuse a hold whose request key has been used. 3. Only the fulfiller named in the request, if it is allowed for the series, places the hold. The hold moves `maxAmount` units of the holder from available to held. A unit is never both available and held. Held units MUST NOT be transferred and MUST NOT be held again. 4. `maxAmount` MUST be greater than zero. `holdUntil` MUST be later than the time of the hold, no later than that time plus the `maxHoldDuration` of the series, and no later than `validUntil`. 5. Where `scope` of the authorization is not zero, the request MUST carry the same `scope`. The meaning of a scope value is given by the Terms or by a profile. #### 5.3 Usage claim 1. The fulfiller that placed the hold claims usage on the home ledger no later than `holdUntil`, as one amount per component in the order of the series schedule, with an outcome class and an evidence commitment. From that moment the claim is public: the ledger records the time of the claim, the computed and claimed amounts and the commitment, and emits the usage vector, so that the consumer and the holder read the reported usage before anything is deducted. 2. The home ledger computes the deduction. It MUST NOT accept a deduction supplied by a party: ```text scaled = sum of usage[i] * weights[i] over the components i charged for the outcome computed = scaled / 1,000,000, rounded up or down to a whole unit as the series states claimed = the smaller of computed and the units held for the request ``` 3. The hold is the budget of the request. A claim never reaches beyond it. 4. A claim alone deducts nothing. 5. A request whose outcome charges nothing is still claimed and settled, so that a Receipt exists for it. #### 5.4 Acceptance How a claim becomes an accepted deduction is fixed by the `acceptanceRule` of the series. | Rule | A claim is accepted when | Otherwise | | --- | --- | --- | | `CoSign` | the consumer signs it | once `holdUntil` has passed, anyone may release the request and nothing is deducted | | `Optimistic` | the consumer signs it, or `objectionWindow` passes without an objection by the consumer or the holder | an objection releases the request when the series has no resolver; with a resolver the claim is disputed | | `ProviderMetered` | it is made | not applicable | 1. The objection window of an `Optimistic` series starts when the claim is recorded on the home ledger and runs for `objectionWindow` seconds. It does not start, pause or restart with the publication of evidence. An `Optimistic` series MUST have an objection window greater than zero; with a window of zero it would be `ProviderMetered` under another name, and a home ledger MUST refuse to create it. 2. An objection needs no evidence and no proof. The consumer or the holder objects within the window, from the reported usage alone, with a reason code the ledger records and does not judge. 3. The evidence commitment of a claim is a commitment, not the evidence. Whether, to whom and by when the evidence behind it has to be made available is fixed by the verification policy of the Grade and by the Terms. Where the Terms require evidence to be made available, a claim whose evidence is not available before the window closes is objectionable on that ground alone, and a resolver MUST NOT rely on evidence that was not made available to the objecting party. 4. Under `Optimistic` acceptance, a claim that nobody objected to within the window is settled at the claimed amount whether or not evidence was made available. That exposure is bounded by the hold of the request, and a consumer who does not accept it uses a series with `CoSign`. 5. A disputed claim is decided by the resolver of the series within `resolutionWindow`. The resolver settles an amount no greater than the claim. If the resolver does not decide in time, anyone may release the request. 6. The consumer MAY accept a disputed claim by signature. 7. The fulfiller MAY release a request it holds at any time before settlement. 8. Further acceptance rules MAY be defined as critical extensions. #### 5.5 Settlement and release 1. A settlement deducts the accepted amount from the held units of the request and returns the rest to the holder. A release returns all held units. Each logical request is settled or released at most once. `Settled` and `Released` are final. 2. An accepted consumption reduces the consumable quantity, or advances the consumption state, under the metering and time rules of the series. A profile decides whether that is a burn of units, a deduction from an allowance or the use of capacity inside a window. A release never undoes a deduction that has been determined. 3. On settlement the home ledger records a receipt hash: ```text claimHash = keccak256(abi.encode(requestKey, usage, outcome, evidenceRoot)) receiptHash = keccak256(abi.encode(chainId, ledger, requestKey, seriesId, holder, consumer, fulfiller, authorizationId, claimHash, deducted, released)) ``` 4. A rollback of the chain does not undo inference that has run. The Terms MUST state what triggers execution and who bears that risk. This specification requires that a settlement takes effect once. It does not promise that execution happens exactly once. The states of a request and the transitions between them are: | From | Call | To | | --- | --- | --- | | `None` | `hold` | `Held` | | `Held` | `claimUsage` | `Claimed`; under `ProviderMetered`, `Settled` | | `Held` | `release` by the fulfiller, or by anyone after `holdUntil` | `Released` | | `Claimed` | `accept` with the consumer's signature | `Settled` | | `Claimed` | `finalize` after the objection window (`Optimistic`) | `Settled` | | `Claimed` | `object` inside the objection window (`Optimistic`) | `Released` without a resolver, `Disputed` with one | | `Claimed` | `release` by the fulfiller, or under `CoSign` by anyone after `holdUntil` | `Released` | | `Disputed` | `resolve` by the resolver inside the resolution window | `Settled` | | `Disputed` | `accept` with the consumer's signature | `Settled` | | `Disputed` | `release` by the fulfiller, or by anyone after the resolution window | `Released` | #### 5.6 Typed data The EIP-712 domain of a home ledger has `name` equal to `AITO`, `version` equal to `1`, the chain identifier, and the address of the home ledger as `verifyingContract`. The types are: ```text Authorization(address holder,address consumer,uint256 seriesId,uint256 cap,uint64 validAfter,uint64 validUntil,bytes32 scope,uint256 nonce) ConsumptionRequest(bytes32 authorizationId,bytes32 requestId,address fulfiller,uint256 maxAmount,uint64 holdUntil,bytes32 scope) UsageAcceptance(bytes32 requestKey,bytes32 claimHash,uint256 amount) ``` The identifier of an authorization is its EIP-712 digest. EIP-712 provides no protection against replay. That protection comes from this section: the domain binds a signature to one ledger on one chain; an authorization has a validity period, a ceiling and a recorded amount in use; a request key is used once; and an acceptance names one claim of one request. #### 5.7 Interface ```solidity /// @title Authorized consumption of AI inference entitlements /// @notice An authorization is a ceiling. A hold reserves units for one logical request. /// A settlement deducts what was accepted and releases the rest, once per logical request. interface IAITOConsumption { event Authorized( bytes32 indexed authorizationId, address indexed holder, address indexed consumer, uint256 seriesId, uint256 cap, uint64 validAfter, uint64 validUntil, bytes32 scope, uint256 nonce ); event Revoked(bytes32 indexed authorizationId, address indexed holder); event Held( bytes32 indexed requestKey, bytes32 indexed authorizationId, address indexed fulfiller, address consumer, bytes32 requestId, uint256 seriesId, address holder, uint256 amount, uint64 holdUntil ); event UsageClaimed( bytes32 indexed requestKey, address indexed fulfiller, Outcome outcome, uint256[] usage, uint256 computed, uint256 claimed, bytes32 claimHash, bytes32 evidenceRoot ); event Objected(bytes32 indexed requestKey, address indexed by, bytes32 reason); event Accepted(bytes32 indexed requestKey, address indexed acceptedBy, AcceptanceRule rule, uint256 amount); event Settled( bytes32 indexed requestKey, uint256 indexed seriesId, address indexed holder, uint256 deducted, uint256 released, bytes32 receiptHash ); event Released(bytes32 indexed requestKey, uint256 indexed seriesId, address indexed holder, uint256 amount); /// @notice EIP-712 digest of an authorization. It is the authorization identifier. function hashAuthorization(Authorization calldata a) external view returns (bytes32); /// @notice EIP-712 digest of a consumption request. function hashRequest(ConsumptionRequest calldata r) external view returns (bytes32); /// @notice EIP-712 digest a consumer signs to accept a claim. function hashAcceptance(bytes32 requestKey, bytes32 claimHash, uint256 amount) external view returns (bytes32); /// @notice The key one logical request has on this ledger: `keccak256(abi.encode(consumer, requestId))`. function requestKeyOf(address consumer, bytes32 requestId) external pure returns (bytes32); /// @notice Register an authorization on chain. The caller MUST be `a.holder`. function authorize(Authorization calldata a) external returns (bytes32 authorizationId); /// @notice Revoke an authorization. The caller MUST be `a.holder`. Existing holds are unaffected. function revoke(Authorization calldata a) external; function isRevoked(bytes32 authorizationId) external view returns (bool); /// @notice Units currently reserved or already deducted under an authorization. function usedOf(bytes32 authorizationId) external view returns (uint256); /// @notice Reserve `r.maxAmount` units of the holder for one logical request. /// The caller MUST be `r.fulfiller`. `holderSig` may be empty when the authorization was registered on chain. function hold( Authorization calldata a, bytes calldata holderSig, ConsumptionRequest calldata r, bytes calldata consumerSig ) external returns (bytes32 requestKey); /// @notice Claim the usage of a held request. The deduction is computed from the series schedule /// and the outcome, and is bounded by the hold. function claimUsage(bytes32 requestKey, uint256[] calldata usage, Outcome outcome, bytes32 evidenceRoot) external; /// @notice Settle a claim with the consumer's signature over it. function accept(bytes32 requestKey, bytes calldata consumerSig) external; /// @notice Object to a claim inside the objection window. The caller MUST be the consumer or the holder. function object(bytes32 requestKey, bytes32 reason) external; /// @notice Decide a disputed claim. The caller MUST be the series resolver. `amount` MUST NOT exceed the claim. function resolve(bytes32 requestKey, uint256 amount) external; /// @notice Settle an unobjected claim after the objection window. function finalize(bytes32 requestKey) external; /// @notice Return all reserved units of a request that will not be settled. function release(bytes32 requestKey) external; function requestOf(bytes32 requestKey) external view returns (RequestRecord memory); /// @notice Whether `hash` is the receipt hash of a settled request on this ledger. function isReceipt(bytes32 hash) external view returns (bool); } ``` ### 6. Token Binding A Token Binding maps the tokens of a carrier to a series. A series is an entitlement; a carrier is how it is held. Every carrier MUST implement: ```solidity /// @title Mapping from a carrier token to a series of AI inference entitlements /// @notice Implemented by every contract whose tokens carry AITO units. interface IAITOBinding { /// @notice The series a carrier token stands for. /// @param carrierId Token identifier within the carrier, or zero for single-token carriers. /// @return ledger The home ledger of the series. /// @return seriesId The series. /// @return bindingType Native when the carrier is the home ledger itself, Wrap for a locked 1:N representation. /// @return carrierPerUnit Carrier base units that stand for one denomination unit. /// @return path How units reached through this carrier are consumed. function aitoBinding(uint256 carrierId) external view returns ( address ledger, uint256 seriesId, BindingType bindingType, uint256 carrierPerUnit, ConsumptionPath path ); } ``` 1. From any carrier token a party MUST be able to resolve the home ledger and the series, and from there the terms, the responsible party and the consumption rules. 2. Transfer, splitting, wrapping, bridging and combination MUST NOT increase the units of a series that can be exercised at the same time. A carrier other than the home ledger MUST NOT offer a consumption path of its own: a deduction always takes effect on the home ledger. 3. A carrier MUST refuse to bind a series that has a critical extension the carrier does not implement. #### 6.1 Native ERC-1155 binding In the native binding the home ledger is itself the carrier. 1. The home ledger implements ERC-1155. The token identifier of a unit is its series identifier, and `aitoBinding` returns the ledger itself, `Native`, one carrier unit per unit, and `Direct`. 2. `balanceOf` of a holder is the holder's available units. A hold decreases it and a release increases it, each with a `TransferSingle` event to or from the address of the home ledger, where held units are kept. Balances reconstructed from events therefore equal available units. The home ledger MUST NOT accept transfers of units to its own address from any account. 3. `uri` returns the location of the Terms record of the series. 4. Where a series is not transferable, the home ledger MUST refuse transfers between holders. Issuance, retirement and movements of held units are not transfers between holders. #### 6.2 ERC-20 wrapper ```solidity /// @title ERC-20 carrier for one series of AI inference entitlements /// @notice Every wrapped token is backed by native units locked in the wrapper. /// Wrapped tokens cannot be consumed; they are unwrapped first. interface IAITOWrapper20 { event Wrapped(address indexed from, address indexed to, uint256 units); event Unwrapped(address indexed from, address indexed to, uint256 units); /// @notice The home ledger of the wrapped series. function ledger() external view returns (address); /// @notice The wrapped series. function seriesId() external view returns (uint256); /// @notice Wrapped base units minted per native unit. function unitScale() external view returns (uint256); /// @notice Native units currently locked in the wrapper. function lockedUnits() external view returns (uint256); /// @notice Whether the wrapped series has passed its `validUntil`. function expired() external view returns (bool); /// @notice Lock `units` native units of the caller and mint `units * unitScale` wrapped tokens to `to`. /// The caller MUST have approved the wrapper as operator on the ledger. function wrap(uint256 units, address to) external; /// @notice Burn `units * unitScale` wrapped tokens of the caller and send `units` native units to `to`. function unwrap(uint256 units, address to) external; } ``` 1. A wrapper implements ERC-20 and is bound to one series. It mints `unitScale` wrapped base units for each unit it receives and locks, and burns them when the unit leaves. The wrapped supply MUST equal `lockedUnits` multiplied by `unitScale` until the series expires. Fractions of a unit circulate in wrapped form; only whole units are unwrapped. 2. `aitoBinding` returns the home ledger, the series, `Wrap`, `unitScale` and `UnwrapFirst`. Wrapped units are consumed only after they are unwrapped. 3. A wrapper MUST NOT sign, register or otherwise give a consumption authorization, and MUST NOT validate signatures on behalf of anyone. Units locked in a wrapper cannot then be consumed through any path. Unwrapping returns locked units only, and so never restores a unit that has been consumed. 4. A wrapper MUST refuse a series that is not transferable. 5. After `validUntil` wrapped tokens stand for expired units. A wrapper MUST expose `expired`. ### 7. Stock quota Stock quota is the entitlement shape of the Core. A series has a cap and a validity. A unit of the series is one denomination unit. Consumption deducts units, which cease to exist. After `validUntil` the remaining units are no longer consumable and anyone may call `lapse` to remove them from a holder's balance. A holder may `retire` its own units at any time. ### 8. Optional entitlement profiles The two profiles of this section are critical extensions. Their identifiers are: | Profile | Extension name | Identifier | | --- | --- | --- | | Periodic allowance | `aito.profile.periodic-allowance.v1` | `0x11908a9a6fe89e4451ae895e5ac34e4501dc0ddc95c668f7ffadde1004f5ad19` | | Reserved capacity | `aito.profile.reserved-capacity.v1` | `0x9d1124ef1e280952aba424c3a6cbe6ccd9426f703f64599995466220f78fc8b8` | In both, a unit of the series is a **right**, the cap of the series bounds the number of rights, and consumption is deducted from an allowance while the right persists. Both use this interface: ```solidity /// @title Periodic allowance and reserved capacity /// @notice Interface of the two optional entitlement profiles. In these profiles a unit of the /// series is a right. An active right yields an allowance of denomination units in every period; /// consumption is deducted from the allowance of the period in which the hold was placed, and /// the right itself persists. The reference ledger does not implement this interface. interface IAITOPeriodic { event Activated(uint256 indexed seriesId, address indexed holder, uint256 rights, uint64 effectivePeriod); event Deactivated(uint256 indexed seriesId, address indexed holder, uint256 rights, uint64 effectivePeriod); /// @notice Activate `rights` rights of the caller. They yield allowance from the next period boundary /// and cannot be transferred while active. function activate(uint256 seriesId, uint256 rights) external; /// @notice Deactivate `rights` active rights of the caller. Takes effect at the next period boundary; /// rights whose allowance still backs an unsettled request stay locked until it is settled or released. function deactivate(uint256 seriesId, uint256 rights) external; /// @notice The period that contains `timestamp`. function periodOf(uint256 seriesId, uint64 timestamp) external view returns (uint64 index, uint64 start, uint64 end); /// @notice Rights of `holder` that yield allowance in period `index`. function activeRightsOf(uint256 seriesId, address holder, uint64 index) external view returns (uint256); /// @notice Allowance of `holder` in period `index`: granted, already deducted, and currently held. function allowanceOf(uint256 seriesId, address holder, uint64 index) external view returns (uint256 granted, uint256 used, uint256 held); } ``` #### 8.1 Periodic allowance The parameters of the extension are `abi.encode(uint64 anchor, uint32 periodLength, uint256 allowancePerRight, uint256 carryOverCap)`. Period `k` runs from `anchor + k * periodLength` to one second before `anchor + (k + 1) * periodLength`. A `carryOverCap` of zero means that nothing carries over. Settling a request deducts from an allowance and never ends a right. 1. Activation applies to a stated number of rights of one holder. Only activated rights yield allowance, and an authorization of that holder (section 5.1) draws on that allowance and on nothing else. An authorization activates nothing. 2. The anchor, the period length, the allowance per right and the carry-over rule are fixed before any right is activated. With a `carryOverCap` greater than zero, allowance of a right that is unused when a period ends is added, up to `carryOverCap`, to its allowance in the next period, provided the right is active in both. 3. A right that is active in a period yields `allowancePerRight` units of allowance in that period. Activation and deactivation take effect at the next period boundary. Rights MUST NOT be transferred while active. 4. A request is charged to the allowance of the period in which its hold was placed. Units released after that period has ended return to that period: they are lost, or carried over where the carry-over rule allows. 5. Deactivation, a change of address, reactivation, splitting and merging MUST NOT reset consumption that has taken place in a period. Rights whose allowance still backs an unsettled request stay locked until the request is settled or released under the rules of section 5. 6. The same right MUST NOT yield allowance twice in one period, whoever holds it. That active rights cannot be transferred is a rule of this profile, not of entitlements in general. What every implementation of periodic rights has to preserve is the continuity of consumption within one right and one period. Another profile MAY allow transfer of active rights if it preserves that. #### 8.2 Reserved capacity Reserved capacity is a periodic allowance confined to a window and backed by a capacity commitment. The parameters of the extension are `abi.encode(uint64 windowStart, uint64 windowEnd, uint32 interval, uint256 allowancePerRight, uint32 concurrency, bool dedicated)`. The periods are the intervals of the window. 1. The rules of section 8.1 apply with the interval as the period. Nothing carries over from one interval to the next, and there is no allowance outside the window. 2. The Source MUST declare the capacity as reserved, and the Terms MUST state the rate, the concurrency and whether the capacity is dedicated or shared. 3. The Terms MUST state how a reservation is cancelled. A cancellation takes effect at an interval boundary and returns the allowance of later intervals to the responsible party. It does not affect a request that is already held. 4. A request that is held when an interval or the window ends is settled or released under section 5, and is charged to the interval in which its hold was placed. ### 9. Invariants Every implementation of the Core MUST preserve the following, and every profile and carrier MUST preserve those that apply to it. 1. **Issuance has a ground.** Every issuance cites an issuance basis. A record of usage, a Method and an Assessment are never one. 2. **No double exercise.** Transfer, splitting, authorization, wrapping, bridging and combination do not increase what can be exercised at the same time from one source. A periodic right yields no additional allowance in a period by changing hands. 3. **Holds are exclusive.** A held unit is not available: it cannot be transferred and cannot be held again. 4. **One effect per logical request.** A logical request is settled or released once, however often it is submitted. 5. **Consumption takes effect.** An accepted consumption reduces the consumable quantity or advances the consumption state, and a release does not undo it. 6. **Terms continue.** The terms of existing units, the Method Applications they pin and past Receipts are never rewritten. 7. **Four steps stay distinguishable.** Claim, evidence, acceptance and effect may be submitted together and remain separate facts. A claim or a piece of evidence authorizes no deduction. 8. **Authority and responsibility are explicit.** Issuance, conversion and consumption each have their own authorization. The responsible party and the fulfillers of a series are resolvable. An approval to transfer is not an authorization to consume. 9. **State is verifiable.** Issued, available, held, consumed, retired and lapsed quantities are readable for the entitlement shape in use, and every way out of a state is traceable. 10. **Claims are grounded and hard conditions are not for sale.** Every property declared for a combination of entitlements has a combination Method, a mechanism and evidence. A conversion of quantity never offsets a condition that is not compensable. 11. **Critical extensions are understood.** An operation that a critical extension can affect is not performed by a party that does not understand the extension. ## Rationale **An entitlement, not a token count.** Inference that has been generated can be stored as data. Storing an output does not store a capacity to compute again. What can be held and traded is therefore the right to supply that has not yet been consumed, and the records of what was consumed are a different object. Keeping the two apart is also what prevents usage from being recycled into supply (section 4.4). **Divided by what is promised, not by who could deliver it.** A quota that only one supplier can honour is still an entitlement to inference. A translation service that many suppliers could perform still promises an accepted result. Interchangeability decides whether two series can share a market or a pool. It does not decide what kind of asset either is. **No global grade and no built-in conversion.** Quality has many dimensions, and they do not form one scale: speed does not make up for a broken retention promise, and a larger quota of short context is not a long context. A reference Unit and a reference Grade can therefore exist as shared definitions that suppliers issue under directly and that buyers compare against, without any conversion rate being part of the framework. Where two supplies have to be related, a Method Application states under which workload, budget, quality requirement and delivery constraint the relation holds, for how long, and for which subjects. **Why a reference unit does not need a pool.** A common measure answers how supplies are understood and compared. A pool answers who is jointly responsible for delivering. The first is useful without the second, so the Unit and the Grade are records that any supplier, agent or aggregator can cite. **Records off chain, terms in the identifier.** Specifications, promises and measurements are too large and too varied for contract storage, and most of them are never read by a contract. They are content-addressed records. The terms a ledger enforces, the identifier of the Terms record and the parameters of extensions are hashed into the series identifier, so that two units with the same identifier carry the same rights and no later act can change what a unit means. **Promises and measurements in different records.** A Grade says what a supplier undertakes. An Assessment says what somebody found under stated conditions. Mixing them lets a single favourable measurement pass for a promise, or a promise pass for a fact. **Authorization as a ceiling, hold as a reservation.** The length of an output is not known before it is produced, so a request reserves an upper bound and is settled at what was used. Making the authorization a ceiling and not a reservation lets a holder delegate to an agent without locking funds, while the hold gives the fulfiller certainty for the duration of one request. Keeping held units at the ledger's own address makes "available" and "held" disjoint by construction and keeps the ERC-1155 balance truthful. **Two state lines.** The state of an entitlement and the state of one consumption are kept apart. A request ends in a settlement or a release. An entitlement continues until it is used up, retired or expired. One merged state machine invites the error of ending a periodic right because one request against it was settled. **Consumption is not always destruction.** A stock quota is used up. A periodic right is not: its allowance for the period is. The rule common to all shapes is that an accepted consumption reduces what can still be consumed and cannot be exercised again, and each profile says what that means for it. **Wrapped units are unwrapped before use.** One consumption path per series keeps settlement in one place. A wrapper that could also authorize consumption would be a second path, and each path would need to be shown not to overlap the other. **The deduction is computed by the ledger.** If the ledger accepted a deduction as a number, the schedule would be a comment. Computing it from the reported usage, the outcome class and the stored weights makes the schedule binding and lets any agent quote a request in advance. **Acceptance rules are few and explicit.** Self-metering by the provider is how most inference is billed today and is legitimate when stated. Co-signature and optimistic acceptance give the consumer a say. All three are named so that a holder knows before buying which one applies; none is called stronger. **Pools are not part of this version.** Entitlements of several suppliers can be combined in two ways that must not be confused. A basket share is a proportional claim on whatever the basket holds, and has to be presented as a share. A unified redemption instrument promises supply under one specification, and is a new series whose responsible party is the pool. For the second kind, a later profile has to fix before any issuance: what a holder may demand, in what quantity and under which specification; which qualifying reserves the pool holds at a given time; who makes up a shortfall, under which conditions and up to what amount; how a shortfall is shared; how the undelivered part is recorded; whether holders keep rights against the original suppliers; when issuance and consumption stop; and what an exit delivers. Admission of a supply precedes its measurement, since no conversion admits a supply that fails a hard condition. A fall in reserves is recorded as a shortfall and does not rewrite what holders were promised. **Other carriers.** The Core does not depend on a token interface. The native binding uses ERC-1155 because a series is fungible within itself and distinct from every other series. Carriers built on other interfaces, such as [ERC-3525](./eip-3525.md) slots, can implement the binding interface in the same way. ## Backwards Compatibility This proposal introduces no change to ERC-20, ERC-1155 or any other existing interface. Units in the native binding are ordinary ERC-1155 tokens and wrapped units are ordinary ERC-20 tokens, so wallets, marketplaces and other contracts handle them without modification. Two behaviours differ from what such software may assume. The ERC-1155 balance of a holder decreases when a fulfiller places an authorized hold, without a call by the holder or an approved operator, and increases again on release. And both kinds of token lose their use at `validUntil`. Software that takes custody of units or prices them needs to read the series terms. ## Test Cases The cases below are implemented as tests of the reference implementation and can be recomputed by hand. The deduction schedule of Cases A and B is `output` at 1.0 and `input` at 0.25 (Case A, with `cache_read` at 0.025) or 0.2 (Case B), rounded up. ### Deduction For the Case A schedule, with usage of 6,000 input, 2,100 output and 0 cached: | Outcome | Components charged | Deduction | | --- | --- | --- | | Completed | all | 2,100 + 0.25 x 6,000 = 3,600 | | Refused | input | 0.25 x 6,000 = 1,500 | | Timed out | none | 0 | | Provider error | none | 0 | One unit of input alone gives 0.25, which is 1 when the series rounds up and 0 when it rounds down. Usage of 2,000 input and 4,000 output computes to 4,500; against a hold of 3,000 the claim is 3,000. ### Case A: a supplier's quota, native and wrapped The series has a cap of 10,000,000, is valid for 90 days, is transferable and uses `Optimistic` acceptance with an objection window of 600 seconds and no resolver. | Step | Action | Result | | --- | --- | --- | | 1 | The supplier anchors the Unit, Grade, Source and Terms records, creates the series and allows itself as fulfiller | Series exists; responsibility accepted | | 2 | The supplier issues 1,000,000 to a distributor, citing its issuance basis | Issued 1,000,000 | | 3 | The distributor transfers 300,000 to holder H | Distributor 700,000, H 300,000 | | 4 | H sends 200,000 to the ERC-20 wrapper | H 100,000 native and 200,000 wrapped; 200,000 locked | | 5 | H transfers 50,000 wrapped to H2, and H2 unwraps them | H 150,000 wrapped; H2 50,000 native; 150,000 locked | | 6 | H2 authorizes agent C with a ceiling of 20,000 | Nothing reserved; H2 still has 50,000 available | | 7 | C signs request r for at most 4,000 and the supplier places the hold | H2 available 46,000, held 4,000 | | 8 | The supplier claims 6,000 input and 2,100 output, completed | Claimed 3,600; nothing deducted yet | | 9 | 600 seconds pass without objection and the claim is finalized | Deducted 3,600, released 400; H2 available 46,400; authorization in use 3,600 | Final state: 700,000 + 100,000 + 46,400 available, 150,000 locked in the wrapper and 3,600 consumed, which is the 1,000,000 issued. The wrapped supply is 150,000 times the unit scale. At no point could the 150,000 locked units be consumed. ### Case B: an agent issues against its own machine Agent alpha is issuer, responsible party and fulfiller. All evidence is self-attested and the Grade says so. The series has a cap of 5,000,000, is valid for 30 days and uses `Optimistic` acceptance with an objection window of 600 seconds. In this case the consumer accepts by signature and nobody waits for the window. | Step | Action | Result | | --- | --- | --- | | 1 | Alpha anchors its records, creates the series and issues 1,000,000 to itself against its own capacity | Issued 1,000,000 | | 2 | Alpha transfers 200,000 to agent beta | Beta 200,000 | | 3 | Beta authorizes agent gamma with a ceiling of 50,000 for seven days | Nothing reserved | | 4 | Gamma signs request r1 for at most 3,000 and alpha places the hold | Beta available 197,000, held 3,000 | | 5 | Alpha claims 2,000 input and 1,400 output, completed | Claimed 1,400 + 0.2 x 2,000 = 1,800 | | 6 | Gamma accepts by signature | Deducted 1,800, released 1,200; beta available 198,200; authorization in use 1,800 | | 7 | r1 is submitted again | Refused; no second effect | The only evidence is alpha's signed statement of usage. It supports the proposition `metering`. It does not show that the declared model ran or that no undisclosed computation took place, and the Receipt says so. ### Three things that must not happen 1. **A periodic right changes hands after its allowance for the period is used.** The new holder obtains no allowance for that period. The first table below shows it. 2. **A supply that fails a hard condition is offered at a lower price or with higher throughput.** It does not satisfy a Grade that requires the condition, whether its own record states a different term, states no term, or an Assessment reports that no breach was observed. No conversion coefficient makes it satisfy that Grade. 3. **A settled request is submitted again**, as a retry, inside a batch, or as a mirror from another carrier. The request key is already used, and the ledger refuses it. ### State example: periodic allowance Five rights, 10,000 units per right per day, no carry-over. Holder A activated all five before day 1. | Time | Event | State | | --- | --- | --- | | day 1 00:00 | period 1 opens | A: granted 50,000 | | day 1 09:00 | hold r1, 20,000 | A: available 30,000 | | day 1 09:05 | settle r1, 18,000 | A: used 18,000, available 32,000 | | day 1 14:00 | hold and settle r2, 27,000 | A: used 45,000, available 5,000 | | day 1 15:00 | A deactivates 5 rights | effective at day 2 00:00 | | day 1 15:01 | A tries to transfer | rejected: rights are active | | day 1 23:58 | hold r3, 5,000 | A: available 0 | | day 2 00:00 | period 2 opens | A: granted 0; rights stay locked by r3 | | day 2 00:01 | A tries to transfer | rejected: r3 is unsettled | | day 2 00:03 | settle r3, 4,200 | charged to period 1: used 49,200; 800 released into a closed period and lost | | day 2 08:00 | A transfers 5 rights to B | accepted | | day 2 08:01 | B activates 5 rights | effective at day 3 00:00 | | day 2 12:00 | B tries to hold 1 | rejected: B granted 0 in period 2 | | day 3 00:00 | period 3 opens | B: granted 50,000 | On no day do the five rights yield more than 50,000 units. Day 2 yields none: that is the cost of the activation rule. ### State example: reserved capacity One right, a window from 10:00 to 11:00, intervals of 10 minutes, 60,000 units per interval. | Time | Event | State | | --- | --- | --- | | 10:02 | hold and settle, 45,000 | interval 0: used 45,000 | | 10:10 | interval 0 closes | 15,000 unused, lost | | 10:12 | hold and settle, 30,000 | interval 1: used 30,000 | | 10:19 | hold c, 20,000 | interval 1: available 10,000 | | 10:20 | interval 1 closes | 10,000 unused, lost; 20,000 still held by c | | 10:21 | settle c, 18,000 | charged to interval 1: used 48,000; 2,000 released into a closed interval and lost | | 10:22 | hold and settle, 60,000 | interval 2: used 60,000 | | 10:28 | tries to hold 5,000 | rejected: interval 2 is exhausted | | 10:30 | interval 2 closes | 0 unused | | 10:33 | hold and settle, 10,000 | interval 3: used 10,000 | | 10:35 | holder cancels the rest | effective at 10:40: intervals 4 and 5 return to the supplier | | 10:40 | interval 3 closes | 50,000 unused, lost | | total | 6 x 60,000 = 360,000 | used 163,000 + lost 77,000 (15,000 + 12,000 + 0 + 50,000) + cancelled 120,000 | ### Vectors The identifier of the following record, the Unit of Case B in canonical form, is `0x79fbb79521870a1df8ea1d15a36523fb9546b98740b9a21ef0bb41e80c69aa24`: ```json {"aito":"1","basis":"Tokens as counted per request by the counter named in counterRef.","boundary":{"counted":["system-prompt"],"notCounted":["provider-retries"],"scope":"request"},"components":[{"description":"Tokens read from the request.","id":"input"},{"description":"Tokens generated. The model has no separate reasoning tokens.","id":"output"}],"counterRef":{"digest":"0xfe8223abcfbef553434a7d7aae96996f66ceadeaa94c8e866d0b75b7e8a08a32","name":"alpha-tokenizer","version":"1"},"denomination":"One denomination unit equals one unit of the component output.","description":"Text tokens of the tokenizer shipped with the model agent alpha runs.","kind":"unit","modality":"text","name":"Text inference tokens of agent alpha","precision":"1","quantityKind":"inference-usage","relations":[{"a":"input","b":"output","relation":"additive"}],"rounding":"up"} ``` The type hashes of section 5.6 are: | Type | Type hash | | --- | --- | | `Authorization` | `0xd0929328a6ac633014041880338fa25e165fa0f88c6ff32684b7ee42d9c5e5de` | | `ConsumptionRequest` | `0xc3c4dbffab9873a476332264201aba77dfcfaa81c8c35384330d98af64866e14` | | `UsageAcceptance` | `0x3baef98b788b282974e59a65912318c0aca281562e9f820be6a7b04822dd583b` | For a home ledger at `0xA170000000000000000000000000000000000001` on chain 11155111, the domain separator is `0x09f028349ad49924ea8b5ea8dc8d259668c488c13c9b6b643b7223cc6ab62b20`. With the values of Case B (holder `0x7a055Cd74024BB5326Bef7Febf2Eaf0b4856aEa7`, consumer `0xf01697af0fF1754D59eEb2d7B984247b6965FCa8`, fulfiller `0x0bf0222F7ea374852Bf8012f900E72bcc2C93ABf`, series `0xaaafe0f8f93480be88cbe971a05d3f350934bde5ccd811cec1316cfe53372a8e`, ceiling 50,000, valid from 1800000000 to 1800604800, scope zero, nonce 1, request identifier `0x93763a9159a5d73e7991517c1825a35586271956d2cc75b8d7c65f3ef7b0d3b2`, at most 3,000 until 1800000600, usage [2000, 1400], outcome completed, evidence commitment `0x88612ac89d930fa0de3cd412866b301a72e0fbc23451f7587784861d00851890`): | Value | Result | | --- | --- | | Authorization identifier | `0xba86285e7809f0fcec7f19aaccf2970c2d3899c085795d33bb1189526fb93292` | | Request digest | `0x4785fc4b2ac9f3be6d5b0b3b492521458e1997060d1c8f53c82b5cec007ff5a0` | | Request key | `0x01472020e14eb71c3e5622005ea114857f94d8912fb85fccbb0297ec1d4aafbe` | | Claim hash | `0xa2476a41b10ec24ca0b4d797f0eaf37b770cf9a4fe97f4a74c8827d7a946552a` | | Acceptance digest | `0x7d55f9bc3160adaa0b5688eed1dbf2fc5a3fbf407ea53a30fedadc8346b19ac1` | | Receipt hash | `0xe1617046f3dd72754c41c08468fb8f57b128a62f0b1bffa7b9d44575f4d83529` | The batch of the three example Units, whose identifiers in ascending order are `0x79fbb79521870a1df8ea1d15a36523fb9546b98740b9a21ef0bb41e80c69aa24`, `0x94941b97cd507a42330cfc4139b9d7b098476f38d38d4a902d9dabd924d54d66` and `0xa96f1bc7480d72951dd26dd0e30c1b6edbc4cc237397beb5418c4e176190dfcc`, has the root `0x6ae75ee179006ac6866abd2c587121f3e977c032ae423a25d6c47c33897a167e`. The complete inputs, the series terms of both cases and the signatures are in [series.json](../assets/eip-8506/vectors/series.json), [typed-data.json](../assets/eip-8506/vectors/typed-data.json), [records.json](../assets/eip-8506/vectors/records.json) and [interfaces.json](../assets/eip-8506/vectors/interfaces.json). ## Reference Implementation A reference implementation of the Core, the records registry, the native ERC-1155 binding and the ERC-20 wrapper is provided: [AITOLedger.sol](../assets/eip-8506/contracts/AITOLedger.sol), [AITORecords.sol](../assets/eip-8506/contracts/AITORecords.sol) and [AITOWrapper20.sol](../assets/eip-8506/contracts/AITOWrapper20.sol), against the interfaces [AITOTypes.sol](../assets/eip-8506/contracts/interfaces/AITOTypes.sol), [IAITORecords.sol](../assets/eip-8506/contracts/interfaces/IAITORecords.sol), [IAITOInstrument.sol](../assets/eip-8506/contracts/interfaces/IAITOInstrument.sol), [IAITOConsumption.sol](../assets/eip-8506/contracts/interfaces/IAITOConsumption.sol), [IAITOBinding.sol](../assets/eip-8506/contracts/interfaces/IAITOBinding.sol), [IAITOWrapper20.sol](../assets/eip-8506/contracts/interfaces/IAITOWrapper20.sol) and [IAITOPeriodic.sol](../assets/eip-8506/contracts/interfaces/IAITOPeriodic.sol). The reference ledger implements the stock-quota shape. It implements neither optional profile, does not report them, and refuses a series that lists either. It has no owner, no upgrade path and no privileged account. It builds on OpenZeppelin Contracts 5.3.0 for ERC-1155, ERC-20, typed-data hashing and signature checking. The records of the worked cases are provided as examples: for Case A the [Unit](../assets/eip-8506/examples/case-a/unit.json), [Grade](../assets/eip-8506/examples/case-a/grade.json), [Source](../assets/eip-8506/examples/case-a/source.json) and [Terms](../assets/eip-8506/examples/case-a/terms.json); for Case B the [Unit](../assets/eip-8506/examples/case-b/unit.json), [Grade](../assets/eip-8506/examples/case-b/grade.json), [Source](../assets/eip-8506/examples/case-b/source.json), [Terms](../assets/eip-8506/examples/case-b/terms.json) and [Receipt](../assets/eip-8506/examples/case-b/receipt.json); a [Unit for image inference](../assets/eip-8506/examples/case-c/unit.json); and for the optional modules a [Method](../assets/eip-8506/examples/optional/method.json), a [Method Application](../assets/eip-8506/examples/optional/method-application.json) and an [Assessment](../assets/eip-8506/examples/optional/assessment.json). The reference implementation will be deployed on a public test network, with the two worked cases executed and recorded, before this proposal leaves Draft. ## Security Considerations **Delivery is off chain.** A home ledger knows what was reserved, claimed, accepted and deducted. It does not know whether inference ran, on which model, or how well. Everything a holder can rely on about delivery comes from the terms it accepted and from evidence, and evidence that is self-attested is a statement by the party that benefits from it. **Issuance can exceed capacity.** The cap of a series and the accounting identity bound what a ledger records. They do not bound what a supplier promises elsewhere, and the same machines can stand behind several series, ledgers and off-chain contracts. A series issued on credit or against shared capacity is a liability of its responsible party. Holders who need more than a promise look for collateral, a capacity audit, or an independent Assessment of exclusivity, and treat an undeclared value as unknown. **The acceptance rule decides who can hurt whom.** Under provider metering the fulfiller decides the deduction up to the hold. Under co-signature the consumer can withhold a signature after being served. Under optimistic acceptance without a resolver, an objection cancels the deduction, and with a resolver the outcome depends on the resolver. Each rule moves the risk and none removes it. Small holds, short hold durations and a named resolver reduce what is at stake in one request. **Under optimistic acceptance, silence settles.** A claim whose evidence never appears is deducted in full if neither the consumer nor the holder objects in time. Consumers under optimistic terms watch the claim events of their requests, or delegate that watch, and object when the reported usage disagrees with their own count or the evidence is missing; an objection costs one transaction and, without a resolver, always prevails. The length of the window decides whether that is practical: a window shorter than the time a consumer needs to notice a claim is provider metering with extra steps. **Holds can be used to lock units.** A fulfiller can keep units held until `holdUntil` without serving. The exposure is bounded by the consumer's own signed request, by the ceiling of the authorization and by the maximum hold duration of the series, and only fulfillers allowed by the responsible party can place holds. **Signatures.** EIP-712 does not prevent replay. An implementation that omits any of the protections of section 5.6 lets a signature be used twice. Request keys are scoped to the consumer so that one party cannot occupy the request identifier of another. The validity of a contract account's signature can change between the time it is given and the time it is checked. **Chain reorganizations and executed inference.** A hold that disappears in a reorganization leaves the fulfiller with work done and nothing reserved. Fulfillers choose how many confirmations to wait for, and the terms say who bears the loss. **Expiry.** Units and wrapped tokens stop being consumable at `validUntil`, and their market value approaches zero before that. Contracts that accept them as collateral or hold them in pools are exposed to this decay, and after expiry anyone can lapse the units held by a wrapper. **Balances move without the holder's transaction.** An authorized hold reduces the ERC-1155 balance of the holder. A contract that reads its balance and assumes it can transfer that amount later can be wrong if it has authorized a consumer. **Critical extensions and mutable schedules.** A party that ignores a critical extension it does not understand may exercise a right that does not exist. A series with a mutable schedule entitles to a quantity the issuer can change, whatever its balance says. **Substitution.** A supplier that replaces a model while keeping balances unchanged can reduce what a unit is worth. The substitution policy in the Terms is the holder's only protection, and a policy that lets the supplier choose the method of comparison afterwards protects nothing. **State footprint.** Every series stores its terms on the home ledger and every request leaves a record there. Where creating state is expensive, that record is most of the cost of a request. An implementation that serves many small requests settles them cumulatively under one request key, or keeps its home ledger on a network where state is cheap. Records of settled and released requests are kept, because a ledger that forgets a request key can no longer refuse the same request a second time. **Record availability.** A record that can no longer be fetched cannot be checked, though its identifier still proves what it said to anyone who kept a copy. Parties that rely on a record keep it. **Privacy.** Usage per component, amounts and counterparties of every request are public on chain. Consumers for whom this reveals too much use fresh accounts, batch several requests into one settlement, or rely on implementations that commit to usage and prove the deduction without disclosing it. **Rounding.** Rounding up favours the supplier by less than one unit per request, and rounding down favours the consumer by less than one unit per request. With very small requests either can be exploited, and the precision of the Unit is chosen with that in mind. **Resolvers.** A resolver can settle any amount up to the claim. It is a trusted party named in the terms, and its failure to act within the resolution window releases the request. **Regulatory treatment.** A transferable prepaid entitlement, a wrapped form of it and a pooled form of it may each fall under different rules in different jurisdictions. This specification takes no position on that. ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md).