Skip to content

docs(res): comprehensive cross-chain HTLC documentation#71

Open
humble-little-bear wants to merge 2 commits into
nervosnetwork:doc_2.0from
humble-little-bear:doc/cch-cross-chain-htlc
Open

docs(res): comprehensive cross-chain HTLC documentation#71
humble-little-bear wants to merge 2 commits into
nervosnetwork:doc_2.0from
humble-little-bear:doc/cch-cross-chain-htlc

Conversation

@humble-little-bear

Copy link
Copy Markdown

This PR replaces the WIP placeholder for Cross-Chain HTLC with a full developer guide covering architecture, mechanics, and usage.

What's added

  • CCH architecture overview (actors, state machine, trackers, actions)
  • Detailed atomic swap flows for send_btc and receive_btc
  • Configuration reference for in-process and standalone modes
  • Security mechanisms: expiry safety, preimage verification, permanent vs. transient errors
  • Developer integration patterns (polling, fee estimation, wrapped BTC discovery)
  • Error reference table
  • Source code pointers for contributors

Related issue

Closes RET-43

🤖 Generated with Claude Code

Adds a developer-friendly guide covering:
- CCH architecture and actor model
- HTLC atomic swap mechanics (SendBTC / ReceiveBTC)
- Order state machine and action lifecycle
- Configuration for in-process and standalone modes
- Security mechanisms (expiry safety, preimage verification)
- Error reference and developer integration patterns

Closes RET-43

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@humble-little-bear is attempting to deploy a commit to the CKBA-2026 Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fiber-docs Ready Ready Preview, Comment Jun 10, 2026 8:35am

Request Review

Comment thread content/docs/res/cross-chain-htlc.mdx Outdated
4. Alice pays the Fiber invoice
5. Ingrid pays the Lightning invoice to Bob
6. Both payments settle atomically
- **Payment interoperability**: A Fiber user can pay any Lightning invoice, and a Lightning user can pay any Fiber invoice.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread content/docs/res/cross-chain-htlc.mdx Outdated

### Configuration

CCH is enabled by adding a `[cch]` section to your Fiber config file (or via CLI flags / env vars):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CCH is enabled by adding a `[cch]` section to your Fiber config file (or via CLI flags / env vars):
To run CCH, add `cch` to the `services` list and configure the `cch` section in your Fiber `config.yml` (or provide the equivalent CLI flags / environment variables).

Comment thread content/docs/res/cross-chain-htlc.mdx Outdated
2. **On `IncomingAccepted`** (`on_entering`): `SendOutgoingPayment` + `TrackOutgoingPayment` are scheduled.
3. **On `OutgoingInFlight`** (`on_entering`): `TrackOutgoingPayment` is scheduled (ensures we keep watching).
4. **On `OutgoingSuccess`** (`on_entering`): `SettleIncomingInvoice` is scheduled.
5. **On final states** (`Success` / `Failed`): No further actions. Scheduler queues a prune job (21 days later).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. **On final states** (`Success` / `Failed`): No further actions. Scheduler queues a prune job (21 days later).
5. **On final states** (`Success` / `Failed`): No further actions. Final orders are pruned after their scheduled order expiry time plus an additional 21-day retention period

@yfeng2824 yfeng2824 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HappySonnyDev Broken links: invoice, HTLC, TLC, multi-hop routing, PTLC

- Link key terms (invoice, HTLC, TLC, PTLC, multi-hop routing) to existing docs
- Soften 'any invoice' wording to 'compatible invoice'
- Clarify final-order pruning retention period
- Update config example to YAML with services list
- Expand Related Topics with routing, payment channel, and glossary links

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants