Add capabilities to create a PSBT transactions and finalize them in API #6049
alishanda
started this conversation in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When a user of my app clicks "send bitcoins" on my website, they enter an amount and provide an external Bitcoin wallet address. After that, they send the coins to this address. To avoid losing money, we deduct the Bitcoin network fee from the withdrawal amount.
However, we want to give our users the option to send coins such that the network fee is deducted additionally from their deposit.
For example, if a user on my site has a balance of 0.1 BTC and needs to receive exactly 0.008456 BTC to their external address, they provide their Bitcoin wallet address and the amount of 0.008456 BTC. Upon withdrawal, the network fee will be deducted from their site balance.
To implement this mechanism, we decided to first create a PSBT (Partially Signed Bitcoin Transaction), extract the actual network fee from it, check if the user's deposit is sufficient to cover the transaction, and if so, complete the transaction by reducing the user's site balance by the actual withdrawal amount.
Currently, we do not have an API method for finalizing a PSBT transaction. Additionally, we lack an API method for creating such a transaction and receiving a response in a readable form; it is only available in hex.
Is it possible to add these capabilities to the API?
Beta Was this translation helpful? Give feedback.
All reactions