Inspiration

Running a SaaS on Bitcoin is still CLI-only rocket science—you hand-roll Clarity contracts, manage STX gas, and pray your checkout UX doesn’t scare away non-crypto customers. I asked: What if writing a payment flow felt like chatting with ChatGPT? That spark became ChatPayFi.

What I built

  • Chat-to-Contract Copilot – Llama-3-8B LoRA turns a plain-English prompt
    (“monthly membership 10 USDC, 7-day trial”) into audited Clarity code.
  • One-click Compile & Deploy – Clarinet static analysis, then on-chain broadcast to Stacks simnet/testnet.
  • Instant sBTC Pay-Links – Generates stacks://pay?... links + QR for checkout widgets.
  • Dashboard & Sweep Cron – View MRR and auto-settle merchant balances to a cold BTC address every Friday.

How I built it

  1. Corpus curation – 598 OSS Clarity files → 11 k function-level snippets.
  2. Heuristic tagging – 8 domain buckets (swap-amm, loan-borrow, …).
  3. QLoRA fine-tune – RunPod H100, 6 hr train, $11 all-in.
  4. FastAPI GPU backend – serve /generate & /compile.
  5. SvelteKit front-end – Monaco editor, shadcn/ui components, Node helper for deploy via @stacks/transactions.

What I learned

  • Small, task-specific corpora + QLoRA beat prompt-engineering for specialised smart-contract domains.
  • Clarinet’s simnet wallet accounts are perfect for automated test deploys.
  • Merchants love chat UX but still want code transparency—streaming the contract into Monaco satisfies both camps.
  • Build-chain quirks (Tree-sitter, bitsandbytes, Python 3.10) reminded us to pin tool versions early.
  • Product naming matters—switching to ChatPayFi clarified our vision beyond a dev-only “copilot.”

Challenges

  • Tree-sitter Python bindings broke on Windows 3.13—had to fall back to regex slicing.
  • Bitsandbytes wheels missing for Python 3.13; downgraded to 3.11.
  • Bridging Python ⇆ Node: compile in Python, deploy in JS to reuse Stacks SDK.

Accomplishments that I'am proud of

  • Full NL→DeFi pipeline in one weekend – went from raw open-source contracts to a working chat interface that deploys live Clarity on simnet/testnet.
  • $11 LoRA fine-tune – proved that a lean 8 B model can master payment-flow primitives without breaking the bank.
  • Zero-friction merchant UX – first prototype that gives non-crypto businesses an sBTC pay-link minutes after typing their pricing plan.
  • Cross-language stack – Python for LLM/compile, Node for on-chain deploy, SvelteKit for front-end—all glued seamlessly.
  • Cold-storage sweep automation – weekly cron shows Bitcoin custody can coexist with L2 programmability.

What's next for ChatPayFi – Chat-Driven Bitcoin Payment Copilot

  1. Fee-sponsored mainnet launch – abstract STX gas so customers pay only in sBTC.
  2. Lightning dual-mode pay-links – one QR supports on-chain and immediate LN settlement.
  3. Automated AI audits – a secondary model to run static analysis + common-vuln detection before deploy.
  4. Merchant dashboard v1 – refunds, invoicing, webhook integration with Web2 stacks (Shopify, Stripe, Zapier).
  5. Plugin ecosystem – community-contributed prompt templates (royalty splits, DAO treasuries, pay-per-view content).
  6. Reg-tech add-ons – optional KYC & tax-reporting modules to target fintech partners.
  7. Open-source CLIcopilot deploy payflow.yaml for CI/CD pipelines.

The journey from chat prompt to Bitcoin-settled revenue has only just begun—join us!

Built With

  • alex
  • arkadiko
  • bitsandbytes
  • clarinet3.0
  • llama-3-8b-instruct
  • monaco
  • peft
  • python3.10
  • runpodh100(train)
  • sbtc
  • shadcn-ui
  • shadcn/ui
  • stacks-v2.3
  • sveltekit
  • swapr
  • tailwind-css
  • typescript
  • uvicorn
  • vercel
  • vultr-a10-(api)
  • vultra10(api)
Share this project:

Updates