Inspiration

In many communities, small merchants struggle to reach customers beyond their immediate surroundings, while buyers spend time searching for trustworthy sellers, comparing prices, and negotiating deals.

We wanted to explore how AI agents and Bitcoin could make peer-to-peer commerce more accessible, intelligent, and decentralized.

Inspired by the potential of Bitcoin Lightning for fast payments, Nostr for decentralized communication, and autonomous AI agents for intelligent decision-making, we built SATOSHIBAZAAR — a marketplace where AI agents collaborate to connect buyers and merchants, negotiate deals, and facilitate payments with user approval.

Our vision is to create a marketplace that does not depend entirely on centralized platforms to discover merchants or coordinate transactions.

What it does

SATOSHIBAZAAR is an AI-powered, decentralized peer-to-peer marketplace built around five collaborating AI agents.

1. Buyer Agent

  • Understands buyer requirements expressed in natural language.
  • Identifies product preferences, quantities, locations, and budgets.
  • Coordinates the purchasing process.

2. Merchant Discovery Agent

  • Discovers relevant merchants and product listings.
  • Uses Nostr-based decentralized merchant discovery.
  • Identifies suitable sellers based on buyer requirements.

3. Merchant Agent

  • Represents merchant offers.
  • Provides product information and pricing.
  • Participates in buyer-seller negotiations.

4. Negotiation Agent

  • Compares available offers.
  • Helps negotiate prices between buyers and merchants.
  • Identifies suitable deals within the buyer's budget.

5. Risk Guardian Agent

  • Checks transaction conditions and spending limits.
  • Helps prevent unsafe or unauthorized payment attempts.
  • Ensures the buyer explicitly approves payments before execution.

Bitcoin Lightning Wallet

SATOSHIBAZAAR includes a Lightning wallet integration designed to support:

  • Buyer and merchant wallet connections through Nostr Wallet Connect (NWC).
  • BOLT-11 invoice creation.
  • Invoice payment after buyer approval.
  • Merchant-side payment verification.
  • Transaction history and payment status tracking.

The current implementation includes an Alby NWC Faucet sandbox mode for simulated wallet testing.

Decentralized Merchant Discovery

Merchants can publish signed product listings through Nostr relays, allowing marketplace discovery without depending exclusively on a centralized merchant directory.

How we built it

We developed SATOSHIBAZAAR using a full-stack architecture.

Frontend

  • React
  • Vite
  • JavaScript
  • Responsive marketplace and wallet interfaces

Backend

  • Python
  • FastAPI
  • SQLite
  • JWT-based authentication
  • REST API architecture

Artificial Intelligence

  • Google Gemini API
  • Five specialized AI agents
  • Agent coordination and structured decision-making
  • Rule-based risk and transaction validation

Bitcoin and Lightning

  • Alby NWC Faucet integration
  • Nostr Wallet Connect (NWC)
  • BOLT-11 invoices
  • Separate buyer and merchant wallet connections
  • Explicit payment approval and merchant-side verification

Decentralized Protocol

  • Nostr protocol
  • NIP-01 event structure
  • NIP-07 browser signing
  • Public Nostr relays
  • Signed merchant listings

The system uses AI for discovery, reasoning, and negotiation, while critical financial operations such as payment approval, invoice validation, and transaction verification are handled through backend logic.

Challenges we ran into

One of our biggest challenges was coordinating multiple AI agents without making the purchasing process unpredictable.

Each agent needed a distinct responsibility, and their outputs had to work together to complete a single purchasing workflow.

Another major challenge was integrating Bitcoin Lightning payments through Nostr Wallet Connect.

The NWC communication flow is asynchronous, which required us to adapt the existing payment provider architecture and ensure that wallet operations, invoice creation, and payment verification worked together.

We also had to address:

  • Separating buyer and merchant wallet connections.
  • Validating invoice amounts and payment status.
  • Preventing duplicate payment attempts.
  • Handling ambiguous payment timeouts safely.
  • Protecting wallet credentials and API keys.
  • Integrating Nostr signing and relay communication.
  • Maintaining deterministic financial checks alongside AI-driven decisions.

Accomplishments that we're proud of

  • Built a complete full-stack marketplace prototype using React and FastAPI.
  • Developed five specialized AI agents that collaborate throughout the purchasing workflow.
  • Implemented Nostr-based merchant discovery and signed listing publication.
  • Built an integrated Lightning wallet architecture with buyer and merchant separation.
  • Implemented invoice creation, explicit payment approval, merchant-side verification, and transaction metadata handling.
  • Added duplicate-payment protection and credential redaction.
  • Completed 34 backend automated tests.
  • Successfully built the frontend for production.

Most importantly, we brought AI agents, decentralized merchant discovery, and Bitcoin Lightning wallet functionality together in a single marketplace prototype.

What we learned

We learned that building an agentic marketplace requires more than connecting multiple language models.

Each agent needs a clear responsibility, structured communication, and well-defined boundaries.

We also learned that financial applications require deterministic validation and explicit user authorization. AI can recommend a transaction, but it should never independently decide to spend a user's money.

Working with Nostr and NWC helped us understand the importance of decentralized identity, signed events, wallet connectivity, invoice handling, and secure payment verification.

We also learned the difference between mocked payment tests and an independently verified wallet transaction. A working API implementation alone is not sufficient evidence of a completed Lightning payment.

What's next for SATOSHIBAZAAR

Our next goal is to move SATOSHIBAZAAR from a working prototype toward a more complete decentralized commerce platform.

Planned improvements include:

  1. Complete Lightning sandbox validation: Connect two fresh Alby Faucet wallets and demonstrate a verified buyer-to-merchant transaction.
  2. Real Lightning network integration: Explore a compatible real-network wallet setup and validate actual Bitcoin payments.
  3. Expand Nostr merchant discovery: Improve relay reliability, merchant reputation, and listing discovery.
  4. Improve AI agent coordination: Introduce more sophisticated negotiation strategies and better agent communication.
  5. Strengthen trust and security: Improve merchant verification, transaction monitoring, and fraud prevention.
  6. Support local commerce: Explore localized product discovery, regional merchant onboarding, and accessible payment experiences.

Our long-term vision is to make SATOSHIBAZAAR an open, intelligent, and decentralized marketplace where buyers and merchants can interact through AI agents and transact using Bitcoin Lightning, without depending entirely on centralized commerce platforms.

Built With

  • ai-agents
  • alby
  • artificial-intelligence
  • bitcoin
  • bitcoin-lightning-network
  • bolt-11
  • fastapi
  • google-gemini-api
  • javascript
  • jwt-authentication
  • multi-agent-systems
  • nip-01
  • nip-07
  • nostr
  • nostr-wallet-connect
  • python
  • react
  • rest-api
  • sqlite
  • vite
Share this project:

Updates

Submission history