Skip to content

Transform BLT-Bacon to multi-chain BLT-Rewards with protocol-agnostic API#20

Draft
Copilot wants to merge 9 commits intomainfrom
copilot/move-bacon-logic-to-worker
Draft

Transform BLT-Bacon to multi-chain BLT-Rewards with protocol-agnostic API#20
Copilot wants to merge 9 commits intomainfrom
copilot/move-bacon-logic-to-worker

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 17, 2026

Generalizes single-chain BACON distribution to support multiple blockchain protocols (Bitcoin Runes, Solana, etc.) through a unified API gateway architecture.

Architecture

Before: Cloudflare Worker → Bitcoin Ord Server → Bitcoin Node

After: Cloudflare Worker (Gateway) → Protocol-Specific Backends → Blockchain Nodes

Backend URLs configured via JSON map:

{
  "bitcoin-runes": "https://ord.example.com",
  "solana": "https://sol.example.com"
}

API Changes

New protocol-agnostic endpoints:

POST /{protocol}/send-rewards
GET /{protocol}/wallet-balance

Request format change:

{
  "recipients": [
    {"address": "bc1...", "amount": 10, "token": "BLT•BACON•TOKENS"}
  ],
  "fee_rate": 50,
  "dry_run": true
}

Legacy BACON endpoints (/mainnet/send-bacon-tokens, /regtest/send-bacon-tokens) remain supported for backward compatibility.

Implementation

  • src/entry.py: BaconWorkerRewardsWorker with protocol routing and validation
  • Validation: Protocol whitelist, recipients structure (max 1000), amounts, authentication
  • Configuration: BACKEND_URLS (JSON map), SUPPORTED_PROTOCOLS (comma-separated list)
  • Security: 0 CodeQL alerts, protocol isolation, input sanitization

Example

# Health check shows supported protocols
GET /health
→ {"status": "healthy", "supported_protocols": ["bitcoin-runes", "solana"]}

# Send rewards on any protocol
POST /bitcoin-runes/send-rewards
POST /solana/send-rewards

# Get balance for specific protocol
GET /bitcoin-runes/wallet-balance

Configuration enables protocol addition without code changes:

SUPPORTED_PROTOCOLS=bitcoin-runes,solana,ethereum
BACKEND_URLS='{"bitcoin-runes":"...","solana":"...","ethereum":"..."}'

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 17, 2026 01:24
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
…mpatibility

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
…sive documentation

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Copilot AI and others added 3 commits March 1, 2026 23:22
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
…ion ✅

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Copilot AI changed the title [WIP] Move all bacon logic to Cloudflare Python worker Transform BLT-Bacon to multi-chain BLT-Rewards with protocol-agnostic API Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants