Skip to content

multi: migrate to btcd v2 modules + add WalletKit.SubmitPackage#280

Merged
ellemouton merged 2 commits into
lightninglabs:masterfrom
ellemouton:walletkit-submitpackage
Jul 1, 2026
Merged

multi: migrate to btcd v2 modules + add WalletKit.SubmitPackage#280
ellemouton merged 2 commits into
lightninglabs:masterfrom
ellemouton:walletkit-submitpackage

Conversation

@ellemouton

@ellemouton ellemouton commented Jun 11, 2026

Copy link
Copy Markdown
Member

Combines the two changes that were split across #280 and #282 into a single
PR for easier review. Two commits:

1. mod: update to btcd v2 modules

Migrates lndclient to the new per-package v2 modules introduced by btcd
v0.26.0. The monolithic btcd packages (wire, txscript, chaincfg,
chainhash, btcutil, psbt) were split out into their own /v2 modules,
and the address-handling symbols moved out of btcutil into a new address
package (imported as btcaddr to avoid shadowing local address variables).

All dependencies are pinned to released tags — no fork replaces:

  • btcd v0.26.0 + btcec/v2 v2.5.0
  • btcwallet v0.18.0, neutrino v0.18.0, lightning-onion v1.4.0
  • lnd master (post btcd-v2), lnd/tlv v1.4.0, lnd/tor v1.2.0

btcec/v2 v2.5.0 requires Go 1.25, so the Go version is bumped to 1.25.11.

2. walletkit: add SubmitPackage client method

Adds WalletKitClient.SubmitPackage, wrapping lnd's new WalletKit.SubmitPackage
RPC (lightningnetwork/lnd#10900, merged).
It serializes the topologically-sorted transactions, forwards an optional
per-transaction max fee rate (nil uses the node default), and maps the proto
response into an lndclient-native SubmitPackageResult so callers do not depend
on btcjson's submitpackage types.

This lets a zero-fee v3/TRUC parent be relayed via its fee-paying CPFP child
(bitcoind's submitpackage) without the caller needing a separate connection
to the chain backend.

@ellemouton ellemouton force-pushed the walletkit-submitpackage branch from c6ad7ac to 60fdb7e Compare June 11, 2026 21:31
@bhandras bhandras mentioned this pull request Jun 16, 2026
3 tasks
Comment thread walletkit_client.go Outdated

func (m *walletKitClient) SubmitPackage(ctx context.Context,
txns []*wire.MsgTx,
maxFeeRate *float64) (*btcjson.SubmitPackageResult, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should leak btcjson here (notice how it was just imported with this diff). Instead we should make a higher level wrapper type like we do elsewhere for related APIs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed — the method no longer leaks btcjson. It now maps the proto response into lndclient-native SubmitPackageResult / SubmitPackageTxResult types (with chainhash.Hash txids), so callers don't depend on btcjson's submitpackage types. The btcjson import is gone from the file.

@ellemouton ellemouton force-pushed the walletkit-submitpackage branch 2 times, most recently from 1eebf77 to 66d2a3f Compare June 17, 2026 18:19
@ellemouton ellemouton force-pushed the walletkit-submitpackage branch from 66d2a3f to 4024c4a Compare July 1, 2026 15:21
Bump btcd to v0.26.0 and adopt its new per-package v2 modules: wire/v2,
txscript/v2, chaincfg/v2, chainhash/v2, btcutil/v2, psbt/v2, and
btcec/v2 v2.5.0. The address symbols that moved out of btcutil into the
new address package (DecodeAddress, the Address types and the
NewAddress* constructors) are imported as btcaddr to avoid shadowing by
local "address" variables.

The migrated dependencies are now pinned to their released tags: lnd
master (post btcd-v2), btcwallet v0.18.0, neutrino v0.18.0, and
lightning-onion v1.4.0.

btcec/v2 v2.5.0 requires Go 1.25, so the Go version is bumped to
1.25.11.
Add WalletKit.SubmitPackage, wrapping lnd's new WalletKit.SubmitPackage
RPC. It serializes the topologically-sorted transactions, forwards the
optional per-tx max fee rate (nil uses the node default), and maps the
proto response back to the lndclient-native SubmitPackageResult so
callers do not depend on btcjson's submitpackage types.
@ellemouton ellemouton force-pushed the walletkit-submitpackage branch from 4024c4a to ee76ab9 Compare July 1, 2026 15:38
@ellemouton ellemouton changed the title walletkit: add SubmitPackage client method multi: migrate to btcd v2 modules + add WalletKit.SubmitPackage Jul 1, 2026
@ellemouton ellemouton mentioned this pull request Jul 1, 2026
5 tasks
@ellemouton ellemouton marked this pull request as ready for review July 1, 2026 16:05

@GeorgeTsagk GeorgeTsagk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ellemouton ellemouton requested a review from Roasbeef July 1, 2026 20:59

@Roasbeef Roasbeef left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🌪️

@ellemouton ellemouton merged commit 09c5491 into lightninglabs:master Jul 1, 2026
1 check passed
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.

3 participants