Integrating SUBTC Protocol with IPFS Sites — Overview

permalink SUBTC
#integrating#ipfs#protocol#sites#subtc

The **SUBTC Protocol** can seamlessly integrate with IPFS-hosted websites, particularly static sites, to enable Bitcoin payments and wallet management. Static pages make it easy to use `curl` or lightweight scripts to interact with the API.

Base API: https://subtc.net/api

---

## 🌐 Why IPFS + SUBTC Works

- IPFS sites are usually **static** (HTML, JavaScript minimal)
- No complex server-side backend is required
- SUBTC API can be called directly using **HTTP requests** or `curl`
- Works well for developers, AI agents, and automated scripts

---

## ⚙️ Integration Approach

1. **Frontend (IPFS Page)**

- HTML or JavaScript page serves as the user interface
- Example: “Buy digital content” button triggers API call

2. **Backend / API Calls**

- Use `curl` from static pages (via JS fetch + CORS proxy if needed)
- SUBTC API handles wallet creation, receiving addresses, and BTC transfers

3. **Wallet Flow Example**

# Create Wallet
curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_create" \
-H "X-SUBTC-KEY: $KEY" \
-H "Content-Type: application/json" \
-d '{}'

# Receive Payment
curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_receive" \
-H "X-SUBTC-KEY: $KEY" \
-H "Content-Type: application/json" \
-d '{"wallet_id":"<wallet_id>"}'

# Send BTC
curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_send" \
-H "X-SUBTC-KEY: $KEY" \
-H "Content-Type: application/json" \
-d '{"wallet_id":"<wallet_id>","to":"<address>","amount_sat":10000}'

4. Event Monitoring

Poll payments or use webhook style via wallet_wait_event

Updates can be shown directly on the IPFS site with minimal JavaScript

---

💡 Notes for IPFS Developers

No RPC needed: SUBTC handles blockchain interactions

Static-friendly: IPFS pages don’t require dynamic server processing

Secure keys: Keep X-SUBTC-KEY in an environment file or proxy layer

Supports AI integration: Use AI agents to automate payments or monitor transactions

---

🧩 Use Cases

Sell digital art or NFTs hosted on IPFS

Collect donations via BTC

Build micro-payments for content access

Automated reward systems for IPFS-hosted apps

---

Conclusion

Integrating SUBTC Protocol with IPFS sites offers a lightweight, secure, and scalable solution for Bitcoin payments. Static pages, minimal scripting, and curl commands are sufficient to:

Create wallets

Receive and send BTC

Monitor transactions

This makes SUBTC ideal for decentralized web projects and experimental Bitcoin payment platforms.