New answers tagged

5

Since the activation of Segwit, transaction size is expressed in Weight Units (WU). Weight Units can be converted to a "virtual size" or virtual bytes (vB) by dividing by 4 and rounding up. The virtual size dictates how large your transaction is when paying fees. Non-Segwit Transactions For now, let's focus on Non-Segwit transactions. Each Non-Segwit byte ...


-1

Similarly to how a browser decodes a bunch of text, which is arranged in accordance with a certain protocol (html), and creates a nice interface you can view (provided it has all the right pieces, so starts with , has all matching <> for tags, etc, otherwise your browser displays an error or a garbage page) ... A bitcoin node will decode a bunch of text,...


0

Depending on the type of transaction, inputs, outputs and other factors..add them all up here is a link to bitcoin docs giving byte size for everything https://en.bitcoin.it/wiki/Protocol_documentation#tx


0

I wrote some code to calculate an estimate for multisig transaction size based on Karimkorun's almost unreadable answer and based off the (incomplete) documentation here. The code: var pubkeySize = 33 var sigSize = 72 // An approximation based on the example in // https://en.bitcoin.it/wiki/Protocol_documentation#tx var pubkeyScriptSize = 25 var m = 2, n ...


1

You need to take a look at how fee_estimates.dat is written and interpreted. Basically it's composed of: MIN_VERSION CURRENT_VERSION CURRENT_TIP TIP_AT_LAST_START TIP_AT_LAST_STOP [ESTIMATES] [STATS] With CURRENT being "when writing", i.e. when stopping bitcoind. Here is the method writing the file, and here is the method reading this file (at startup). I ...


0

You need to fill up the mempool of your regtest nodes and mine blocks. For reference here is how it's done to test estimatesmartfee.


0

So how we can calculate txn fee before signing and sending txn for external addresses? As a reference: P2PKH P2SH-P2WPKH P2WPKH ------------------------------- Input : 592 WU 364 WU 272 WU Output : 136 WU 128 WU 124 WU All transactions include 40 WU by default. If your transaction spends a P2SH-P2WPKH or P2WPKH ...


1

"fundrawtransaction" and "walletcreatefundedpsbt" are wallet RPCs. They add inputs and change outputs from your wallet to aim for a specific feerate for the transaction. These operations inherently require the relevant wallet. Change addresses are generated by the sender's wallet, and inputs have to come from the wallet of the sender. If you don't have that ...


0

If you want to implement your coin selection, the only alternative to calculating the fee manually I can think of is the following: You select which inputs you want to be used in your transaction based on your coin selection algorithm. You then proceed to lock every input that is not the one you selected. You can get the list of all inputs through ...


Top 50 recent answers are included