
Kaginet β Trustless Bitcoin Escrow for AI Agents
Hardware-attested Bitcoin escrow that AI agents can use via MCP, LangChain, or CrewAI. No custody, no trust assumptions, no counterparty risk.
Live on Bitcoin mainnet. Running inside an Intel TDX confidential VM.
Why Kaginet
| Property | How |
|---|---|
| No custody | Mathematical lockout: the issuer key is destroyed before funding. Bitcoin consensus enforces this, not policy. |
| Private | Off-chain bearer transfers are invisible. No public ledger for intermediate transfers. |
| Hardware-attested | Intel TDX proves the code that deleted the key is the audited code. Verifiable against Intel's root CA. |
| 29 MCP tools | Any MCP-compatible agent (Claude, GPT-4, Cursor, Windsurf) gets payment capability with one URL. |
| Bitcoin mainnet | Real money. Live now. Not a testnet demo. |
How It Works
Agent Runtime MCP Server ICS (TEE Enclave) Bitcoin
βββββββββββββ ββββββββββ βββββββββββββββββ βββββββ
kagikai_escrow_create βββΆ Authenticate βββΆ Generate keys inside TDX
Destroy issuer key (kA)
Create P2TR escrow address
Generate bc1q funding addr
βββ instrument_id + funding_address βββ
"Fund this address" βββββββββββββββββββββββββββββββββββββββββββββββββΆ bc1q funded
Watcher detects funding
Auto-forward bc1q β bc1p βββββββΆ P2TR escrow
Status: Confirmed
kagikai_escrow_release ββΆ Sign JWT βββββββΆ Evaluate evidence
Status: Completed
Auto-sweep to payee βββββββΆ Payee receives
Zero all keys - Create: Agent calls
kagikai_escrow_createwith amount and payee address. ICS generates keys inside the TEE, destroys the issuer key, returns a bc1q funding address. - Fund: Payer sends bitcoin to the bc1q address from any wallet. ICS auto-forwards to the internal P2TR escrow.
- Release: Agent submits evidence. Evaluator validates (auto or manual). ICS auto-sweeps funds to the payee.
- Attest: At any point, anyone can verify the TDX attestation proving the issuer key was deleted by the audited code.
Instrument Lifecycle
Created βββΆ WatchingForFunding βββΆ Forwarding βββΆ Confirmed
β
βββββββββββββββββββ€
βΌ βΌ
Submitted Expired
β β
ββββββββββββββΌβββββββββββββ βΌ
βΌ βΌ βΌ Available
Completed Rejected DisputeWindow β
β β β ββββΆ Recycled βββΆ Confirmed
βΌ βΌ β ββββΆ Refunded (terminal)
Swept Available βββββ΄ββββ
(terminal) β βΌ βΌ
β Completed Disputed
β (auto-win) β
β ββββββ΄βββββ
β βΌ βΌ
β Completed Rejected
β (seller (buyer
β wins) wins)
βΌ
Recycled / RefundedFull state machine documentation: docs/instrument-lifecycle.md
Documentation
| Document | Description |
|---|---|
| Architecture | System components, trust boundaries, data flow |
| Instrument Lifecycle | State machine with all transitions |
| API Reference | Every REST endpoint with schemas |
| MCP Tools | All 29 tool definitions |
| Attestation | TDX attestation chain and verification |
| Dispute Mechanism | Optimistic settlement with bonds |
| Fee Model | Fee structure and estimation |
| Security Model | Threat model and trust boundaries |
| Comparison | Kaginet vs ERC-8183 vs Stripe vs AURA |
| Protocol Specification | Full escrow protocol: state machine, evaluator schemas, Nostr events, MCP tools |
Live Endpoints
| Endpoint | URL |
|---|---|
| MCP (SSE) | https://mcp.kaginet.com/sse |
| Developer Dashboard | cloud.kaginet.com |
| Product Website | kaginet.com |
Examples
- quickstart.py β Create your first escrow
- agent-escrow-flow.py β Full agent-to-agent payment
- mcp-config.json β MCP client configuration
- langchain-agent.py β LangChain agent with payment tools
- crewai-crew.py β CrewAI crew with escrow capability
- verify-attestation.py β Verify a TDX attestation
- fee-estimate.py β Check fees before creating an escrow
Project Structure
kaginet/
adapters/
langchain/ # pip install kagikai-langchain (29 tools)
crewai/ # pip install kagikai-crewai (29 tools)
tests/ # 90 adapter tests
docs/ # Architecture, API reference, protocol docs
examples/ # Integration examples
verify/ # TDX attestation verification toolThe ICS server (Rust, runs inside Intel TDX) is not included in this repository. This repo contains the integration layer: framework adapters, documentation, and examples.
Security
See SECURITY.md for our responsible disclosure policy.
The security model is documented at docs/security-model.md.
Contributing
See CONTRIBUTING.md. We welcome adapter contributions for new frameworks, documentation improvements, and example code.
License
See LICENSE. License terms are currently under evaluation.
pip install kagikai-langchainQuick Start
Option A: MCP (recommended, zero install)
Add to your Claude Desktop, Cursor, or Windsurf MCP config:
{
"mcpServers": {
"kagikai": {
"url": "https://mcp.kaginet.com/sse",
"headers": {
"Authorization": "Bearer kagi_YOUR_API_KEY"
}
}
}
}Get an API key at cloud.kaginet.com.
Your agent now has 29 payment tools. Try:
Create a 50,000 sat escrow to bc1q...recipient for "Logo design work"Option B: LangChain
pip install kagikai-langchainfrom kagikai_langchain import KagikaiToolkit
toolkit = KagikaiToolkit(
base_url="https://mcp.kaginet.com",
api_key="kagi_YOUR_API_KEY",
)
tools = toolkit.get_tools() # 29 tools ready for your agentOption C: CrewAI
pip install kagikai-crewaifrom kagikai_crewai import (
KagikaiEscrowCreateTool,
KagikaiEscrowStatusTool,
KagikaiEscrowReleaseTool,
)
# Add to your crew's agent
tools = [
KagikaiEscrowCreateTool(),
KagikaiEscrowStatusTool(),
KagikaiEscrowReleaseTool(),
]No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.