Skip to content

Expose watchtower APIs on Node - #1031

Draft
vincenzopalazzo wants to merge 1 commit into
lightningdevkit:mainfrom
vincenzopalazzo:feat/expose-chain-monitor
Draft

Expose watchtower APIs on Node#1031
vincenzopalazzo wants to merge 1 commit into
lightningdevkit:mainfrom
vincenzopalazzo:feat/expose-chain-monitor

Conversation

@vincenzopalazzo

Copy link
Copy Markdown
Member

Summary

  • Adds Node::counterparty_commitment_txs_from_update, Node::initial_counterparty_commitment_tx, and Node::sign_to_local_justice_tx so watchtower clients (e.g. an Eye of Satoshi tower) can build + finalize justice transactions while the node is offline
  • Only plain lightning/bitcoin types cross the API boundary - internal type aliases in types.rs stay pub(crate), which is what shaped this API (accessor methods, not a raw ChainMonitor handle)
  • New error variants: ChannelMonitorNotFound, OnchainTxSigningFailed; UniFFI binding updated
  • Limitation: to_local output only, mirrors ChannelMonitor::sign_to_local_justice_tx - revoked HTLC outputs cannot be signed

Test plan

  • Integration test added in tests/integration_tests_rust.rs exercising the new APIs
  • cargo check, cargo check --tests, cargo fmt --check green locally (clippy on nightly hits pre-existing macro errors on clean HEAD too)

DRAFT: soliciting API-shape feedback before marking ready.

Add Node methods so watchtower clients (e.g. an Eye of Satoshi / rust-teos tower) can protect node funds while the node is offline: counterparty_commitment_txs_from_update, initial_counterparty_commitment_tx, sign_to_local_justice_tx. Only plain lightning/bitcoin types cross the API boundary; internal type aliases stay pub(crate). Limitation: to_local output only - revoked HTLC outputs cannot be signed (mirrors ChannelMonitor::sign_to_local_justice_tx).
@ldk-reviews-bot

Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

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