EIP.tools

EIP.tools

⚠️ DraftStandards Track: ERC

ERC-8342: Verifiable Invoice Commitment (VIC)

Commits structured, EIP-712-signed invoice metadata to on-chain payments via a registrar contract.

Authors
Created2026-04-26
Discussion Linkhttps://ethereum-magicians.org/t/erc-verifiable-invoice-commitment-vic-fiscal-metadata-anchored-to-on-chain-payments-via-eip-712-singleton-registrar/28547
Requires

Markdown

https://raw.githubusercontent.com/ethereum/ERCs/re...
Pull Request#1890PR open

EIP-GPT summary

Contents
AbstractMotivationSpecification1. EIP-712 Typed Data Schema1.1 Domain Separator1.2 Primary Type: Invoice1.3 Subtypes1.4 Field Semantics2. The Invoice Hash3. Registrar Contract3.1 Interface3.2 Behavior3.3 Encrypted Payloads3.4 Deployment4. Binding to the Payment Transaction5. Verification Procedure6. ERC-7730 Clear SigningRationaleBackwards CompatibilityTest CasesReference ImplementationSecurity ConsiderationsCopyright

Abstract

This ERC defines a standard for binding structured accounting metadata — equivalent to a traditional invoice or fiscal receipt — to on-chain payment transactions, without modifying existing token contracts or transfer semantics. It specifies (1) a canonical EIP-712 typed data schema (Invoice) covering fiscal identity, tax breakdown, foreign exchange context, line items, and jurisdictional extensions; (2) a registrar contract interface (IInvoiceCommitmentRegistry) whose instances can be deployed at the same address across EVM chains; and (3) a companion ERC-7730 clear-signing descriptor for hardware-wallet verification.

The invoice content lives off-chain by default; only its hash and an optional URI are committed on-chain. An opt-in mode allows the encrypted payload to be carried on-chain when off-chain coordination is impractical. The design preserves commercial confidentiality, keeps gas overhead low, and requires no changes to existing ERC-20 tokens.

Motivation

Stablecoins are increasingly used for commercial payments, including cross-border remittances and machine-to-machine commerce. Yet the accounting layer that traditionally accompanies a payment — the invoice — has no canonical representation in EVM ecosystems. Reconciliation between a transaction hash and the invoice it satisfies remains a private off-chain concern, fragmenting audit trails and preventing independent verification by tax authorities, auditors, and counterparties.

Existing standards address adjacent problems. ERC-7699 introduces an opaque bytes reference field but deliberately leaves its semantic structure undefined. ERC-7943 (uRWA) defines compliance hooks for tokenized real-world assets without carrying accounting metadata. The bytes data extensions of ERC-223, ERC-777, and ERC-1363 permit arbitrary payload attachment but do not standardize its semantic structure. ERC-681 and ERC-7856 define pre-transaction payment-request URIs whose metadata does not persist on-chain.

Outside Ethereum, ITU-T Recommendation F.751.4 defines a general framework for DLT-based invoices, including the lifecycle from issuance to tax clearance, but does not specify an EVM-native realization. The W3C Traceability Vocabulary defines a CommercialInvoice Verifiable Credential with linked-data semantics, but uses JSON-LD rather than EIP-712 and has no on-chain commitment mechanism.

The Verifiable Invoice Commitment standard fills the remaining gap by defining a canonical, extensible, and privacy-preserving binding between commercial invoices and on-chain payments. It does not replace any existing token standard; it composes on top of them.

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 and RFC 8174.

1. EIP-712 Typed Data Schema

Conforming implementations MUST sign invoices using the following EIP-712 domain and type definitions.

1.1 Domain Separator

EIP712Domain {
    string  name;              // "VerifiableInvoiceCommitment"
    string  version;           // "1"
    uint256 chainId;
    address verifyingContract; // the registrar instance that will commit the invoice
}

1.2 Primary Type: Invoice

Invoice {
    string      invoiceId;
    uint256     issueDate;
    uint256     dueDate;
    string      paymentTerms;
    string      purchaseOrderRef;
    address     issuer;
    TaxIdentity issuerTaxId;
    address     recipient;
    TaxIdentity recipientTaxId;

    address     paymentToken;
    uint256     paymentAmount;
    string      fiatCurrency;
    uint256     fiatAmountMilliUnits;
    uint256     fxRateScaled;
    address     fxOracle;
    uint256     fxTimestamp;

    TaxEntry[]  taxes;
    LineItem[]  lineItems;

    string      jurisdiction;
    bytes       regulatoryData;

    uint256     nonce;
}

1.3 Subtypes

TaxIdentity {
    string scheme;    // e.g. "AR-CUIT", "MX-RFC", "EU-VAT", "US-EIN", "OTHER"
    string id;        // the identifier value in the scheme's format
}
TaxEntry {
    string  taxType;      // "VAT" | "IVA" | "SALES" | "WITHHOLDING" | "EXCISE" | "OTHER"
    string  taxScheme;    // jurisdiction + category, e.g. "AR-IVA-21", "MX-IVA-16"
    uint256 rateBps;      // tax rate in basis points (2100 == 21.00%)
    uint256 baseAmountMilliUnits;
    uint256 taxAmountMilliUnits;
}
LineItem {
    string  description;
    uint256 quantityScaled;       // quantity × 10^3 to support fractional units
    string  unit;                 // UN/CEFACT code: "EA", "HR", "KG", "L", ...
    uint256 unitPriceMilliUnits;
    uint256 lineTotalMilliUnits;
    uint256 taxRefIndex;          // index into the parent Invoice.taxes array
}

1.4 Field Semantics

  • invoiceId: MUST be unique within the scope of issuer. Format is issuer-defined but SHOULD be stable and human-readable.
  • issueDate, dueDate: UNIX timestamps in UTC seconds. dueDate MAY be 0 to indicate not applicable.
  • paymentTerms: Free-form string describing commercial terms ("Net 30", "50% upfront", "EOM +60"). MAY be empty.
  • purchaseOrderRef: Reference to a buyer-issued purchase order. MAY be empty.
  • issuer, recipient: Ethereum addresses. issuer is the party that is paid and that signs the invoice; recipient is the party that pays. issuer MUST be the address recovered from the EIP-712 signature over the invoice hash (Section 2).
  • issuerTaxId, recipientTaxId: Fiscal identity in a declared scheme. For scheme == "OTHER", id format is jurisdiction-specific and SHOULD be documented in a companion extension ERC.
  • paymentToken: Address of the ERC-20 token used for settlement. For native ETH, implementations MAY use the sentinel 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.
  • paymentAmount: Token amount in the token's smallest unit.
  • fiatCurrency: ISO 4217 three-letter code.
  • fiatAmountMilliUnits: Invoice total in fiat, in milli-units (1 milli-unit = 0.001 fiat units).
  • fxRateScaled: Exchange rate as (fiat units per 1 whole token) × 10^8, where one whole token is 10^decimals of the token's smallest unit. For example, a token with 6 decimals worth 1.00 USD each has fxRateScaled == 100000000. MAY be 0 if the payment token is itself denominated in fiatCurrency.
  • fxOracle: Address of the price source the issuer consulted. MAY be the zero address if not applicable. This field is informational: see Section 5.
  • fxTimestamp: UNIX timestamp at which the FX rate was observed.
  • taxes: Array of tax entries. MAY be empty for tax-exempt transactions.
  • lineItems: Array of line items. MAY be empty. When non-empty, sum(lineTotalMilliUnits) + sum(taxAmountMilliUnits) MUST equal fiatAmountMilliUnits.
  • jurisdiction: ISO 3166-1 alpha-2 country code identifying the fiscal jurisdiction of the issuer.
  • regulatoryData: Opaque bytes whose structure is defined by jurisdiction-specific companion ERCs. MAY be empty.
  • nonce: uint256, unique per issuer. Prevents replay. Issuers SHOULD choose nonces at random rather than from a monotonic counter, so that nonces do not reveal issuance volume.

2. The Invoice Hash

The invoice hash is the EIP-712 signing digest of the Invoice:

typeHash    = keccak256(encodeType(Invoice))
structHash  = keccak256(typeHash || encodeData(invoice))
invoiceHash = keccak256("\x19\x01" || domainSeparator || structHash)

encodeType, encodeData and domainSeparator are as defined in EIP-712. Referenced struct types are appended to the primary type in alphabetical order, so encodeType(Invoice) is the following string (shown wrapped; it contains no whitespace or line breaks):

Invoice(string invoiceId,uint256 issueDate,uint256 dueDate,string paymentTerms,
string purchaseOrderRef,address issuer,TaxIdentity issuerTaxId,address recipient,
TaxIdentity recipientTaxId,address paymentToken,uint256 paymentAmount,
string fiatCurrency,uint256 fiatAmountMilliUnits,uint256 fxRateScaled,
address fxOracle,uint256 fxTimestamp,TaxEntry[] taxes,LineItem[] lineItems,
string jurisdiction,bytes regulatoryData,uint256 nonce)
LineItem(string description,uint256 quantityScaled,string unit,
uint256 unitPriceMilliUnits,uint256 lineTotalMilliUnits,uint256 taxRefIndex)
TaxEntry(string taxType,string taxScheme,uint256 rateBps,
uint256 baseAmountMilliUnits,uint256 taxAmountMilliUnits)
TaxIdentity(string scheme,string id)

invoiceHash is the canonical commitment identifier of the invoice, and it is the digest the issuer signs.

3. Registrar Contract

3.1 Interface

Conforming registrars MUST implement the following interface:

interface IInvoiceCommitmentRegistry {
    enum PayloadMode {
        OffChain,
        EncryptedOnChain
    }

    struct TaxIdentity {
        string scheme;
        string id;
    }

    struct TaxEntry {
        string  taxType;
        string  taxScheme;
        uint256 rateBps;
        uint256 baseAmountMilliUnits;
        uint256 taxAmountMilliUnits;
    }

    struct LineItem {
        string  description;
        uint256 quantityScaled;
        string  unit;
        uint256 unitPriceMilliUnits;
        uint256 lineTotalMilliUnits;
        uint256 taxRefIndex;
    }

    struct Invoice {
        string      invoiceId;
        uint256     issueDate;
        uint256     dueDate;
        string      paymentTerms;
        string      purchaseOrderRef;
        address     issuer;
        TaxIdentity issuerTaxId;
        address     recipient;
        TaxIdentity recipientTaxId;
        address     paymentToken;
        uint256     paymentAmount;
        string      fiatCurrency;
        uint256     fiatAmountMilliUnits;
        uint256     fxRateScaled;
        address     fxOracle;
        uint256     fxTimestamp;
        TaxEntry[]  taxes;
        LineItem[]  lineItems;
        string      jurisdiction;
        bytes       regulatoryData;
        uint256     nonce;
    }

    event InvoiceCommitted(
        bytes32 indexed invoiceHash,
        address indexed issuer,
        address indexed recipient,
        bytes32 paymentTxRef,
        PayloadMode payloadMode,
        string uri,
        bytes encryptedPayload,
        bytes issuerSignature
    );

    function commitInvoice(
        Invoice calldata invoice,
        bytes32 paymentTxRef,
        PayloadMode payloadMode,
        string calldata uri,
        bytes calldata encryptedPayload,
        bytes calldata issuerSignature
    ) external returns (bytes32 invoiceHash);

    function isNonceUsed(address issuer, uint256 nonce) external view returns (bool);

    function getCommitment(bytes32 invoiceHash) external view returns (
        address issuer,
        address recipient,
        bytes32 paymentTxRef
    );
}

The struct fields MUST appear in the order given in Section 1, so that the ABI encoding of Invoice and its EIP-712 encoding refer to the same fields.

3.2 Behavior

commitInvoice MUST:

  1. Revert unless the caller is invoice.issuer or invoice.recipient.
  2. Compute invoiceHash per Section 2, using the registrar's own chainId and address as the domain.
  3. Revert if isNonceUsed(invoice.issuer, invoice.nonce) is true.
  4. Revert if invoiceHash has already been committed.
  5. Revert if payloadMode is EncryptedOnChain and encryptedPayload is empty, or if payloadMode is OffChain and encryptedPayload is not empty.
  6. Revert unless issuerSignature is a valid ECDSA signature over invoiceHash that recovers to invoice.issuer.
  7. Mark (invoice.issuer, invoice.nonce) as used, record issuer, recipient and paymentTxRef under invoiceHash, emit InvoiceCommitted, and return invoiceHash.

The registrar does not check paymentTxRef, the payment itself, or the line-item invariant of Section 1.4. Those checks belong to the verifier (Section 5).

getCommitment MUST return the recorded values for a committed invoiceHash, and zero values for one that has not been committed.

3.3 Encrypted Payloads

In EncryptedOnChain mode, encryptedPayload carries the invoice encrypted to the recipient. The encryption scheme is implementation-defined; implementations SHOULD use ECIES with the recipient's secp256k1 public key.

3.4 Deployment

A registrar MAY be deployed at the same address on several chains, for example with CREATE2 and a fixed salt. Because the EIP-712 domain includes chainId and verifyingContract, a signature is valid for exactly one registrar instance on one chain.

4. Binding to the Payment Transaction

The paymentTxRef field binds the invoice to its payment. Two binding modes are defined:

Mode A — Same-transaction binding. The commitment call is performed in the same transaction as the payment. paymentTxRef MAY be bytes32(0) and the binding is implicit through transaction inclusion. Because Section 3.2 requires the caller to be the issuer or the recipient, the paying account itself has to make both calls, for example a smart account that batches the transfer and the commitment (ERC-4337, or an account with code delegated under EIP-7702). A commitment routed through a separate batching contract has that contract as its caller and reverts.

Mode B — Post-payment binding. The payment is executed first, and the commitment is submitted in a subsequent transaction referencing the payment's transaction hash. paymentTxRef MUST be the transaction hash of the payment.

Implementations MUST emit InvoiceCommitted regardless of binding mode.

5. Verification Procedure

To verify a committed invoice, a verifier MUST:

  1. Retrieve the invoice (from uri, out-of-band, or by decrypting encryptedPayload).
  2. Compute the invoice hash per Section 2, using the domain of the registrar instance that emitted InvoiceCommitted.
  3. Verify that the computed hash matches invoiceHash in the event.
  4. Verify that issuerSignature recovers to the declared issuer.
  5. Verify that paymentTxRef (or, in Mode A, the containing transaction) transferred paymentAmount of paymentToken from recipient to issuer.
  6. If lineItems is non-empty, verify the invariant of lineItems in Section 1.4.
  7. Confirm, by means outside this ERC, that the issuer address belongs to the expected legal entity (for example via ENS, attestations, ERC-8004 agent identity, or off-chain KYC).

fxRateScaled, fxOracle and fxTimestamp are statements by the issuer. Neither the registrar nor the steps above check them against any price source. A verifier that relies on the fiat value of the payment MUST obtain the rate for fxTimestamp from a source it trusts, and MUST NOT treat fxOracle as evidence that the stated rate is correct.

6. ERC-7730 Clear Signing

Conforming implementations SHOULD publish a companion ERC-7730 descriptor referencing the EIP-712 Invoice type, enabling hardware wallets to render the invoice in human-readable form during signing. A reference descriptor is provided as eip712-VerifiableInvoiceCommitment.json.

Rationale

Why a signed off-chain document + on-chain commitment rather than full on-chain metadata? Commercial invoices contain competitively sensitive information that enterprises will not publish on a public ledger. A commitment-based design preserves privacy by default while retaining cryptographic integrity and auditability. An encrypted on-chain variant is provided for flows where off-chain coordination is infeasible.

Why EIP-712 rather than a raw JSON signature? EIP-712 provides canonical encoding, replay protection via domain separators, and compatibility with existing wallet infrastructure including hardware wallets. The ERC-7730 ecosystem already exists to render EIP-712 messages clearly.

Why a shared registrar rather than per-token extensions? Existing stablecoins will not adopt new transfer semantics. A separate registrar works with any existing ERC-20 and composes naturally with intent-based execution (ERC-7683) and account abstraction (ERC-4337).

Why can only the issuer or the recipient commit? The issuer's signature covers the invoice but not the commitment parameters (paymentTxRef, payloadMode, uri, encryptedPayload). If any account could commit, whoever obtained a signed invoice, from the mempool or from either party, could commit it first with parameters of their choosing; the nonce would then be spent and the invoice permanently bound to the wrong payment. Restricting the caller to the two parties keeps relaying out of the core while still allowing the payer to commit in the payment transaction (Mode A).

Why does the registrar not verify the payment? Checking a payment in Mode B would require the registrar to inspect another transaction, which a contract cannot do. Keeping the registrar to signature, nonce and payload checks makes it cheap and chain-agnostic; payment verification is done once, by the party that relies on it.

Why opaque regulatoryData rather than jurisdiction-specific fields in the core? Fiscal regulations evolve at legislation pace, not EIP pace. Argentina's CAE, Mexico's UUID/PAC, Italy's Codice Destinatario have little structural overlap. Encoding them all in the core would produce a brittle spec unlikely to achieve consensus. Deferring jurisdictional detail to companion ERCs enables independent iteration.

Why milli-units for fiat amounts? Fiat currencies have varying decimal conventions (2 for USD, 0 for JPY, 3 for KWD). Milli-units provide uniform integer precision sufficient for all ISO 4217 currencies without floating-point ambiguity.

Why rateBps for tax rates? Basis points (1/10,000) match tax regulator conventions globally and avoid precision loss.

Why is lineItems in the core? Compliance with virtually all fiscal regimes requires line-level itemization for tax discrimination. Permitting empty arrays retains simple-case ergonomics. The gas cost of an empty array is negligible.

Why "Commitment"? A commitment scheme binds to a value while optionally concealing it, which is what the registrar records: a hash that binds the invoice without revealing it. The term "anchor", also common for this pattern, is used with unrelated meanings elsewhere in the ecosystem.

Backwards Compatibility

This ERC does not modify any existing token standard and introduces no changes to ERC-20, ERC-721, ERC-1155, or any transfer semantic. Existing tokens, wallets, and indexers continue to operate unchanged. Integration is opt-in.

This ERC is composable with:

  • ERC-7699: the invoiceHash can be placed in its reference field.
  • ERC-3009: the invoiceHash can serve as nonce in transferWithAuthorization.
  • ERC-4337: commitment calls can be bundled with payment operations via UserOperation.
  • ERC-7943: an invoice can be committed for an RWA transfer that passed canTransfer; the issuer or the recipient makes the commitment, not the token contract, since canTransfer is a view function.
  • ERC-7730: clear signing of the Invoice typed data is the recommended UX path.

Test Cases

The following invoice, signed for the registrar at 0xa8C5b7D5B413297343ca6CeCe3931F9770D7A2FD on chain 11155111, produces the values below. The full invoice and domain are in test-vector.json.

ValueResult
typeHash0x9f807503c28d7e2aca336a6a1a70e5ce8512b7f3314da29f812957e2b3997574
domainSeparator0x7d92991a7c2365e9c68a0cef52d2edf5eef6ff82355c08df61ee340630c89761
structHash0x8b5b2d1626d799b1be68f651a41cfc8e1210e577ec302a0f376c161a683e6961
invoiceHash0x39b7fedd202c012cb1a08293839b6a85cfc4ec86bc2edf359630af1b0cfd3ba1

The invoice has one line item of 1,000.000 USD and one 21% tax entry of 210.000 USD, so fiatAmountMilliUnits is 1210000 and the invariant of Section 1.4 holds.

Reference Implementation

A reference registrar is provided in InvoiceCommitmentRegistry.sol, with the struct definitions in InvoiceCommitmentTypes.sol and the EIP-712 hashing in InvoiceHasher.sol. It depends on the OpenZeppelin EIP712 and ECDSA libraries. Its hashInvoice function returns the invoiceHash of Section 2 and reproduces the test vector above.

Security Considerations

Signature replay across chains or contracts. The EIP-712 domain separator binds signatures to a specific chainId and verifyingContract.

Replay of the same invoice. The nonce field combined with the isNonceUsed check prevents the same signed invoice from being committed twice. An issuer that reuses a nonce cannot commit the second invoice.

Impersonation. The registrar validates the EIP-712 signature against the declared issuer, which proves control of the address but not the legal identity behind it. Step 7 of Section 5 covers that link.

Unsigned commitment parameters. paymentTxRef, payloadMode, uri and encryptedPayload are chosen by the caller and are not covered by the issuer's signature. Section 3.2 limits the caller to the issuer and the recipient, so a third party holding a signed invoice cannot commit it. Either party can still commit it with a paymentTxRef the other did not expect; such a commitment fails step 5 of Section 5 rather than verifying against the wrong payment. Issuers that need to control these parameters should commit the invoice themselves rather than handing the signed invoice to the recipient before payment.

Payment-invoice mismatch. The registrar does not enforce that paymentTxRef actually transferred the declared paymentAmount. An invoice that is committed but whose payment was never checked proves only that the issuer signed it.

Issuer-stated exchange rates. An issuer can state any fxRateScaled and name any fxOracle. A verifier that accepts these values without checking them can be led to book the wrong fiat amount.

Contract-account issuers. Signature validation is ECDSA only, so an issuer must be able to produce an ECDSA signature for its address. Contract accounts that sign through ERC-1271 are not supported by this version.

Encrypted payload confidentiality. Long-term confidentiality of on-chain ciphertext cannot be guaranteed against future cryptanalytic advances.

Loss of decryption key. In EncryptedOnChain mode, loss of the recipient's private key renders the invoice permanently unrecoverable. Recipients should maintain out-of-band backups.

Off-chain availability. In OffChain mode, the invoice lives at the discretion of the issuer. Recipients should retrieve and store their own copy upon receipt.

Tax calculation integrity. The invariant of Section 1.4 is a data-integrity check. It does not validate legal correctness of tax rates or classifications.

On-chain observability. The commitment event publicly discloses issuer, recipient, and paymentTxRef. Counterparty privacy techniques (stealth addresses per ERC-5564, privacy pools) operate orthogonally.

GDPR and right-to-erasure. In OffChain mode, fiscal identifiers do not appear on-chain; the commitment is only a hash. Erasure of the off-chain document leaves a hash without a recoverable preimage. Whether that satisfies a right-to-erasure request is a legal question outside the scope of this ERC.

Nonce correlation. Monotonic nonces reveal issuance volume to chain observers, which is why Section 1.4 recommends random nonces.

Copyright and related rights waived via CC0.

EIP.tools

EIP.tools

Search, read, and map Ethereum improvement proposals, ERCs, RIPs, and CAIPs from one focused interface.

Farcaster
by @apoorveth