Trustless Local Exchange Trading Systems (LETS)
A fully decentralized LETS design on Ergo: no trusted membership, on-chain rules, and collateral-backed balances.
Introduction
A Local Exchange Trading System (LETS) involves several participants who agree to use a form of "local currency," typically pegged to the national currency at a 1:1 ratio. Each participant has an account holding their LETS balance. New members start with a balance of zero. The sum of all users' LETS balances is always zero at any given moment.
Example: Alice (0) buys milk from Bob (0) for 2 Euros. Alice's balance becomes -2, Bob's +2. Bob can spend his balance with other members. All balances always sum to zero.
In a trustless LETS, there is no trusted group to authenticate users. A committee may only define parameters (currency, max members, fees). All rules are enforced on-chain.
Trusted Pricing Oracle
A trusted pricing oracle provides the current conversion rate of euros to ergs, identified by a global id (rateTokenID). The oracle operates through a singleton box containing the rate, updated by spending and recreating the box.
Token Box & Membership Tokens
The LETS is defined by a global token box holding membership tokens (letsTokenID). Initially, the box contains all tokens. When a user joins, they receive a membership token in a new LETS box; the token box is updated with the remaining tokens.