Inspiration
Plenty of brands run stores in more than one country, but their loyalty programs stop at the border. Points you earn at a coffee chain at home are often useless at the same chain abroad, because each country is run by a different operator with its own program, its own currency, and its own accounting books. Letting points cross over would mean those operators settling with each other across borders, which is slow and expensive with bank transfers. So most brands don't do it.
We wanted a traveller's points to simply work abroad, and the shop abroad to be paid for them immediately in real money, with no reconciliation at the end of the month.
What it does
Yonder is a shared rewards network for a brand's operators in different countries. In our demo the brand is Treehouse: Treehouse Supply Co. sells online in the US, and Treehouse Café is a shop on Orchard Road in Singapore.
- Earn at home. A customer buys from Treehouse Supply Co. online and earns 1 point per dollar. Every point is backed by USDC held in a vault on Arc, paid for out of that operator's reward budget.
- Spend abroad. At Treehouse Café, the cashier rings up the order and shows a 6-character code. The customer enters it in the app and pays with their points; if they don't have enough, the rest goes on their card. The points are burned and the USDC behind them goes straight to the café's operator in the same transaction. The cashier's screen turns green and the brand's payouts dashboard updates live.
- Always fully backed. One point is always worth exactly one US cent:
$$1 \text{ point} = \$0.01 \text{ USDC}$$
At every moment, the vault holds exactly enough USDC to cover all budgets and all outstanding points:
$$\text{USDC in vault} = \sum_{b \,\in\, \text{brands}} \text{budget}_b \;+\; \text{points outstanding} \times \$0.01$$
Anyone can check this onchain with isFullyBacked().
Example from our demo: a customer spends \$150 at Treehouse Supply Co. and earns 150 points. In Singapore they order a kopi for S\$1.35. At 1.35 SGD per USD that's \$1.00, so 100 points. The café's operator receives \$1.00 USDC in the same block, and the customer has 50 points left.
How we built
- Smart contracts (Solidity, Foundry, OpenZeppelin), deployed on Arc testnet:
PointsToken($YON) is a whole-number token that only the vault can mint or burn. Customers can't transfer it to each other, so points can't be traded or farmed.RewardsVaultholds the USDC. Each operator funds a reward budget, the network issues points from that budget, andspendAtBrandburns points and pays the operator's settlement address in the same transaction. Each order ID can be paid only once.- Vault:
0x14a418200Ead51F6304eC090A5867f7552A76584. - Token:
0xfc7f3FcDc7b09291C7F3df1a6FcCc953f3460DFa.
- Backend (Python, FastAPI, web3.py, SQLite): seven API endpoints that the frontend calls, and the only part of the system that holds keys or talks to the chain. It converts purchase amounts into points, calls
issueRewardfrom the network wallet (topping up a brand's budget withfundBrandif it runs short), and sendsspendAtBrandfrom the customer's own wallet, so only the customer's own points can ever be burned. A watcher readsSpentevents from the chain to mark orders paid and record operator payouts. - Frontend (Next.js, React, Tailwind): the customer app (points balance, activity, store finder, online shop, pay-in-store), plus two demo screens: the café's cashier, which shows the order code and turns green when paid, and a brand payouts dashboard.
- Wallets: for the demo, the backend manages a wallet for each customer and covers their gas, so customers never see keys or tokens. In production these will be Circle developer-controlled wallets, with Circle Gas Station paying fees.
- Arc: USDC is Arc's gas token, so the network's costs are in dollars rather than a volatile token, and settlement between operators is plain USDC.
Challenges we ran into
- Units and rounding. On Arc, USDC as the gas token uses 18 decimals, but its ERC-20 interface uses 6. Points have 0 decimals, and prices are in local cents. We put every conversion in one module and always round down: purchases earn whole points ($50.99 earns 50), and converting a local price to USD never rounds in the network's favor. The contract itself never rounds: it always moves exactly points × $0.01.
- Keeping the backing exact. It's easy to claim every point is backed, but proving it was harder. We wrote a fuzzed invariant test that makes around 12,800 random fund, issue and spend calls across brands and users, and checks after every call that the vault's balance matches its liabilities exactly.
- Never charging twice. A cashier's order could be paid twice if two phones submit the same code at once. The backend claims the order in the database before sending the transaction, and the contract refuses any order ID that has already been paid.
- Tooling. We hit Solidity's "stack too deep" error in the deploy script and restructured it around a struct and storage variables.
Accomplishments that we're proud of
- A seamless customer experience that hides the blockchain entirely: no seed phrases, no gas tokens, just points that work abroad.
- 35 contract tests, including a full run of the demo and the fuzzed invariant test showing the vault is always exactly backed, plus 25 backend tests.
- A smoke test that runs the whole demo against Arc testnet with real transactions: earning in the US, paying in Singapore, and paying out the café's operator.
- A payment between operators in two countries that settles in one block, with no bank in the middle.
- A fake-chain mode that let us build the frontend, backend and contracts in parallel and switch to the live contracts by changing one setting.
What we learned
- How to design a token whose value is guaranteed by the contract's own accounting, instead of by promises.
- How useful a stablecoin used as gas is for business apps: costs stay predictable, and settlement is in the same currency as the business.
- Writing invariants first changes how you design. Once we stated the backing equation, many design choices followed from it, such as banning transfers and making order IDs pay-once.
- Where to draw the line between onchain and offchain: money movement and backing live in the contract, while exchange rates, minimums and the user experience live in the backend, where they're easy to change.
What's next for Yonder
- Circle wallets and Gas Station, replacing our demo wallets so customer keys are held by Circle and fees are sponsored.
- Real payouts and payments: convert operators' USDC into local currency, and process the card portion of a bill for real. Both are mocked in the demo.
- Point-of-sale integrations so operators accept $YON at their existing checkout.
- Coalitions: let separate brands accept each other's points on agreed terms.
- Mainnet, with audited contracts.