Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions btcwbackend/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ or LND node.
- `Wallet` — Top-level wallet wrapping `walletcore.Wallet` with neutrino chain service, chain backend, and boarding adapter. Constructors: `New` (owns neutrino lifecycle) and `NewWithNeutrino` (reuses pre-started service).
- `NeutrinoService` — Manages the neutrino `ChainService`, its bbolt DB, and lifecycle. Pre-started by the daemon for early P2P sync.
- `ChainBackend` — Implements `chainsource.ChainBackend` using neutrino's native `ChainNotifier` for confirmation tracking, spend detection, fee estimation, and optional direct package relay via `chainbackends.PackageSubmitter`.
- `ChainBackend.EstimateFeePerKW` — The fee estimator's rate in sat/kWU,
without the truncation to whole sat/vB that `EstimateFee` applies.
- `BoardingBackendAdapter` — Implements `wallet.BoardingBackend` and `wallet.OutputLeaser` by embedding `walletcore.BoardingBackendBase` and adding neutrino-backed `ListUnspent`, `GetTransaction`, `GetBlock`, `LeaseOutput`, and `ReleaseOutput`. Output leasing forwards to btcwallet's native lock table, casting `wallet.LockID` → `wtxmgr.LockID`.
- `Config` — Embeds `walletcore.Config` and adds neutrino-specific fields (peers, fee URL, persist filters) plus an optional `PackageSubmitter` for v3 parent+child relay.

Expand Down
2 changes: 2 additions & 0 deletions btcwbackend/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ or LND node.
- `Wallet` — Top-level wallet wrapping `walletcore.Wallet` with neutrino chain service, chain backend, and boarding adapter. Constructors: `New` (owns neutrino lifecycle) and `NewWithNeutrino` (reuses pre-started service).
- `NeutrinoService` — Manages the neutrino `ChainService`, its bbolt DB, and lifecycle. Pre-started by the daemon for early P2P sync.
- `ChainBackend` — Implements `chainsource.ChainBackend` using neutrino's native `ChainNotifier` for confirmation tracking, spend detection, fee estimation, and optional direct package relay via `chainbackends.PackageSubmitter`.
- `ChainBackend.EstimateFeePerKW` — The fee estimator's rate in sat/kWU,
without the truncation to whole sat/vB that `EstimateFee` applies.
- `BoardingBackendAdapter` — Implements `wallet.BoardingBackend` and `wallet.OutputLeaser` by embedding `walletcore.BoardingBackendBase` and adding neutrino-backed `ListUnspent`, `GetTransaction`, `GetBlock`, `LeaseOutput`, and `ReleaseOutput`. Output leasing forwards to btcwallet's native lock table, casting `wallet.LockID` → `wtxmgr.LockID`.
- `Config` — Embeds `walletcore.Config` and adds neutrino-specific fields (peers, fee URL, persist filters) plus an optional `PackageSubmitter` for v3 parent+child relay.

Expand Down
13 changes: 13 additions & 0 deletions btcwbackend/chain_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,19 @@ func (b *ChainBackend) Stop() error {
return stopErr
}

// EstimateFeePerKW returns the estimator's fee rate for the given
// confirmation target at full precision, unlike EstimateFee's whole sat/vB.
func (b *ChainBackend) EstimateFeePerKW(_ context.Context, targetConf uint32) (
chainfee.SatPerKWeight, error) {

feePerKw, err := b.feeEstimator.EstimateFeePerKW(targetConf)
if err != nil {
return 0, fmt.Errorf("estimate fee: %w", err)
}

return feePerKw, nil
}

// EstimateFee returns the estimated fee rate in satoshis per vbyte
// for the given confirmation target. The fee estimator queries a web
// API since neutrino has no mempool visibility.
Expand Down
3 changes: 3 additions & 0 deletions chainbackends/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ estimation, and optional v3 package relay via a pluggable `PackageSubmitter`.
- `LNDBackend` — Full-node backend wrapping lnd's chain notification and fee
estimation interfaces. Accepts an optional `PackageSubmitter` for v3 CPFP
package relay (set via `SetPackageSubmitter`).
- `LNDBackend.EstimateFeePerKW` — The estimator's rate in sat/kWU, for
callers that must not lose the precision `EstimateFee` truncates to whole
sat/vB.
- `TxBroadcaster` — Interface over transaction broadcasting (wraps
lndclient.WalletKitClient or in-process lnd).
- `PackageSubmitter` — Optional interface for v3 package relay:
Expand Down
3 changes: 3 additions & 0 deletions chainbackends/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ estimation, and optional v3 package relay via a pluggable `PackageSubmitter`.
- `LNDBackend` — Full-node backend wrapping lnd's chain notification and fee
estimation interfaces. Accepts an optional `PackageSubmitter` for v3 CPFP
package relay (set via `SetPackageSubmitter`).
- `LNDBackend.EstimateFeePerKW` — The estimator's rate in sat/kWU, for
callers that must not lose the precision `EstimateFee` truncates to whole
sat/vB.
- `TxBroadcaster` — Interface over transaction broadcasting (wraps
lndclient.WalletKitClient or in-process lnd).
- `PackageSubmitter` — Optional interface for v3 package relay:
Expand Down
13 changes: 13 additions & 0 deletions chainbackends/lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@ func (b *LNDBackend) logger(ctx context.Context) btclog.Logger {
return b.Log.UnwrapOr(build.LoggerFromContext(ctx))
}

// EstimateFeePerKW returns the estimator's fee rate for the given
// confirmation target at full precision, unlike EstimateFee's whole sat/vB.
func (b *LNDBackend) EstimateFeePerKW(_ context.Context, targetConf uint32) (
chainfee.SatPerKWeight, error) {

feePerKw, err := b.feeEstimator.EstimateFeePerKW(targetConf)
if err != nil {
return 0, fmt.Errorf("failed to estimate fee: %w", err)
}

return feePerKw, nil
}

// EstimateFee returns the estimated fee rate in satoshis per vbyte for the
// given confirmation target. The fee estimator will provide the rate needed to
// confirm within the target number of blocks.
Expand Down
16 changes: 16 additions & 0 deletions chainbackends/lnd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ func TestLNDBackendEstimateFeeConvertsSatPerKWOnce(t *testing.T) {
require.Equal(t, uint32(6), estimator.gotTarget)
}

func TestLNDBackendEstimateFeePerKWKeepsPrecision(t *testing.T) {
t.Parallel()

estimator := &stubFeeEstimator{
rate: chainfee.SatPerKWeight(499),
}
backend := NewLNDBackend(
&stubNotifier{}, estimator, &stubBroadcaster{},
)

gotRate, err := backend.EstimateFeePerKW(t.Context(), 6)
require.NoError(t, err)
require.Equal(t, chainfee.SatPerKWeight(499), gotRate)
require.Equal(t, uint32(6), estimator.gotTarget)
}

func TestRegisterConfSurvivesCallerContextCancellation(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion cmd/wavecli/waveclicommands/devrpc/registry_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions cmd/waved/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,23 +438,6 @@ func registerAssetFlags(f *pflag.FlagSet, cfg *waved.Config) {
"assets.tapd.rpctimeout", cfg.Assets.Tapd.RPCTimeout,
"timeout for individual tapd calls",
)
f.String(
"assets.lnd.host", cfg.Assets.Lnd.Host, "gRPC address of "+
"the lnd node behind tapd, which signs asset "+
"deposits; required by DepositAsset",
)
f.String(
"assets.lnd.tlspath", cfg.Assets.Lnd.TLSPath,
"path to the TLS certificate of the lnd node behind tapd",
)
f.String(
"assets.lnd.macaroonpath", cfg.Assets.Lnd.MacaroonPath,
"path to the admin macaroon of the lnd node behind tapd",
)
f.Duration(
"assets.lnd.rpctimeout", cfg.Assets.Lnd.RPCTimeout,
"timeout for individual calls to the lnd node behind tapd",
)
}

// registerArkServerFlags registers the daemon's outbound Ark operator flags.
Expand Down
17 changes: 7 additions & 10 deletions docs/daemon_cli_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ waved \
| `--assets.tapd.tlspath` | | Path to tapd TLS certificate |
| `--assets.tapd.macaroonpath` | | Path to tapd admin macaroon |
| `--assets.tapd.rpctimeout` | `30s` | Timeout for tapd RPC calls |
| `--assets.lnd.host` | | gRPC address of the lnd node behind tapd, which signs asset deposits; required by `DepositAsset` |
| `--assets.lnd.tlspath` | | Path to that lnd node's TLS certificate |
| `--assets.lnd.macaroonpath` | | Path to that lnd node's admin macaroon |
| `--assets.lnd.rpctimeout` | `30s` | Timeout for calls to that lnd node |
| `--server.host` | network default | Ark operator address override for the selected transport |
| `--server.transport` | `grpc` | Ark operator transport: `grpc` or `rest` |
| `--server.insecure` | `false` | Disable TLS for server connection |
Expand Down Expand Up @@ -452,12 +448,13 @@ wavecli dev daemon NewAddress
### `dev daemon deposit-asset` / `dev daemon list-asset-deposits`

Fund a boarding output holding a Taproot Asset from the tapd wallet, and list
those deposits. Requires `--assets.backend=tapd` and `--assets.lnd.host`. The
units come from one issuance, and any surplus returns to tapd as change.
The lnd wallet behind tapd pays the network fee, bounded by `--max-fee-sat`,
and the Bitcoin value of the deposit output (`value_sat`). The daemon sizes
that value from the operator's terms: two minimum VTXOs plus twice the
quoted round fee. When the deposit boards, the value pays the round fee and
those deposits. Requires `--assets.backend=tapd` and tapd v0.9.0 or later,
which signs its own asset inputs when it publishes. The units come from one issuance, and any
surplus returns to tapd as change. The daemon's own wallet pays and signs for
the network fee, bounded by `--max-fee-sat`, and the Bitcoin value of the
deposit output (`value_sat`) beyond what tapd's spent asset outputs carry.
tapd signs only those asset outputs, when it publishes. The daemon sizes the deposit value from the operator's terms: two
minimum VTXOs plus twice the quoted round fee. When the deposit boards, the value pays the round fee and
the asset VTXO's satoshis, and the rest becomes a BTC VTXO. Retrying with the
same `--request-id` resumes the deposit instead of funding it again. A
deposit is `published` once tapd broadcasts it and `confirmed` once it has the
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/lightninglabs/loop v0.33.0-beta
github.com/lightninglabs/neutrino v0.18.0
github.com/lightninglabs/neutrino/cache v1.1.4
github.com/lightninglabs/tap-sdk v0.3.1-0.20261112132723-6ebef2d4085f
github.com/lightninglabs/tap-sdk v0.3.1-0.20261113191234-4752d3cfb973
github.com/lightninglabs/wavelength/baselib v0.0.0-00010101000000-000000000000
github.com/lightningnetwork/lightning-onion v1.4.0
github.com/lightningnetwork/lnd v0.21.0-beta.rc2.0.20260903094101-d66a7c137d32
Expand Down Expand Up @@ -144,8 +144,8 @@ require (
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.4-0.20250610182311-2f1d46ef18b7 // indirect
github.com/lightninglabs/taproot-assets v0.7.1-0.20261006112023-1434ab66b3bb // indirect
github.com/lightninglabs/taproot-assets/taprpc v1.1.1-0.20261112123219-14aa3fd90e6a // indirect
github.com/lightninglabs/taproot-assets v0.7.1-0.20261113151742-18e87e38fe99 // indirect
github.com/lightninglabs/taproot-assets/taprpc v1.1.1-0.20261113151742-18e87e38fe99 // indirect
github.com/lightningnetwork/lnd/actor v0.0.6 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
github.com/lightningnetwork/lnd/queue v1.2.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1063,12 +1063,12 @@ github.com/lightninglabs/neutrino/cache v1.1.4 h1:KVtvUmBwYr7eKtjfjHG/q6/cQlcrjH
github.com/lightninglabs/neutrino/cache v1.1.4/go.mod h1:ZqLzxghPggIRfNXeAZN1VtTKofMyK/ALI6niYsPH6OE=
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS/00EiEg0qp0FhehxnQfk3vv8U6Xt3nN+rTY=
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
github.com/lightninglabs/tap-sdk v0.3.1-0.20261112132723-6ebef2d4085f h1:Lx1z6ZVz8VxjBF9ulTN0hhW0FI1VTbVSVPgnDrwZ728=
github.com/lightninglabs/tap-sdk v0.3.1-0.20261112132723-6ebef2d4085f/go.mod h1:F8kzeiYXXT9/puX+3TYULY9+HJbhxqZL/FEHk3HA/2k=
github.com/lightninglabs/taproot-assets v0.7.1-0.20261006112023-1434ab66b3bb h1:YXDLUvU57oe4XE3GYS6rZL/QiXtfjrSd1xGpPB/cUx4=
github.com/lightninglabs/taproot-assets v0.7.1-0.20261006112023-1434ab66b3bb/go.mod h1:ZxTc2Lr7ZMNj30AEiJcaiP/XaQfP4lD2Qa6xk+OrvHE=
github.com/lightninglabs/taproot-assets/taprpc v1.1.1-0.20261112123219-14aa3fd90e6a h1:2wMGcwunfUeOYhAb0XUwprhZBbaHKM3elfZv095b8AY=
github.com/lightninglabs/taproot-assets/taprpc v1.1.1-0.20261112123219-14aa3fd90e6a/go.mod h1:DnNNUTIcA4h1hMDOHDW8hYeYxvBDv7eCrgPusMw5nLA=
github.com/lightninglabs/tap-sdk v0.3.1-0.20261113191234-4752d3cfb973 h1:Hgp6M6ZAKMB4m+nnAuY9HqfH1OTcv8NT+6yJsRcme8Q=
github.com/lightninglabs/tap-sdk v0.3.1-0.20261113191234-4752d3cfb973/go.mod h1:C2VHKQHDFAPFKFjyk80FWbxNPJOV81jtbh0vF/97f/g=
github.com/lightninglabs/taproot-assets v0.7.1-0.20261113151742-18e87e38fe99 h1:n5BEnDL4LEa1K9uXfoiwT4/LyGSb28/nzn7QqNvfwpg=
github.com/lightninglabs/taproot-assets v0.7.1-0.20261113151742-18e87e38fe99/go.mod h1:jg87/exTVDpE4m7bfT5MFOqFawJZ27/Kd+7TGNCReRc=
github.com/lightninglabs/taproot-assets/taprpc v1.1.1-0.20261113151742-18e87e38fe99 h1:CkitcCYmvdYgBXVJcWhFIAj0EdLqot3zYCrIjm1+WuI=
github.com/lightninglabs/taproot-assets/taprpc v1.1.1-0.20261113151742-18e87e38fe99/go.mod h1:DnNNUTIcA4h1hMDOHDW8hYeYxvBDv7eCrgPusMw5nLA=
github.com/lightningnetwork/lightning-onion v1.4.0 h1:qWE1icOH4AKXRcq1KCzt6P/TesqptgBTP++V7wowTc0=
github.com/lightningnetwork/lightning-onion v1.4.0/go.mod h1:YDPkvVTVQ6FBBE6Yj93tDd7zA3iTSrryi9xq46i7bKE=
github.com/lightningnetwork/lnd v0.21.0-beta.rc2.0.20260903094101-d66a7c137d32 h1:lwPqwW244WCcdOZGwmS+rrieC1hTPYaRvkjHC8KXDeY=
Expand Down
13 changes: 0 additions & 13 deletions sample-waved.conf
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,6 @@
# Maximum duration for individual RPC calls to tapd.
# assets.tapd.rpctimeout=30s

# gRPC address of the lnd node behind tapd. It signs the asset deposits that
# tapd funds, and DepositAsset is unavailable without it.
# assets.lnd.host=

# Path to the TLS certificate of the lnd node behind tapd.
# assets.lnd.tlspath=

# Path to the admin macaroon of the lnd node behind tapd.
# assets.lnd.macaroonpath=

# Maximum duration for individual RPC calls to the lnd node behind tapd.
# assets.lnd.rpctimeout=30s

# Ark operator server address. Empty uses the network+transport default; see
# docs/signet.md for the public test-network endpoints.
# server.host=
Expand Down
Loading
Loading