Data flow: from receipt to bINT
1.3 Data flow: from receipt to bINT
A receipt's journey runs in two phases.
Phase A — Synchronous (the user is waiting):
- The client sends the file to the upload endpoint. The server compresses the image, strips EXIF metadata, and stores the result in object storage. A perceptual-hash deduplication index is checked before analysis.
- For image input, the vision LLM (02 Stage 2) reads the receipt directly from the image in a single call. For PDF input, an OCR layer (02 Stage 1) first extracts the text, which then feeds the same LLM stage.
- The LLM returns labeled plain text: a block of
FIELD: valuelines for merchant, date, totals, and payment fields, plus a pipe-separated table for line items. Parsing is defensive — a missing or malformed line leaves that fieldnulland the pipeline continues. - The regex/rule layer (02 Stage 3) reconciles totals and validates dates.
- The merchant resolver (02 Stage 5) attaches a merchant identity.
- The trust layer (03) classifies the receipt's quality, and the reward is computed within the same request, so the user sees the verified preview and the reward together.
Phase B — Asynchronous (background settlement):
- A background post-process worker resolves each line item to a canonical product ID (02 Stage 4) using database-side fuzzy matching with an LLM fallback, and folds the receipt's quality classification into the user's cumulative trust score.
- The settlement worker aggregates eligible bINT credits, applies daily ceilings, and produces an epoch distribution root for the corresponding INT claims.
- The distribution root is committed on-chain. The indexer confirms INT claim transfers from the distributor back to the off-chain ledger.
The user sees Phase A in seconds. Phase B finalises asynchronously. The off-chain bINT ledger remains the source of truth for contribution credits; the on-chain root and claim transfers record the corresponding INT distribution.