Tax Lab · Illicit financial flows
Stamp to Arrival
A published matching engine, a revenue range and a private stamp check: how two revenue authorities could verify that excise-relieved exports arrived, without a single taxpayer's records crossing the border.
A practical extension of Can the Stamp Cross the Border? It builds Tier 2 and demonstrates Tier 1 of the paper's proposed verification protocol. Every figure is computed in your browser or at build time from the paper's own inputs.
Uganda's neighbours recorded 44 per cent of the stamped-goods exports Uganda says it sent them between 2015 and 2025. Today nobody can say which part of the rest is a recording gap and which part is goods that never arrived. Run on the same data, the matching engine below sorts 403 product-partner-years and raises 121 notices. At Uganda's own effective excise rates, the exports with no matching arrival carry US$52.8 million to US$129.2 million of excise over 2020 to 2025.
Tier 2: matching exports to arrivals
Each tile is one destination, product and year. The engine compares what Uganda declared for export with what the destination recorded as arriving, on weight where both sides give one and otherwise on value net of the CIF-FOB margin. A gap outside the tolerance and above the materiality threshold raises a notice. Where the partner filed nothing, the tile says so: a data gap, not a mismatch.
Change the rules, narrow the destinations, products or years, and every count recomputes. Select any tile, or move with the arrow keys and press Enter, to see the engine's reasoning step by step, the ratio on both weight and value, unit values on each side, and the same flow in every year. Below the matrix, the flows are ranked the way an auditor would work through them. The rules you set are kept in the page address, so a link reproduces exactly what you see.
121 notices on 403 product-partner-years in view: 105 shortfalls, 6 with no arrival record, 10 excess arrivals; 100 matched; 81 below materiality; 101 data gaps, not mismatches. Shortfall and no-arrival notices cover US$555m of declared exports.
A sheet of stamps for each neighbour. Each stamp is US$10 million of exports Uganda declared in the years and products selected, coloured by what the destination recorded. Select a sheet to open the corridor below.
- Shortfall
- No arrival record
- Excess arrival
- Matched
- Gap below materiality
- No partner data
- One stamp = US$10 million, rounded; exact values in the tooltip and the table.
Each stamp is one product in one year; its size is the value Uganda declared. Its colour is what DR Congo recorded against it: red short, grey level, blue over. A postmark marks a notice. Select a stamp for the reasoning.
Declared exports, this corridor
Recorded arrivals ÷ declared exports
Outlined: the tolerance band, ±25%.
- Postmark: a notice
- No arrival record
- No partner data
- Faded: gap below materiality
Select a stamp to see the engine's reasoning, both comparison bases, unit values and the same flow in every year.
Where an auditor would start
Each destination and product as one flow across the years in view, ranked. A flow that falls short year after year is a better lead than a single large gap, which timing alone can produce. Click a flow to open its latest notice.
| # | Flow | Excess arrivals | Pattern | |||
|---|---|---|---|---|---|---|
| 1 | 10 of 11 | 10 | US$189m | |||
| 2 | 10 of 11 | 10 | US$120m | |||
| 3 | 10 of 11 | 10 | US$102m | |||
| 4 | 10 of 11 | 10 | US$46.06m | |||
| 5 | 9 of 11 | 6 | US$26.68m | |||
| 6 | 3 of 9 | 2 | US$16.48m | |||
| 7 | 3 of 11 | 1 | US$12.77m | US$21.32m | ||
| 8 | 8 of 11 | 8 | US$6.53m | |||
| 9 | 10 of 11 | 9 | US$6.09m | |||
| 10 | 4 of 9 | 4 | US$5.01m | |||
| 11 | 3 of 6 | 3 | US$4.89m | |||
| 12 | 4 of 11 | 3 | US$3.74m | |||
| 13 | 1 of 6 | 1 | US$2.75m | |||
| 14 | 3 of 9 | 2 | US$2.41m | US$822.4k | ||
| 15 | 2 of 9 | 1 | US$2.05m | |||
| 16 | 5 of 11 | 3 | US$1.41m | |||
| 17 | 1 of 6 | 1 | US$1.32m | |||
| 18 | 4 of 11 | 2 | US$1.24m | |||
| 19 | 3 of 9 | 1 | US$1.24m | US$1.16m | ||
| 20 | 3 of 9 | 1 | US$856.2k | |||
| 21 | 2 of 9 | 2 | US$532.0k | |||
| 22 | 2 of 9 | 2 | US$461.2k | |||
| 23 | 1 of 9 | 1 | US$455.1k | |||
| 24 | 1 of 1 | 1 | US$375.8k | |||
| 25 | 1 of 5 | 1 | US$331.4k | |||
| 26 | 1 of 5 | 1 | US$157.4k | |||
| 27 | 1 of 2 | 1 | US$138.8k | |||
| 28 | 1 of 7 | 1 | US$118.4k | |||
| 29 | 2 of 10 | 0 | US$0 | US$266.0k | ||
| 30 | 3 of 9 | 0 | US$0 | US$709.7k |
The published rules are a tolerance of ±25 per cent, materiality of US$100 thousand, a CIF-FOB margin of 10 per cent and suppression below 10 producers. These records are public UN Comtrade statistics, so no cell here needs suppression; with administrative data the producer count would apply. The same rules run in Stata (scripts/stata/stamp_to_arrival_match.do), and a test fails if the two engines ever disagree on a single cell under the published rules.
What the unmatched exports carry
Extension, not in the paper. A modelled range, not an estimate of smuggling.
Goods declared for export are relieved of Ugandan excise. If they were in fact consumed at home, Uganda forgoes that excise. The shortfall is valued at Uganda's effective rate, excise declared over value declared on URA's returns from November 2024: spirits 49.3 per cent, wine 41.1 per cent, beer 26.7 per cent, soft drinks 11.6 per cent, bottled water 11.5 per cent, sugar 2.2 per cent. The rates for cigarettes and cement are suppressed in the released aggregates (fewer than ten firms in some months), so by default those goods add to the trade shortfall but carry no excise, and every bound understates. You can enter your own rate for them; the page then shows how much of the total rests on it.
The lower bound counts only flows both sides recorded, at a 5 per cent CIF-FOB margin. The central figure uses 10 per cent and adds exports with no import record in years the partner did report imports from Uganda. The upper bound uses 15 per cent and adds every unmatched export. Compare the years before and after the stamp, switch between excise and the trade shortfall, and select a corridor for its products. Where the goods entered the neighbour undeclared, the neighbour lost revenue too, at its own rates.
- Printed: up to the lower bound
- Unprinted: on to the upper bound
- Postmark: the central estimate, labelled at the strip's end
- One stamp = US$5 million.
Select a corridor to see each product's shortfall, the rate applied to it and where that rate comes from.
Tier 1: checking a stamp without seeing the register
Synthetic codes. This shows the mechanism, not Uganda's register.
A Kenyan officer holding a bottle with a Ugandan stamp needs one answer: is this code genuine, and is it for this product? A blinded lookup gives it. Uganda blinds its register once under a secret key; the officer blinds the code under a one-time key; Uganda answers without learning which code was asked; the officer learns validity, product class and issuer, and nothing else about the register.
Three frauds can be caught this way. A forged code is not on the register. A genuine stamp moved from cheaper goods comes back with the wrong product class. A cloned stamp, the same code printed on many items, gives the officer the same match key every time it is checked, even though Uganda sees a different random value on each query. Check single stamps, or scan a whole truck with a mix of frauds you choose. All the arithmetic runs in your browser on 2048-bit numbers.
Mechanism demonstration · synthetic codes · no real register
Pick a register size. Uganda raises every code to its secret key and shares only the results, each with its product class. A larger register shows how the cost grows; a production system would use elliptic curves and be far faster.
Reading this carefully
A notice points an audit at a flow. It is not a finding against any person. Annual Comtrade data mix timing differences, re-exports, misclassification and missing reports into every gap; monthly administrative records exchanged between two revenue authorities would remove most of that noise. South Sudan and DR Congo report little to Comtrade, so many of their tiles are data gaps.
Sources
- Kaijamahe, W.H. (2026) Can the Stamp Cross the Border? Excise Smuggling, Fiscal-Marking Data and Articles 3(2) and 11 of the Draft UN Tax Convention, ICTD workshop draft, November. Not for citation or circulation without the author's permission.
- UN Comtrade Database, HS 2402, 2203, 2208, 2204, 2201, 2202, 1701 and 2523, 2015-2025, downloaded 13 October 2026.
- URA Research Lab, released category-month aggregates of excise returns (cells with fewer than ten firms suppressed).
- RFC 3526, More Modular Exponential (MODP) Diffie-Hellman groups, group 14, for the stamp check demonstration.
- Engines and tests: lib/stampToArrival.ts, lib/stampBorder.ts and lib/stampCheckDemo.ts, with their test files.