Fiber-pay: an ai-friendly CLI for fiber-network

Recently I’ve been (asking AI) building on fiber-pay, a tool that lets AI directly interact with the CKB Fiber Network. Long story short, it lets AI open channels and make payments for you.

Why build this?

Fiber is CKB’s Lightning Network, but running a node manually is kind of a pain. With fiber-pay, you can just tell the AI, “Hey, open a channel for me” or “Send me an invoice,” and it will handle the rest.

What’s done so far?

  • CLI Tool: Command-line ready with JSON outputs, making it super machine-friendly to parse.
  • Runtime System: Comes with job management, auto-retries on failure, and easy log viewing.
  • Agent Integration: Wrote a skill file so you can load it directly into OpenClaw.

How does it actually work?

I tested it out myself on a 15 dollars small computer with openclaw using kimi code subscription model(199 RMB /month) and the basic flow goes like this:

Paste this prompt in Cursor/Claude/Copilot/other agents:

Follow this document https://raw.githubusercontent.com/RetricSu/fiber-pay/refs/heads/master/skills/fiber-pay/SKILL.md to equip yourself with a p2p payment system.

Your agent should be able to start a node by:
→ Auto-downloads the fnn binary
→ Initializes the config
→ Starts the node
→ Connects to the bootnodes

You can ask it to conenct to peer, open channel and even tweak the config file for custom needs.

The whole process is practically hands-free. The AI takes care of handling errors, retrying, and reading the logs on its own.

Looking for folks to play with it

If you’re into any of these:

  • CKB / Fiber Network
  • AI Agents
  • Automated payment workflows

Come mess around with it! Try loading the fiber-pay skill into OpenClaw (or any other agent framework) and see what kind of cool stuff you can hack together.

Code is here: GitHub - RetricSu/fiber-pay · GitHub

Feel free to open an issue, share your ideas, or just drop a reply in this thread.

8 Likes

The idea has great potential. Keep up the good work. Do you guys plan on add and wallet for support?

1 Like

absolutely! I think there are two levels of support here: 1. for SDK level(the fiber-pay/sdk), there should have some libraries to support wallet integration on fiber node, which allows developers to use the SDK building Fiber apps that work with the CCC wallet signers. This PR is fired on fiber side to enable such ability; 2. for CLI level (the fiber-pay/cli), It will be interesting to invoke external wallets( neuron, ckb-cli etc) for setup and running the fiber nodes.

What is your idea for this? Is there any feature requests?

2 Likes

Happy to share that I’ve released v0.1.0 of fiber-pay! It targets FNN version 0.7.1 and includes basic functionality for the testnet.

I’ve been using it a lot lately while building a fun demo: fiber-audio-player (I’ll write another post to share that project soon!). It’s been tested on Mac and Linux, but unfortunately not on Windows yet. If anyone is interested in testing it out there, I’d really appreciate it.

My typical workflow using the fiber-pay CLI goes like this:

  1. Install:
npm install -g @fiber-pay/cli
  1. Start a default testnet node:
fiber-pay node start --daemon

# Node daemon starting (PID: 17122)
# Use `fiber-pay node status --json` to verify readiness.
  1. Get your node’s funding address as a QR code:
fiber-pay wallet address --qrcode

✅ Funding address retrieved

 ▄▄▄▄▄▄▄     ▄▄  ▄▄▄▄▄▄▄▄  ▄ ▄▄ ▄  ▄▄▄▄▄▄▄
 █ ▄▄▄ █ ▄ ▀▀ ▄ ▄██▄▄ █▄ ▄▀▄██ █ █ █ ▄▄▄ █
 █ ███ █ █▀█▄▀ ▀▀▄ ▄█▄▀▄█ █▀ █▀ ▄█ █ ███ █
 █▄▄▄▄▄█ █▀▄ ▄ ▄▀▄ █ █▀▄ █ █▀█ █ █ █▄▄▄▄▄█
 ▄ ▄▄▄▄▄ ▀▄▀▀ ▀▀  ▄█▀█▀▄ ▀▄▀  ▄▀▄▄ ▄▄▄▄▄
  ▀█▄█▀▄█  ▄█▀▄▄▀█ ▄▀▀▀▄▀▀ █▄▀▄▀▀▄▀▀██▄▄ ▀
  █▀ █▀▄ ▀ ▀█▄▄██ ▄ ▀█▀▄▀█▄ ▀ ▄   ▄▀ ▀▀▄▄▀
 ▀▀ ██▀▄█▄██ ▀▀▄▀▀██ ▄ ▀▄▄▄▀▄▀  ▀▀▄▀██ ▄ ▀
 ▄██ ██▄█▄▀▀█ █▀▄▀▄▀ ▄▀▄█ ▄ ▀ ▄█ ▀  █▀▄▄█
    ▄█▀▄█▄ ▄▄▀█▀▄  ▄▀▀ ▄▀▀▀█▄█▄ ▀▀ ███ ▀ ▀
 █▀  █▀▄▄▀▄█ ▄▀▄ ▄ ▄ █▄▄▀ ▄ ▄▀▄  █▀ ▄▀█▄
 █▀ ▀ ▀▄▄▀ █▀▄▄▄▀█▄▄▀█  ▀█▀▀▄█▄█▀▀▀▀ ▀▄ ▀▀
 ▀ █▄██▄▄ ▄█▀▀▄▀ ▀▄ ▄ ▀▄▀█▄ ▀▄▄ █  ▀▄ █▄▄
 ▀▄▄▄▀▄▄██▀▀██▀█▄█ ▄▀▀█▄▀▄▄▀▄   ▀▀ ▀█▀▄█▄▀
 █▄▀▄  ▄▄█▀ ▄████▄▄▄█▀▀▄▄█▄▄█▄▄█ █▀▀▄▀█▄██
 █▀▀▀ ▄▄  ▀▀█▄▄▄ ▄▄ ▄▀▀▄ ▀▄▀▄█▄▄▀█▄█▀██▄▄▀
 █   ▀█▄▄▀▄▀██▀▄ ▄▄▀██▀█▀█▄██▄▄  ▄██▄▄█▄
 ▄▄▄▄▄▄▄ ▀  ▀▄█  ▀█▀▀▄█ ▀ ▄▀▄▄▄█▄█ ▄ ██▄▀▀
 █ ▄▄▄ █ █▄▄ █▄ ▀ ▀▀ ██▀▀▀▄▄██▄ ▀█▄▄▄██▄██
 █ ███ █ ██▀ ▀▀█ ▀█▀▀▀▄█▀▄ ▄▄ ▄█ ▀▄▄▀▄█ ▀▀
 █▄▄▄▄▄█ ▄ █▄ █▀▀█▄▀▄ ▀▄▀█▄███▄█▄▀  ▄██▄▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  ckt1qzda...axcl2c

(Scan the address with your CKB wallet and deposit some funds)

  1. Check the funding address balance after depositing:
fiber-pay wallet balance

# ✅ CKB balance retrieved
#  Balance: 7999.99898862 CKB
#  Balance (shannons): 799999898862
  1. Check the network:
fiber-pay node network
Node Network Overview
=====================

Connected Peers: 6
Active Channels: 1
Total Channel Capacity: 1.0 CKB

Peers:
  PEER_ID                ALIAS                ADDRESS                    VERSION
  --------------------------------------------------------------------------------
  QmfNUEDq9Z...fZU1kGjR  (unnamed)            /ip4/16.162.99....fZU1kGjR 0.7.1
  Qmes1EBD4y...JMsoYFKy  bootnodesgp          /ip4/54.179.226...JMsoYFKy 0.7.1
  Qmd2LiBRNL...rfpm5gE2  (unnamed)            /ip4/3.212.70.7...rfpm5gE2 0.6.0-rc
  Qmc9tdvFCh...YMZ1T7uj  (unnamed)            /ip4/82.29.173....YMZ1T7uj 0.7.1
  QmdyQWjPtb...NDrTNaeV  bootnodehk           /ip4/16.163.7.1...NDrTNaeV 0.7.1
  QmXen3eUHh...X69XJ1Eo  CryptapeNode-1       /ip4/18.162.235...X69XJ1Eo 0.7.1

Channels:
  CHANNEL_ID             PEER_ALIAS           STATE          LOCAL_BAL     REMOTE_BAL   CAPACITY
  -----------------------------------------------------------------------------------------------
  0x4fdf9278...a95733cf  CryptapeNode-1     CHANNEL_READY       900.9       151.1      1.0

Listing channels and connected peers is easy too: just use fiber-pay channel list and fiber-pay peer list.

  1. Run multiple nodes with --profile:
    Another feature I use often is setting up multiple nodes for testing and managing them with different profiles:

Node 1:

fiber-pay --profile testnode1 config init --rpc-port 28227 --p2p-port 28228 --proxy-port 28229

Node 2:

fiber-pay --profile testnode2 config init --rpc-port 38227 --p2p-port 38228 --proxy-port 38229

Node 3:

fiber-pay --profile testnode3 config init --rpc-port 48227 --p2p-port 48228 --proxy-port 48229

(Note: I updated the profile names to testnode2 and testnode3 so they don’t overwrite each other!)

To manage any of these nodes, just pass the corresponding --profile <name> flag in your command—everything else remains the same. eg:

fiber-pay --profile testnode3 node start --daemon

There’s so much more to share, like the log command to monitor your nodes, AI-friendly flags on each command, and more. If you try it out, let me know what you think! I’ll be posting a future work plan for this little tool soon.

3 Likes

Your timing is impeccable. This slots perfectly into my hackathon build. Huge thanks.:folded_hands:

3 Likes