Skip to content

lnwallet+rpc: create a set of generic PSBT creation+signing RPC calls in the walletkit sub-server #3938

@Roasbeef

Description

@Roasbeef

Related To #3936. These two issue can be began more or less concurrently, as this portion is blocked on support within btcwallet itself. Once that implementation is complete, we'd then want to surface this for the end user within lnd itself.

At a higher level, a user should be instruct lnd to execute functionality similar to a fundrawtransaction call to obtain a complete PSBT packet paying out to the set of specified outputs. We'll also need to insert our change address and perform any needed verification checks. The dual of this call is then signing (to finalize) this PSBT packet, which will then be ready for broadcast by the end user.

This issue is primary concerned with the design of the RPC interace, as much of the lower level plumbing will be handled by the yet-to-be-written btcwallet interface.

Steps to Completion

  • Create to new calls (names just an example) on the WalletKit RPC sub-server: FundPsbtPacket and FinalizePsbtPacket. The names should be self explanatory.

  • The second portion of this issues deals with the work we'll need to do within btcwallet to ensure that we properly lock any relevant inputs (so we don't accidentally create double spends), and also release them if the user wants to abort the protocol. As a result, we'll also need an additional call to free up any inputs allocated to a PSBT. This portion of the issue is related to [Feature] Add the ability to craft on-chain transactions using specified UTXOs #2976.

Once this issue is done, we should be able to use an lnd instance to being a funding flow, and provide inputs for this funding flow from another lnd instance!

Metadata

Metadata

Assignees

Labels

fundingRelated to the opening of new channels with funding transactions on the blockchaininterface abstractionintermediateIssues suitable for developers moderately familiar with the codebase and LNwalletThe wallet (lnwallet) which LND uses

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions