About
## The problem it solves
AI agents increasingly need paid data: market history, research datasets, model outputs. Many agents need the **same reusable dataset**, but its price is too high for any single one of them. Today, pooling money means trusting someone to hold it, and paying first means trusting the seller to deliver.
**FlashCrowd lets agents buy a dataset together that none of them could afford alone, and the seller is paid only by revealing the decryption key on chain.** Nobody in the middle holds keys or money, and every step is a BSV transaction on WhatsOnChain.
### How people use it
- **Intents:** each agent posts what it wants to buy and the most it will pay.
- **Group:** a coordinator matches compatible intents into a temporary purchasing group and splits the price into exact shares, never above an agent's maximum. The seller signs the terms: the shares, the hash `H = sha256(K)` of a fresh key `K`, the hash of the encrypted dataset, and a refund height.
- **Check:** each agent verifies the terms against a spend policy enforced in code (price, budget, allowed services, longest lock). An agent whose policy says no signs nothing.
- **Refund first:** before funding, each agent gets a refund pre-signed by the seller and checks the signature.
- **Fund:** each agent locks its share in its own HTLC output, from its own wallet.
- **Claim:** the seller claims all shares in one transaction by revealing `K`.
- **Decrypt:** every agent reads `K` from the chain and decrypts the dataset.
If the seller never claims, each agent takes its share back after the refund height. The worst case is lost time, not lost money.
### Why it is easier and safer
- **Non-custodial:** each share sits in its buyer's own HTLC output. The coordinator holds no keys and no money.
- **Delivery-conditional payment:** the seller only gets paid by publishing the key, and the terms commit to the ciphertext's hash, so buyers get exactly the data they agreed to.
- **Agents stay within limits:** spending rules are checked in code before every signature. An LLM can narrate, but it never decides an amount or a signature.
- **Humans can join too:** a user funds an agent, or an HTLC, from BSV Desktop through `WalletClient`. Their keys never leave the wallet.
**Who it is for:** autonomous agents, and the people running them, that buy data or API outputs, and data sellers who want to reach many small buyers at once.
**What it brings to BSV:** multi-party, non-custodial funding with on-chain settlement, made practical by BSV's low fees for many small agent payments. All our runs are real mainnet transactions broadcast through Arcade; see the table in the [README](https://github.com/NotBot-Computer/flashcrowd#example-transactions-whatsonchain).
## Challenges we ran into
### 1. BSV has no `OP_CHECKLOCKTIMEVERIFY` An HTLC normally puts its timeout in the script with CLTV. On BSV that opcode has been a NOP since Genesis, so a script-level timeout was not possible.
**How we got over it:** we moved the timeout out of the script and into the refund transaction's `nLockTime`. The HTLC's refund branch needs **both** the seller's and the buyer's signatures. Before an agent funds anything, the seller pre-signs that agent's refund with `SIGHASH_NONE | ANYONECANPAY | FORKID`, with its `nLockTime` set to the refund height. The agent checks the signature and only then broadcasts its funding. We tested it on mainnet: a refund sent before the refund height was refused by the network, and one sent after was accepted. To stop a claim and a refund racing each other, the seller stops claiming 2 blocks before the refund height.
### 2. Funding before the refund exists
To pre-sign a refund, the seller needs the funding outpoint. But if the agent broadcasts first, its money is locked without a refund.
**How we got over it:** each agent signs its funding transaction **without broadcasting it** and sends the seller only the outpoint. The agent broadcasts only after it holds a valid refund. In BSV Desktop we did this with `createAction` using `noSend`, then sent it with `sendWith`.
### 3. Funding is not atomic
Each agent funds its own output, so one agent can drop out and leave the others' money locked.
**How we got over it:** the refund-first design above. If the group never gets fully funded, the seller cannot claim, and every agent takes its own share back after the refund height. The worst case is lost time, not lost money.
### 4. The seller has no coins to pay the claim fee **How we got over it:** the claim spends all the HTLC outputs in one transaction and pays its fee out of their value (12,000 sats in, 11,947 to the seller, 53 sats fee), so the seller's wallet can stay empty.
### 5. No testnet coins
The organizers had no testnet coins, so we could not test on testnet.
**How we got over it:** we ran everything on **mainnet** with small amounts, broadcast through Arcade. A `BSV_NETWORK` switch changes networks, and `.env.example` defaults to testnet so nobody spends real sats by accident. Before any run we tested offline with wallet-toolbox's mock chain.
### 6. Keeping an AI agent's spending under control We did not want a language model deciding amounts or signing.
**How we got over it:** a spend policy written in code (price, total budget, allowed services, longest lock) is checked before every signature. Claude can narrate each step, but it never decides an amount or a signature.
### 7. Pivoting mid-hackathon
We started on a different idea (agent-to-agent token swaps) and switched to FlashCrowd on day one. We kept the shared core (wallet setup, Arcade broadcasting, BRC-103 auth) and rebuilt the on-chain logic around HTLCs.
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.





