ERC-8342 Verifiable invoice commitments (Verifiable Invoice Commitment (VIC))

Draft · Other · created 2026-04-26

A standard that signs invoice information such as tax and transaction details with EIP-712 for stablecoin payments, binding it by hash to the on-chain payment so it can be independently verified.

Why it is needed

Stablecoins are increasingly used for commercial payments such as cross-border remittances and machine-to-machine commerce, but there is no standardized form in the EVM ecosystem for accounting information like invoices, which always accompany traditional payments. Reconciling a transaction hash with the invoice it settles remains a private off-chain matter between the parties, so audit trails are fragmented and tax authorities, auditors, and counterparties cannot independently match and verify payments against invoices. Fields such as ERC-7699's bytes reference and ERC-223/ERC-777/ERC-1363's bytes data allow arbitrary memos to be attached, but they do not standardize the semantic structure, and payment request URIs like ERC-681/ERC-7856 are pre-payment metadata only and are not retained on chain.

What to implement

In depth

EIP-712 Invoice typed data structure

Invoice consists of the fields invoiceId, issueDate, dueDate, paymentTerms, purchaseOrderRef, issuer, issuerTaxId, recipient, recipientTaxId, paymentToken, paymentAmount, fiatCurrency, fiatAmountMilliUnits, fxRateScaled, fxOracle, fxTimestamp, taxes, lineItems, jurisdiction, regulatoryData, and nonce. TaxIdentity represents tax identity with scheme and id, TaxEntry represents a tax line with taxType, taxScheme, rateBps, baseAmountMilliUnits, and taxAmountMilliUnits, and LineItem represents a line unit with description, quantityScaled, unit, unitPriceMilliUnits, lineTotalMilliUnits, and taxRefIndex. If lineItems is non-empty, the sum of lineTotalMilliUnits plus the sum of taxAmountMilliUnits must equal fiatAmountMilliUnits. Fiat amounts are expressed in milli-units, where 1 milli-unit equals 0.001 fiat units, and fxRateScaled is expressed as the fiat value per one token multiplied by 10^8.

invoiceHash computation

invoiceHash is an EIP-712 signing digest: typeHash is the keccak256 of encodeType(Invoice), structHash is the keccak256 of typeHash concatenated with encodeData(invoice), and invoiceHash is the keccak256 of the 0x1901 byte prefix concatenated with domainSeparator and structHash. domainSeparator consists of name "VerifiableInvoiceCommitment", version "1", chainId, and verifyingContract (the registrar address), so the same signature cannot be reused on a different chain or a different registrar instance.

The 7-step verification in commitInvoice

commitInvoice checks that the caller is invoice.issuer or invoice.recipient, computes invoiceHash using the registrar's own chainId and address, reverts if isNonceUsed(issuer, nonce) is true, reverts if the invoiceHash has already been committed, reverts if payloadMode and the presence of encryptedPayload do not match, and reverts if issuerSignature fails to recover issuer as a valid ECDSA signature over invoiceHash. If all checks pass, it marks the nonce as used, records issuer, recipient, and paymentTxRef, emits InvoiceCommitted, and returns invoiceHash. The registrar does not check paymentTxRef, the actual payment, or the line item totals.

Payment binding modes

Mode A (simultaneous binding) performs the payment and the commitment in the same transaction, allowing paymentTxRef to be left as bytes32(0); the payer must make both calls themselves, as with an ERC-4337 smart account or an account delegated via EIP-7702. Routing through a separate batching contract would make that contract the caller, causing a revert. Mode B (post-hoc binding) executes the payment first, then commits in a separate transaction by designating the payment transaction hash as paymentTxRef.

The 7-step verification procedure

The verifier must obtain the invoice via a uri, off-chain, or by decrypting encryptedPayload; recompute invoiceHash using the domain of the registrar instance that emitted the event; confirm it matches the event's invoiceHash; confirm issuerSignature recovers to the declared issuer; confirm that paymentTxRef (or the corresponding transaction in Mode A) transferred paymentAmount of paymentToken from recipient to issuer; if lineItems are present, confirm the amount-total invariant; and confirm, by means outside this ERC such as ENS, attestations, ERC-8004 agent identity, or off-chain KYC, that the issuer address belongs to the actual legal entity. fxRateScaled, fxOracle, and fxTimestamp are merely claims by the issuer and are not verified by the registrar or the above procedure, so a verifier who wants to trust the fiat value must separately confirm the exchange rate from a source they trust.

ERC-7730 clear-signing integration

It is recommended that implementations also publish an ERC-7730 descriptor referencing the EIP-712 Invoice type, so hardware wallets can display invoice content in human-readable form at signing time.

Why only the issuer or recipient can commit

The issuer's signature only covers the invoice itself; commitment parameters such as paymentTxRef, payloadMode, uri, and encryptedPayload fall outside the scope of the signature. If anyone could commit, a third party who obtained the signed invoice, for instance from the mempool, could commit first with arbitrary parameters, exhausting the nonce and permanently binding the invoice to the wrong payment. Restricting the caller to the issuer and recipient prevents this kind of front-running while still allowing Mode A, where the payer commits directly within the payment transaction. The registrar's decision not to verify the actual payment follows the same logic: because checks like Mode B's, which must reference a separate transaction, cannot be performed by the contract itself, it is designed to handle only the signature, nonce, and payload checks, leaving payment confirmation to be performed once by whichever party relies on it.

Standard status

This ERC is in Draft status, proposed in April 2026, and is still under review and discussion; details may change or the proposal may stall.

Things to watch out for

Original ERC · ← ERCs