Case studies

Protocols at work.

Payment problems, each solved with a protocol Badger published: in a federal food program, at store counters in Saipan, and in a lottery whose operator cannot rig the draw.

Public sectorNorthern Mariana Islands2024Completed
Public money, accounted for to the cent

A federal food program, run on a public ledger

Feeding Marianas bought 196,317 pounds of local produce and 1,439 dozen eggs from 149 producers, for families in underserved communities. Badger provided the software for onboarding, payments, the supply chain, and tracking and accounting, all of it on the eCash blockchain.

The Feeding Marianas Food Purchase Program was funded by a grant from the US Department of Agriculture. It buys nutritious food from local producers and distributes it to individuals and families in underserved communities. Badger delivered the system under a sub-award from the CNMI Department of Commerce, and in conjunction with it.

A purchase takes a few seconds, and the video shows one. At a market, a producer’s bananas are weighed and a staff member scans the producer’s code with a phone. They choose “Buy from Producer”, pick banana, which is priced at $1.50 a pound, and enter the weight, 201 pounds. The producer is paid $301.50 on the spot, in a token worth one US dollar. The market’s balance now reads in pounds: 186 pounds of mango, 201 of banana. Each pound bought is recorded from that point on.

Both sides of the trade live on the same ledger, so the money and the food can be followed together. Payments use the Simple Ledger Payment Protocol. When a producer turns tokens back into dollars, the tokens are burned under the SLP Burn specification, which records that they left circulation on purpose and not through an error.

The books close exactly. $296,879.02 in dollar tokens was issued, $296,879.02 was redeemed, and none remains in circulation. Eight markets bought produce worth $297,116.89 across 20 kinds, led by watermelon (36,740 pounds), avocado (35,458) and banana (31,403). The USDA’s summary of the program expected it to benefit up to forty-five producers, and it paid 149.

Each purchase, payment and redemption was written to the ledger when it happened. The totals on this page are read from that ledger, and anyone can read them.

Simple Ledger Payment ProtocolSLP Token Type 1 Burn
A market buys bananas from a producer, May 2024
Funded by
US Department of Agriculture
In conjunction with
CNMI Department of Commerce
Producers paid
149
Markets
8
Food bought
196,317 lb of produce and 1,439 dozen eggs
Dollar tokens
$296,879.02 issued, all redeemed
RetailSaipan, Northern Mariana IslandsJune 13, 2020Completed
Checkout a customer can trust

A dollar token at the hardware store counter

A customer at Hong Ye Hardware pays 3.79 USDH for a packet of watermelon seeds by scanning one QR code. It is believed to be the first real-world purchase in USDH made with the Simple Ledger Payment Protocol.

The store rings up the sale on a phone, which shows a QR code. The customer scans it with Badger Wallet and sees a payment request: the token, the amount, the name of the store and a countdown. One swipe pays it. The store’s phone confirms, and the customer walks out with the seeds.

The Simple Ledger Payment Protocol is what makes that exchange safe as well as quick. The wallet fetches a request from the merchant instead of sending coins to an address copied from a screen. It shows the customer who is asking and for how much, then hands the finished transaction back to the merchant. That closes the gap an attacker would otherwise use to swap in a different address, and it lets the store know it has been paid without waiting on the network.

USDH, since retired, was a token pegged to the US dollar, so neither side carried any price risk for the few seconds the sale took.

Simple Ledger Payment Protocol
Video by Crypto Frontier
Merchant
Hong Ye Hardware
Paid
3.79 USDH (HonestCoin)
Point of sale
SLP Merchant
Wallet
Badger Wallet
HospitalitySaipan, Northern Mariana IslandsJune 22, 2020Completed
No second coin for fees

Paying in dollars, with no coin for the fee

A 12 USDH bill at Oleai Beach Bar & Grill is paid from a wallet that holds no Bitcoin Cash. It was the first purchase made at a point of sale that uses the Simple Ledger Postage Protocol.

Until this sale, anyone paying with a token also had to hold some of the network’s native coin to cover the transaction fee, much as a user of Ethereum needs “gas”. A dollar token sent to a new wallet could not be spent until its owner went and found some Bitcoin Cash as well.

The Simple Ledger Postage Protocol removes that requirement. The customer’s wallet builds a transaction that pays the bar, and adds a small extra output, in the same token, for a “post office”. The post office attaches the coins that cover the network fee and broadcasts the transaction, so the fee is paid in dollars.

In the video the wallet shows a Bitcoin Cash balance of zero and a USDH balance of 18.41. The customer scans the bar’s code, approves a request for 12 USDH, and the point of sale shows the bill as paid. A wallet built this way needs to hold only the currency its owner spends.

Simple Ledger Postage ProtocolSimple Ledger Payment Protocol
Video by Crypto Frontier
Merchant
Oleai Beach Bar & Grill
Paid
12 USDH (HonestCoin)
Point of sale
Crypto Frontier POS
Wallet
Badger Wallet, Saipan Edition
RetailSaipan, Northern Mariana IslandsFebruary 2022Completed
Fiat checkout, stablecoin settlement

The customer pays by PayPal. The store is paid in stablecoin.

At CanaMarianas, a cannabis retailer in Saipan with “cash only” signs on its counter, a customer pays the way they would online. The store receives BUX, a stablecoin that was pegged to the US dollar, minted in the customer’s own wallet moments before.

The customer starts with an empty wallet: no BUX, and none of XEC, the native coin of the eCash network. Scanning the code on the store’s terminal opens the wallet in the phone’s browser, with nothing to install. The wallet leads to bux.digital, the token’s site at the time, to buy 8 BUX, the Badger Universal Token. The customer pays for them by PayPal. Back in the wallet a “Mint Tokens” button appears. One press mints the tokens, the wallet pays the store, and the terminal shows the sale as paid.

For the customer this is an ordinary payment, made with an account they already have. They do not need to own any cryptocurrency beforehand, or to understand that one is involved. For the store it is a payment in a dollar stablecoin, received directly from the customer’s wallet, so the amount on the terminal is the amount it holds. The store otherwise takes only cash.

The Self Mint protocol is what joins the two halves. In the usual model an issuer creates tokens, holds them, and sends them out. Here the tokens do not exist until the customer has paid for them, and the issuer never holds them. Each issuance is a covenant transaction that the customer’s wallet builds, signs and broadcasts, assigning the new tokens to the customer’s own address. The issuer’s part is limited to an authorization code, good for one transaction and one amount.

Two more protocols complete the sale. The Postage Protocol means the wallet needs no XEC to pay the network fee, and the Payment Protocol carries the request and the payment between the customer and the store. All of it ran on Badger’s software: the bcash node, a fork of the Cashtab web wallet, and the SLP Merchant point of sale for Android. BUX has since been retired. The three protocols remain published.

SLP Self Mint TokenSimple Ledger Postage ProtocolSimple Ledger Payment Protocolbcash
Video by Cyprian
Merchant
CanaMarianas
Paid
8 BUX (Badger Universal Token)
Point of sale
SLP Merchant for Android
Wallet
Cashtab web wallet, Badger fork
GamingNorthern Mariana Islands2026In testing
Fair play lottery without trusting the operator

A provably fair lottery, played in dollars

Block Lotto is a lottery whose operator cannot choose the winners or hold back a prize. Players buy tickets with USDC, the draw is the hash of a block that has not been mined yet, and a script on the chain pays the win. Developed by Marianas Rai Corp, it is running on test networks at lotto.nmrai.com.

A player logs in with an email address, a phone number, a Google account or an Ethereum wallet they already use. There is no seed phrase to write down. They buy between 1 and 20 tickets with USDC, and about a minute later the tickets exist on eCash. Once a ticket’s block has been mined the player redeems it. A win is paid in wUSDC, a dollar token on eCash, which can buy more tickets or be cashed out to USDC in the player’s own Ethereum wallet.

Under the Block Lotto protocol, a ticket’s result is fixed the moment its block is mined, by hashing the block’s hash together with the ticket’s own transaction id. Nobody can know that hash when the ticket is sold. The operator commits to the pay table and the top prize before the draw, and after that has no say. A covenant script pays the prize, and the transaction that collects it is built and signed in the player’s browser.

The money moves over bbridge. Deposits are held by a contract on Ethereum, which is the only thing that can release them. Each wUSDC coin is valid only if its history leads back to a mint backed by a deposit, and players’ own software checks that. If the bridge never issues tickets for a deposit, the player can take the USDC back from the contract without anyone’s permission.

The page runs a bcash light client inside the browser tab, connected to the eCash network directly. It proves that each ticket is in its block before showing it, and traces each coin’s history before counting it toward the balance, so it does not depend on a server’s account of the chain.

All of this works end to end today on eCash’s test network and Ethereum’s Hoodi test network. A launch on the main networks is coming soon.

Visit lotto.nmrai.com
Block LottobbridgeSLP Token Type 2bcash
The Block Lotto home screen: a prize pool, a grid of 25 numbers with four chosen, and a Buy button.
The home screen after logging in, with sample figures
Developer
Marianas Rai Corp
Status
Live on test networks
The draw
The hash of a block not yet mined when the ticket is sold
The payout
Paid by a covenant script, in wUSDC