Bitcoin Asked by ArchiKu on October 24, 2021
Help me please. I need to calculate vsize and multiply it by the function result estimatesmartfee
.
To calculate vsize, I implement a formula like this https://jlopp.github.io/bitcoin-transaction-size-calculator/
byt i cannot getting address type from Bitcoin API.
Please tell me how to get the address type by API for implementing this formula?
Please tell me how to get the address type by API for implementing this formula?
I don't know what API you're referring to, but if you are running a Bitcoin Node you can run the command bitcoin-cli getaddressinfo "YOUR_ADDRESS_HERE"
to get information about a particular address. Note that for addresses starting with "3", you will not be able to determine if it is P2WPKH in P2SH vs. P2SH, as they are indistinguishable from each other until spent. They will both have "isscript": true
. For "bc1q" addresses, they will both have "iswitness": true
and P2WSH will also have "isscript": true
.
Answered by Septem151 on October 24, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP