On-chain Verification

The exact rules used to accept or reject a payment.

The backend does not blindly trust frontend success messages, wallet UI, or a client-provided transaction status. It fetches the transaction and its receipt from the RPC and evaluates them with a deterministic rule set.

  1. 1Fetch the transaction by hash from the RPC
  2. 2Fetch the transaction receipt and the current block number
  3. 3Reject if the chain ID does not match the invoice
  4. 4Reject if the token is not the trusted VERSE contract
  5. 5Reject if the transaction does not exist or reverted
  6. 6Decode ERC-20 Transfer logs from the receipt
  7. 7Sum transfers to the merchant wallet
  8. 8Reject if nothing was sent to the merchant wallet
  9. 9Require the configured number of confirmations
  10. 10Compare the received amount to the invoice total (exact / under / over)
Confirmation threshold (production)
VERSE_REQUIRED_CONFIRMATIONS=30
An invoice should only transition to PAID after successful server-side verification. The 30-confirmation threshold is probabilistic finality on Polygon, not the Ethereum checkpoint.
On-chain Verification — VerseBill Documentation