Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticAddr: Withdraw arbitrary amounts #860

Open
wants to merge 5 commits into
base: static-addr-staging
Choose a base branch
from

Conversation

hieblmi
Copy link
Collaborator

@hieblmi hieblmi commented Dec 2, 2024

This PR adds an amount field to the withdrawal rpc.

It allows to withdraw a fraction of the sum of selected deposits to withdraw. The change is sent back to the static address.
If the change is below the dust limit it goes towards miner fees, but warns the user beforehand.

loop static withdraw --utxo XXX ---utxo YYY --dest_addr ZZZ --amount 1500000

…address

StaticAddr: withdrawal destination address and fee rate
@hieblmi hieblmi self-assigned this Dec 2, 2024
@hieblmi hieblmi changed the base branch from master to static-addr-staging December 2, 2024 11:03
@hieblmi hieblmi marked this pull request as draft December 2, 2024 11:03
looprpc/client.proto Outdated Show resolved Hide resolved
@hieblmi hieblmi force-pushed the withdraw-amounts branch 4 times, most recently from d69eda3 to 4f2ff5d Compare December 3, 2024 12:13
@hieblmi hieblmi marked this pull request as ready for review December 3, 2024 12:44
// The change amount will be sent back to the static address. The client
// ensures that the change amount covers the transaction fee, and that the
// change after fees is at least the dust limit.
int64 change_amount = 5;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I propose to replace client_withdrawal_addr, withdraw_amount and change_amount with a psbt, so the UTXO could be used for whatever purpose, e.g. batch sending, coinjoin/payjoin, channel opening etc.

addressParams, err := m.cfg.AddressManager.GetStaticAddressParameters(
ctx,
// Send change back to the static address.
changeAddress, err := m.cfg.AddressManager.GetTaprootAddress(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why m.cfg.AddressManager.GetStaticAddress(ctx) can't be used here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants