Author

Topic: How to add a custom struct to PSBT and handle transaction fees using BIP-174 (Read 164 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
--snip--
Thanks for explanation. By the way in what platform I can see your illustrations on Bitcoin topics ? I have found only X but it doesn't seems the best platform to investigate something

As i said previously, i never create any Bitcoin illustrations. But if you want to see more illustration created by @cygan, you can check https://twitter.com/BTCillustrated.
?
Activity: -
Merit: -
I'm not expert on PSBT, but
1. BIP 370 (PSBT v2) improve BIP 174 (PSBT v0) which add more feature, mainly adding more input and output.
2. TX fee actually determined by subtract total coin on the input and total coin on the output. That means determining who's responsibility to pay TX fee entirely depends on all inputs and outputs.



Secondly  in the usual cases the party providing the fund usually bear the transaction fee but you can also distribute the fees between the two party by using
output tagging (BIP-68) or you can negotiate the fee distribution outside the protocol

BIP 68 isn't about output tagging. It's about timelock which determine when an UTXO can be spend, not about managing TX fee. Here's simple explanation about BIP 68 to other reader.


Thanks for explanation. By the way in what platform I can see your illustrations on Bitcoin topics ? I have found only X but it doesn't seems the best platform to investigate something
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
I'm not expert on PSBT, but
1. BIP 370 (PSBT v2) improve BIP 174 (PSBT v0) which add more feature, mainly adding more input and output.
2. TX fee actually determined by subtract total coin on the input and total coin on the output. That means determining who's responsibility to pay TX fee entirely depends on all inputs and outputs.



Secondly  in the usual cases the party providing the fund usually bear the transaction fee but you can also distribute the fees between the two party by using
output tagging (BIP-68) or you can negotiate the fee distribution outside the protocol

BIP 68 isn't about output tagging. It's about timelock which determine when an UTXO can be spend, not about managing TX fee. Here's simple explanation about BIP 68 to other reader.

how bip68 works and how the relative lock-time using nsequence actually looks like can be seen very well in the 4 following slides



?
Activity: -
Merit: -
The second parity can be structured with a custom struct (output or metadata). As long as the first party is only the one providing funds, that will pay all the fees. Bitcoin blockchain don't support splitting fees. But splitting fees are the most important in your case, we can adjust it manually by controlling inputs and outputs of the transaction. I think you can practice with bitcoinjs-lib which is the library for Bitcoin PSBT, addresses, etc.
?
Activity: -
Merit: -
I am working on a Bitcoin transaction where two parties are involved. The goal is to lock funds and create a custom struct in the transaction output. Here's how I intend to set it up:

First party provides the funds and initiates a Partially Signed Bitcoin Transaction (PSBT) using BIP-174. Second party will add a custom struct (possibly metadata or a specific output detail) to the PSBT without providing any funds. I'm wondering if the following is possible:

Can the second party add a custom struct (output or metadata) to the PSBT, while the first party is the only one providing funds? Who will be responsible for paying the transaction fees? Will the first party bear all the fees since they are providing the input funds, or is there a way to distribute this between the parties? Are there any known constraints or best practices for achieving this within Bitcoin's protocol and the PSBT standard? I would appreciate any guidance on whether this setup is feasible and how to handle fees and struct addition in a PSBT.
Jump to: