A decentralized platform for privacy-preserving AI services, integrating HTTP privacy APIs (from AI-Robotic-Labs/http-privacy), Nostr for secure communication, and Bitcoin UTXOs for private payments. Users can access AI models (e.g., Grok, Stable Diffusion) anonymously, communicate with providers via Nostr, and pay using Bitcoin with privacy techniques like CoinJoin.
Status: Proof-of-concept (PoC). The http-privacy project is in beta, so use with caution.
- Anonymous AI Access: Query AI APIs via HTTP with a SOCKS5 proxy for IP anonymity, leveraging http-privacy Python bindings.
- Decentralized Communication: Use Nostr for pseudonymous, encrypted messaging between users and AI service providers.
- Private Payments: Pay for services using Bitcoin UTXOs, with support for CoinJoin to obscure transaction origins.
- Modular Design: Built with Python, extensible to other languages (Rust, C++, JavaScript) supported by http-privacy.
- Future-Ready: Planned support for Lightning Network and additional AI models (e.g., Claude, Llama) per the http-privacy roadmap.
The platform integrates three layers:
- Uses http-privacy APIs to interact with AI services (e.g., Grok).
- Routes requests through a SOCKS5 proxy (e.g., Tor or http-privacy’s proxy) to hide IP addresses.
- Encrypts payloads for data privacy.
- Nostr relays handle service discovery, negotiation, and result delivery.
- Encrypted direct messages ensure secure coordination (e.g., sharing Bitcoin addresses).
- Bitcoin UTXOs enable pseudonymous payments.
- Privacy is enhanced with CoinJoin or Lightning Network (future).
- A user browses AI service listings on Nostr relays via a Tor browser.
- They send an encrypted Nostr message to a provider with a query (e.g., "Generate a summary").
- The provider responds with a Bitcoin address and price (e.g., 0.001 BTC).
- The user sends a CoinJoin-mixed payment and queries the AI API via http-privacy.
- The provider delivers the result (e.g., generated text) via Nostr.
- Python 3.8+
- A running SOCKS5 proxy (e.g., Tor at
127.0.0.1:9050
or http-privacy’s proxy, once available). - A Bitcoin wallet supporting CoinJoin (e.g., Wasabi Wallet, not yet integrated).
- Nostr keypair for user and provider.
-
Clone the Repository:
git clone https://github.com/AI-Robotic-Labs/http-nostr-utxo.git cd privacy-ai-marketplace
-
Install Dependencies:
pip install requests pysocks nostr
-
Configure the Client:
- Edit
ai_privacy_client.py
to set:SOCKS5_PROXY
: Your proxy address (e.g.,127.0.0.1:9050
).AI_API_ENDPOINT
: The http-privacy API URL (placeholder:http://example.com/api/grok
).NOSTR_RELAYS
: List of Nostr relays (e.g.,wss://relay.damus.io
).USER_PRIVATE_KEY
: Your Nostr private key.PROVIDER_PUBKEY
: The AI provider’s Nostr public key.
- Edit
-
Run the Client:
python ai_privacy_client.py
- Ensure your SOCKS5 proxy is running.
- Run the client to:
- Send a Nostr request to an AI provider (e.g., for text generation).
- Receive a Bitcoin address and price via Nostr.
- Simulate a Bitcoin payment (UTXO-based, placeholder).
- Query the AI API via http-privacy and display the result.
- Check console output for the AI response or errors.
Example:
$ python ai_privacy_client.py
Sent Nostr request with ID: 123e4567-...
Received provider response: {"bitcoin_address": "bc1...", "price_btc": 0.001}
Initiating payment of 0.001 BTC to bc1...
AI Result: Decentralized systems enhance privacy by...
- Bitcoin Integration: Add full Bitcoin wallet support (e.g.,
bitcoinlib
or Wasabi) for UTXO payments with CoinJoin. - Lightning Network: Enable fast, low-cost payments via Lightning, using Nostr for invoice exchange.
- http-privacy Updates: Incorporate new AI model bindings (e.g., Claude, Llama) and the MCP server from the http-privacy roadmap.
- GUI Client: Develop a user-friendly interface (e.g., with
tkinter
or web-based). - Reputation System: Use Nostr events for decentralized provider ratings.
- Monero Support: Add Monero for stronger payment privacy.
- Beta Dependency: The http-privacy project is in beta, so API bindings and SOCKS5 proxy may be unstable.
- Placeholder Payment: Bitcoin payment logic is simulated; real wallet integration is pending.
- Nostr Relay Trust: Relays could log metadata. Use multiple relays or run your own for privacy.
- Complexity: Users must manage Nostr keys and Bitcoin wallets manually.