SUBTC — AI-Native Payment Layer Architecture

permalink SUBTC
#ainative#architecture#layer#payment#subtc

SUBTC Protocol is naturally aligned with AI agents.

It behaves as a financial execution layer that machines can control directly.

This is not accidental design.
It is the result of simplicity, determinism, and composability.

---

1. AI Compatibility Foundations

SUBTC exposes a curl-first interface.

Agents do not require SDKs or complex integrations.

Example:

curl ...

This enables:
- GPT agents
- CLI bots
- autonomous scripts

Execution becomes immediate and universal.

---

2. Deterministic Flow Model

All operations follow predictable steps:

wallet_create → wallet_id
wallet_receive → address
wallet_poll → state check
wallet_send → execution

This mirrors AI reasoning:

step → result → next step

No ambiguity.
No hidden state.

---

3. Dual Execution Modes

SUBTC supports:

wallet_poll → non-blocking
wallet_wait_event → blocking / webhook

Mapping:

GPT agent → polling
backend agent → webhook
trading bot → hybrid

Same logic, different timing strategies.

---

4. Autonomous Agent Pattern

Goal:

Send BTC when payment is received.

Flow:

1. create wallet
2. generate address
3. wait for payment
4. confirm state
5. send funds

Loop:

while true:
poll payment
if reached:
send BTC
break

This maps directly to SUBTC endpoints.

---

5. Execution Layer for Autonomous Systems

Agents require:

- tools
- actions
- observations
- memory
- loop

Mapping:

tool → curl endpoint
action → mode=wallet_send
observation → JSON response
memory → wallet_id
loop → wallet_poll

SUBTC becomes the tool interface.

---

6. Marketplace Without Smart Contracts

Components:

Seller:
- creates inbox
- waits for payment

Buyer:
- sends BTC

SUBTC:
- enforces condition

Flow:

1. inbox_create
2. payment sent
3. wallet_poll
4. if reached → deliver product

Logic replaces contracts.

---

7. Payment as a Condition

Instead of treating payment as an event:

payment = condition

if received_sat >= expected_sat:
execute action

This enables:

- automation
- AI control
- deterministic triggers

---

8. Execution Patterns

Pattern 1 — Polling:

while !reached:
wallet_poll

Pattern 2 — Long Poll:

wallet_wait_event

Pattern 3 — Webhook:

callback_url

Each pattern fits a different system architecture.

---

9. Trading Bot Integration

Strategy:

1. monitor price
2. detect dip → buy
3. detect rise → sell
4. move funds via SUBTC

Constraint:

blockchain confirmation delay

---

10. Optimization Strategies

Use unconfirmed balance:

if unconfirmed_sat >= expected:
act early

Pre-fund wallets:

→ eliminate waiting

Hybrid execution:

→ AI decides instantly
→ blockchain settles later

---

11. System Identity

SUBTC is not just an API.

It is:

AI-Compatible Financial Execution Layer

Comparison:

Stripe → web applications
SUBTC → AI agents

---

12. Deployment Vision

Container model:

docker run subtc-store

Includes:

- payment gateway
- API layer
- webhook handler
- AI agent

Instant infrastructure.

---

13. Embedded Agent Design

agent.go responsibilities:

- monitor payments
- trigger fulfillment
- send payouts

Fully autonomous cycle.

---

14. Future Expansion

DEX bridge layer:

- connect to trading APIs
- AI decides trades
- SUBTC executes settlement

Separation of concerns:

decision vs execution

---

15. Core Properties

SUBTC works with AI because it is:

simple
stateless
predictable
composable
scriptable

---

Conclusion

SUBTC transforms Bitcoin into a programmable interface for intelligent systems.

It enables machines to:

observe
decide
act

without friction.

This is the foundation for autonomous finance.