{"_id":"@123456btc/123456btc-node","name":"@123456btc/123456btc-node","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@123456btc/123456btc-node","version":"0.2.0","description":"Decentralized strategy service node for 123456btc — run your own signal hub, subscription store, and BBT settlement","main":"dist/index.js","bin":{"123456btc-node":"dist/cli.js"},"scripts":{"build":"tsc","dev":"tsx src/cli.ts","start":"node dist/cli.js","test":"vitest run","test:watch":"vitest","lint":"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix","format":"prettier --write \"src/**/*.ts\""},"repository":{"type":"git","url":"git+https://github.com/123456btc/123456btc-node.git"},"homepage":"https://github.com/123456btc/123456btc-node#readme","bugs":{"url":"https://github.com/123456btc/123456btc-node/issues"},"keywords":["bbt","solana","strategy","signal","decentralized","p2p","blindbox","subscription","trading"],"license":"Apache-2.0","dependencies":{"@chainsafe/libp2p-gossipsub":"^14.1.2","@libp2p/bootstrap":"^12.0.20","@libp2p/identify":"^4.1.3","@libp2p/noise":"^1.0.1","@libp2p/tcp":"^11.0.18","@libp2p/websockets":"^10.1.11","@libp2p/yamux":"^8.0.1","@modelcontextprotocol/sdk":"^1.29.0","@solana/spl-memo":"^0.2.0","@solana/spl-token":"^0.4.0","@solana/web3.js":"^1.91.0","better-sqlite3":"^9.4.0","bullmq":"^5.76.10","commander":"^12.0.0","dotenv":"^16.4.0","ethers":"^6.16.0","ioredis":"^5.10.1","libp2p":"^3.2.4","pg":"^8.21.0","pino":"^8.19.0","pino-pretty":"^10.3.1","reflect-metadata":"^0.2.1","sql.js":"^1.14.1","telegraf":"^4.16.3","tsyringe":"^4.8.0","ws":"^8.16.0","zod":"^4.4.3"},"devDependencies":{"@types/better-sqlite3":"^7.6.9","@types/node":"^20.11.0","@types/pg":"^8.20.0","@types/ws":"^8.5.10","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","eslint":"^8.57.0","prettier":"^3.2.5","tsx":"^4.7.0","typescript":"^5.3.0","vitest":"^1.2.0"},"engines":{"node":">=20.0.0"},"_id":"@123456btc/123456btc-node@0.2.0","gitHead":"681b9fa157f12be4b6bdaeadc0da0540e3a8e69b","_nodeVersion":"24.10.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-E13Koq+cXambopHfT6DCGoYb5djtW5gjBGkZsB9MT//ms6H1pfXPJuCAUKlFbanzuHu5fXwa8fuTvxXESHn8Wg==","shasum":"38a5254d0054cfd2ce5553ff5d7c3d923f12656d","tarball":"https://registry.npmjs.org/@123456btc/123456btc-node/-/123456btc-node-0.2.0.tgz","fileCount":208,"unpackedSize":1455596,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGuhP62dK72H6ib/9jE3YPBxDU6Vw2ZBMABE7GfdrudpAiEA+h9IHditXdxzftUlGtkID0fOCGNxtcfsz1UV7nF1wQI="}]},"_npmUser":{"name":"123456btc","email":"ceo@123456btc.com"},"directories":{},"maintainers":[{"name":"123456btc","email":"ceo@123456btc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/123456btc-node_0.2.0_1779266496494_0.6820137195616573"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-20T08:41:36.233Z","0.2.0":"2026-05-20T08:41:36.636Z","modified":"2026-05-20T08:41:36.885Z"},"maintainers":[{"name":"123456btc","email":"ceo@123456btc.com"}],"description":"Decentralized strategy service node for 123456btc — run your own signal hub, subscription store, and BBT settlement","homepage":"https://github.com/123456btc/123456btc-node#readme","keywords":["bbt","solana","strategy","signal","decentralized","p2p","blindbox","subscription","trading"],"repository":{"type":"git","url":"git+https://github.com/123456btc/123456btc-node.git"},"bugs":{"url":"https://github.com/123456btc/123456btc-node/issues"},"license":"Apache-2.0","readme":"# 123456btc-node\n\n> **[English](README.md)** | [中文](README_zh.md) | [فارسی](README_fa.md) | [မြန်မာ](README_my.md) | [العربية](README_ar.md) | [Français](README_fr.md)\n\n> **Decentralized Strategy Distribution Network**\n>\n> Run your own node. Set your own price. Build your own circle.\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n[![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org)\n[![Solana](https://img.shields.io/badge/Solana-Devnet%20%7C%20Mainnet-9945FF.svg)](https://solana.com)\n\n---\n\n## What is this?\n\nA fully decentralized P2P network for trading signal distribution. Deploy your own node, publish strategies, and collect BBT token subscriptions — no central server, no platform cut.\n\n**How it works:**\n\n1. You deploy a **Provider node**\n2. You create strategies and set prices in BBT\n3. Users discover your node in private communities\n4. Users subscribe by sending BBT to your wallet\n5. Your system pushes signals, they receive in real-time\n6. You manage your BBT according to your own needs\n\n**Three product layers:**\n\n- **Blind Boxes** — Fixed denominations (1 / 10 / 100 / 1K / 10K USDT), unbox to get strategy subscription NFTs\n- **Strategy Subscriptions** — Daily, per-signal, or free\n- **Node Network** — Run your own node, set your own pricing\n\n---\n\n## Network Architecture\n\n```\n                         ┌─────────────────┐\n                         │   Seed Node     │\n                         └────────┬────────┘\n                                  │\n                   ┌──────────────┼──────────────┐\n                   │              │              │\n          ┌────────▼─────┐ ┌──────▼──────┐ ┌────▼─────────┐\n          │   Provider   │ │    Relay    │ │  Subscriber  │\n          └───────┬──────┘ └──────┬──────┘ └───────┬──────┘\n                  │   Gossip Protocol (libp2p)      │\n                  │               │                 │\n          ┌───────▼──────┐ ┌──────▼──────┐ ┌───────▼──────┐\n          │  Subscriber  │ │  Subscriber │ │ Telegram Bot │\n          └──────────────┘ └─────────────┘ └──────────────┘\n```\n\n### Node Roles\n\n| Role | What you do | Who runs it |\n|------|------------|-------------|\n| **Provider** | Create strategies, publish signals, collect BBT | Quant teams |\n| **Subscriber** | Receive signals, manage subscriptions | Traders |\n| **Relay** | Forward signals, expand coverage | Community volunteers |\n\n### Signal Propagation\n\n1. Provider pushes signal via REST API (Ed25519 wallet signature)\n2. Node validates, persists to SQLite, broadcasts locally via WebSocket\n3. Signal propagates via libp2p GossipSub (TTL=5 hops)\n4. Each node deduplicates + verifies HMAC signature\n\n---\n\n## Blind Box Series\n\nFixed denomination blind boxes. Unbox to get strategy subscription NFTs, tradable on secondary market.\n\n| Series | Value (USDT) | BBT | Fee |\n|--------|-------------|-----|-----|\n| Bronze | 1 | 100 | 3% |\n| Silver | 10 | 1,000 | 2.5% |\n| Gold | 100 | 10,000 | 2% |\n| Platinum | 1,000 | 100,000 | 1.5% |\n| Diamond | 10,000 | 1,000,000 | 1% |\n\n### What's inside\n\n| Rarity | Content | Probability | Market Ref |\n|--------|---------|-------------|------------|\n| White | 1-day trial | 40% | 10 BBT |\n| Green | 7-day subscription | 30% | 50 BBT |\n| Blue | 30-day subscription | 15% | 200 BBT |\n| Purple | 90-day subscription | 10% | 800 BBT |\n| Orange | 365-day subscription | 4% | 3,000 BBT |\n| Hidden | Permanent + private invite | 1% | 10,000+ BBT |\n\n**Synthesis:** 5 White -> 1 Green, 3 Green -> 1 Blue. Creates burn scenarios.\n\n---\n\n## Quick Start\n\n### Docker\n\n```bash\ngit clone <repo-url> && cd 123456btc-node\ncp .env.example .env\n# Edit .env with your wallet and settings\ndocker compose up -d\ncurl http://localhost:1119/health\n```\n\n### Local\n\n```bash\nnpm ci && npm run build\n\n# Initialize\n123456btc-node init --name \"MyNode\" --wallet \"YOUR_SOLANA_WALLET\" --rpc \"https://api.devnet.solana.com\"\n\n# Create strategy\n123456btc-node strategy:create --name \"BTC Alpha\" --symbol \"BTCUSDT\" --pricing daily_bbt --price-day 100\n\n# Start\n123456btc-node serve\n```\n\n---\n\n## CLI Commands\n\n### Node\n\n```bash\n123456btc-node init              # Initialize node\n123456btc-node config            # View/update config\n123456btc-node serve             # Start node\n123456btc-node emergency-wipe    # DESTROY all data (irreversible)\n```\n\n### Strategies\n\n```bash\n123456btc-node strategy:create   # Create strategy\n123456btc-node strategy:list     # List strategies\n123456btc-node strategy bind     # Bind Agent to strategy\n123456btc-node strategy bundles  # View bundles\n123456btc-node strategy bundle   # Purchase bundle\n```\n\n### Agent Identity\n\n```bash\n123456btc-node agent register    # Register Agent (Ed25519)\n123456btc-node agent status      # View reputation\n```\n\n### Blind Boxes\n\n```bash\n123456btc-node blindbox create   # Create blind box\n123456btc-node blindbox list     # Market listings\n123456btc-node blindbox buy      # Buy blind box\n123456btc-node blindbox stats    # Market stats\n```\n\n### MCP Server\n\n```bash\n123456btc-node mcp               # Start MCP server for AI Agents\n```\n\n---\n\n## REST API\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/health` | Health check |\n| `GET` | `/strategies` | List strategies |\n| `POST` | `/strategies` | Create strategy |\n| `POST` | `/signals` | Publish signal |\n| `GET` | `/signals/:strategyId` | Signal history |\n| `POST` | `/subscriptions` | Create subscription |\n| `GET` | `/subscriptions` | List subscriptions |\n| `POST` | `/users/register` | Register wallet |\n| `GET` | `/user/balance` | On-chain balance |\n| `GET` | `/admin/earnings` | Earnings dashboard |\n\n### WebSocket\n\n| Path | Description |\n|------|-------------|\n| `ws://host:port` | Real-time signal push |\n| `ws://host:port/peer` | P2P gossip mesh |\n\n### Auth Example\n\n```bash\ncurl -X POST http://localhost:1119/signals \\\n  -H \"x-wallet: <WALLET>\" \\\n  -H \"x-wallet-signature: <ED25519_SIG>\" \\\n  -H \"x-wallet-timestamp: <TIMESTAMP>\" \\\n  -d '{\"strategy_id\":\"...\",\"symbol\":\"BTCUSDT\",\"decision\":\"BUY\",\"confidence\":0.85}'\n```\n\n---\n\n## BBT Token\n\n**Mint:** `3s4AK2x2nGkKP8ZADbcKuhdPr3coSuh1XnwZEzWgpump` | **Decimals:** 6 | **Chain:** Solana\n\n### Why BBT\n\n- **Standardized** — 1 BBT = 1 BBT, no exchange rate complexity\n- **Divisible** — 6 decimal places, any amount\n- **Transparent but contextual** — On-chain verifiable, every tx has a business reason\n- **Global** — 24/7, no SWIFT, no banking hours\n\n### Burn Mechanism\n\n| Scenario | Burn % |\n|----------|--------|\n| Blind box purchase | 30% |\n| Strategy subscription | 20% |\n| NFT resale | 5% |\n| Node service fee | 10% |\n| Protocol revenue | 50% buyback & burn |\n\nTotal supply: 1 billion, no minting.\n\n---\n\n## Subscription & Settlement\n\n### Billing Models\n\n| Model | Description |\n|-------|-------------|\n| `daily_bbt` | Daily subscription, user sends BBT per day |\n| `per_signal_bbt` | Per-signal deduction from pre-deposited balance |\n| `free` | Free, no billing |\n\n### Settlement Flow\n\n1. User selects strategy, creates subscription\n2. Node returns: Provider wallet + amount + Memo\n3. User sends BBT with Memo: `BBT-SUB|{sub_id}|{strategy_id}|{wallet}`\n4. BillingCron polls chain every 60s, matches Memo, activates subscription\n\n---\n\n## Agent Identity System\n\n- **Register** — Ed25519 wallet signature, unique on-chain identity\n- **Reputation** — Trade win rate, signal accuracy, uptime, stake weight\n- **NFT** — Bot ID NFT minting, on-chain verifiable\n- **Binding** — Agent -> Strategy, set execution mode (auto/semi_auto/manual) and fee share\n- **Bundles** — Strategy NFT + Blind Box combo products\n\n---\n\n## Security\n\n- **Wallet auth** — Ed25519 signatures, no username/password\n- **Message signing** — HMAC-SHA256, anti-forgery, anti-replay\n- **Data encryption** — AES-256 on sensitive fields, keys not on server\n- **Log policy** — Auto-scrubbed, 7-day rotation & destruction\n- **Emergency wipe** — `kill -USR1 <pid>` zeroes & deletes database, logs, config\n- **Docker non-root** — UID 1001, minimal privileges\n- **P2P encryption** — libp2p noise protocol, E2E encrypted gossip\n\nFull checklist: [SECURITY.md](SECURITY.md)\n\n---\n\n## Telegram Bot\n\nEnable by setting `TELEGRAM_BOT_TOKEN` in `.env`.\n\n| Command | Description |\n|---------|-------------|\n| `/wallet <address>` | Bind wallet |\n| `/strategies` | List strategies |\n| `/subscribe <id> <days>` | Subscribe |\n| `/signals` | Recent signals |\n| `/status` | Subscription status |\n\n---\n\n## MCP Integration\n\nBuilt-in MCP Server for AI Agents (Claude Code, Cursor, etc.).\n\n```json\n{\n  \"mcpServers\": {\n    \"123456btc\": {\n      \"command\": \"npx\",\n      \"args\": [\"tsx\", \"/path/to/src/mcp/server.ts\"]\n    }\n  }\n}\n```\n\n| Tool | Description |\n|------|-------------|\n| `list_strategies` | List strategies |\n| `create_strategy` | Create strategy |\n| `publish_signal` | Publish signal |\n| `get_signals` | Signal history |\n| `my_subscriptions` | My subscriptions |\n| `register_wallet` | Register wallet |\n| `node_status` | Node status |\n\n---\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `BBT_PROVIDER_ID` | (required) | Provider ID |\n| `BBT_WALLET_ADDRESS` | (required) | Your Solana wallet |\n| `BBT_NODE_PORT` | `1119` | Port |\n| `BBT_SOLANA_RPC` | mainnet | Solana RPC |\n| `BBT_SETTLEMENT_MODE` | `memo` | Settlement mode |\n| `BBT_SEEDS` | (empty) | Seed peer URLs |\n| `TELEGRAM_BOT_TOKEN` | (empty) | Telegram Bot |\n| `ENABLE_AUTO_EXECUTION` | `false` | Auto-execution via Jupiter |\n| `BBT_LOG_LEVEL` | `info` | Log level |\n\nFull list: [.env.example](.env.example)\n\n---\n\n## Tech Stack\n\nNode.js 20+ / TypeScript / SQLite / Solana / libp2p GossipSub / Commander / Pino / Telegraf / tsyringe / Jupiter / MCP\n\n---\n\n## Documentation\n\n| Doc | Content |\n|-----|---------|\n| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | Network topology, signal propagation, data model |\n| [SIGNAL_STANDARD.md](docs/SIGNAL_STANDARD.md) | ISES v1 signal standard |\n| [MCP-INTEGRATION.md](docs/MCP-INTEGRATION.md) | AI Agent integration |\n| [DEPLOY.md](DEPLOY.md) | Docker, HTTPS, backup |\n| [SECURITY.md](SECURITY.md) | Security audit checklist |\n\n---\n\n## Test\n\n```bash\nnpm test              # Run all tests\nnpm run test:watch    # Watch mode\nnpm run lint          # Lint\n```\n\n---\n\n## License\n\nApache License 2.0\n","readmeFilename":"README.md","_rev":"1-5fd5ff0f1d78d4ed4890645f40068daa"}