Inspiration
For five thousand years, civilization has answered one question to decide who gets economic access: do you have money?
If yes, you get credit, loans, opportunity. If no, you stay out.
1.3 billion adults have no bank account. They are not untrustworthy. They trade goods, services, and labor every single day. They have reputations in their communities that are ironclad. But to every bank, every credit bureau, every financial system on earth, they do not exist.
We asked one question: what if every Bitcoin Lightning payment you made was proof of who you are?
The answer is Barter.
What it does
Barter is a Proof of Trade Protocol, a new cryptographic primitive that converts Bitcoin Lightning payments into portable, self-owned financial reputation.
When two people complete a trade settled via Lightning, the payment produces a cryptographic receipt called a payment preimage. This preimage is mathematically unforgeable. It is proof, verified by Bitcoin's own security model, that real economic value moved between two people.
Barter captures that proof and builds two things:
BTR-Trust is a soulbound (ERC-5192), non-transferable on-chain reputation credential. It grows every time a verified trade completes. It cannot be bought, sold, or transferred. The only way to build it is to show up and trade.
BTR-Credit is a fungible ERC-20 token earned by completing trades. The economic incentive layer.
The core verification is one cryptographic invariant:
$$\text{SHA256}(\text{payment_preimage}) = \text{payment_hash}$$
This is the same check Bitcoin Lightning nodes run natively. No oracle. No trusted third party. Bitcoin's own cryptography is the proof.
We also implemented Proof of Commercial Consistency (POCC), a novel primitive developed during the hackathon with a mentor. A vendor can declare their base price unit on-chain. When a trade amount is a valid multiple of that unit, the protocol flags it as commercially consistent. A street vendor in Mumbai selling chai at 50,000 sats per cup will always receive multiples of 50,000. A transaction for 73,000 sats does not fit the menu. That mathematical inconsistency is detectable, and it is real evidence about whether a trade represents genuine commerce or financial obfuscation.
Finally, we integrated Allium's Realtime API for live on-chain behavioral analysis. Every counterparty address is analyzed for velocity anomalies, counterparty isolation, and amount uniformity patterns, surfaced directly in the trade proposal flow. Real blockchain data. 3 to 5 second freshness. No mocks.
How we built it
Smart Contracts (Solidity 0.8.24 + Hardhat)
Three contracts deployed to Sepolia testnet:
BarterCore.solhandles the trade lifecycle (propose, accept, settle). ThesettleTrade()function runssha256(abi.encode(preimage)) == paymentHashon-chain. This single line is Barter's entire claim.BTRTrust.solis the ERC-5192 soulbound credential. All transfer functions revert. Score accumulates with logarithmic value weighting and per-counterparty caps of 5 trust increments per pair for Sybil resistance.BTRCredit.solis a standard ERC-20 with mint access restricted exclusively to BarterCore.
Lightning Integration
WebLN via Alby browser extension. provider.sendPayment(invoice) returns the preimage automatically. The preimage is submitted to settleTrade() in one click. The SHA256 verification box in the UI computes the hash live in the browser as the user watches. The hash match is visible in real time.
Frontend
React 18 + Vite + TypeScript + Tailwind CSS + Ethers.js v6. Five screens: Dashboard, Propose Trade, Trade Detail, Profile, Wallet Connect. Zustand for state management. Recharts for score history visualization.
Allium Integration
Allium Realtime Wallet API for live counterparty analysis. Every proposed trade triggers an on-chain behavioral scan covering velocity, counterparty diversity, and amount patterns, surfaced as a single risk signal in the propose flow.
SDK Ecosystem
pip install barter-sdk(Python,import btr)npm install @thebarmaeffect/barter-sdk(JavaScript/TypeScript)npm install -g @thebarmaeffect/barter-cli(CLI,btr score 0x...)
Challenges we ran into
The Sybil problem is harder than it looks. Two colluding wallets can confirm fake trades and farm BTR-Trust if Lightning settlement cost is the only defense. We implemented per-counterparty trust caps, minimum trade floors of 1,000 sats, and logarithmic value weighting. Farming a meaningful score requires a genuinely broad network of real counterparties, each paying real Lightning fees.
Lightning preimage timing. WebLN returns the preimage asynchronously after payment confirmation. Wiring this into React state so the SHA256 box populates live without race conditions required careful handling of the WebLN promise chain.
The POCC primitive had no prior art. Proof of Commercial Consistency, verifying that a trade amount is a valid linear combination of a vendor's declared price structure, is a new idea. Designing the on-chain data structure and the UI feedback required working from first principles with no existing reference.
Making SHA256 feel human. The verification box shows three rows: preimage, SHA256 hash, stored payment hash. Watching them match in real time is the demo moment. Making that feel powerful rather than confusing to a non-technical audience required iteration on the UI design.
Accomplishments that we're proud of
The SHA256 verification working live in the browser. Watching the hash compute, watching it match the stored payment hash, knowing that what just happened is cryptographically equivalent to what Bitcoin Lightning nodes do. That moment is what Barter is.
The POCC primitive. A mentor at the hackathon described the commercial consistency problem in conversation. We formalized it, designed the on-chain mechanism, and shipped it the same night.
Allium integration returning real on-chain data for real addresses. Typing a real Ethereum address into the counterparty field and watching Allium return live transaction velocity, counterparty diversity, and risk assessment in 3 seconds. Not mocked. Real blockchain data.
Three contracts deployed and verified on Sepolia. A working SDK in two languages. A CLI that runs btr score 0x... and returns a live score. In 36 hours.
What we learned
Proof of Work. Proof of Stake. Proof of Trade. The lineage of consensus primitives is how blockchains establish truth. The same design thinking applies to identity. The question "what proves this happened?" has a cryptographic answer in Lightning, the preimage, that nobody had used for reputation before.
The informal economy is enormous and completely unmeasured. 2 billion workers. 60% of the global workforce. $10 to $14 trillion in annual economic activity. None of it produces portable, verifiable reputation. The infrastructure problem was not technical. Lightning already produces the proofs. Nobody had wired them together into an identity layer.
Scope discipline wins hackathons. We designed 15 features and built 5. The five we built work. The ten we cut were real losses but the right call.
What's next for Barter
Undercollateralized DeFi lending. Any lending protocol can query BTRTrust.getScore(address) on-chain and reduce collateral requirements for high-trust addresses. One line of Solidity. No partnership needed. This is live on Sepolia right now.
ZK proof of score. Prove score > 500 without revealing individual trades. Using Noir or Circom. The privacy-preserving version of the same primitive.
Agent-mediated access for the unbanked. Local community operators run Lightning nodes on behalf of users who interact via SMS. The blockchain complexity is invisible. The reputation builds regardless.
The AI agent economy. Autonomous agents transacting via Lightning need reputation too. BTR-Trust is the identity layer for machine-to-machine commerce.
Research paper. Proof of Trade as a formal cryptographic primitive deserves a proper treatment. We are writing it.
Built at MIT Bitcoin Hackathon 2026 · April 10 to 12 · Cambridge, MA
Karthik Barma · Raja Yadidiah Dake · Satwik Golla
More than a coin. A coin is just money. Barter is money plus proof of who you are.

Log in or sign up for Devpost to join the conversation.