Which Bitcoin RPC call is used for setting transaction priority?

1

1

Is there is any bitcoin RPC call for setting the transactions priority ?

Pankaj Kumar

Posted 2018-12-05T12:48:06.970

Reputation: 145

you may want to rephrase your question, what do you mean exactly when you say "transaction priority". You just want it to confirm faster? This term also used to refer to a specific thing which no longer exists in new clients: https://bitcoin.stackexchange.com/questions/54583/why-is-the-transaction-priority-removed which can be confusing

kaykurokawa 2018-12-05T15:56:56.307

Answers

0

I have found the way to set the fee of a transctions

While sending the BTC to other user we need to use the sendmany rpc call to send BTC and set the replacble parameter as true

next user can use the bumpfee method to pass the txid along with the fee that need to be applied to the unconfirmed transactions

e.g txid=rpc_connection.sendmany("pks891618",{"2MzLYJLb14r6jJHzW9WQpAa5xERuV9EYvn3":0.9},1 ,"moneysend" ,[],True) print(rpc_connection.gettransaction(txid)) ftxid=rpc_connection.bumpfee(txid,{"totalFee":50000,"replaceable":True})

Pankaj Kumar

Posted 2018-12-05T12:48:06.970

Reputation: 145

i guess transaction priority depends on the amount of fee you are willing to submitcryptoKTM 2019-01-14T09:32:03.827

1

The transaction priority is implied by the fee which you set for it. You can estimate the fee with your desired priority using https://bitcoincore.org/en/doc/0.16.0/rpc/util/estimatesmartfee/

Simply compute your transaction size (bytes) and adjust the transaction fee according to the sat/kB returned by the estimatesmartfee call.

James C.

Posted 2018-12-05T12:48:06.970

Reputation: 2 183

Sorry James but how fee can be set , the above method is returning the estimate fee , Here is what i want to allow my wallet customer .. Suppose customer want that his transaction can be done fast and he is ready to pay more for the transaction fee . Which method allow me to do thisPankaj Kumar 2018-12-05T13:01:29.783

Are you using bitcoind wallet? If not, you need to compute the size of your signed transaction manually. Since you haven't signed it without knowing the fee, you can assume a DER signature to be 72 Bytes long, though it could be as short as 70. Then, make sure your output amounts - input amounts = feerate * tx_bytes. For scripting raw transactions, see https://en.bitcoin.it/wiki/Raw_Transactions#createrawtransaction_.5B.7B.22txid.22:txid.2C.22vout.22:n.7D.2C....5D_.7Baddress:amount.2C....7D

James C. 2018-12-05T13:06:48.330

i am using the bitcoin-cliPankaj Kumar 2018-12-05T13:21:23.197

Ok - use createrawtransaction. But also try to understand the tx length you want to build (version, inputs, outputs, locktime, witness), so you know how many tx bytes you are dealing with.James C. 2018-12-05T13:25:28.910

James i am using the bitcoin RPC calls to send coin from one wallet to another. Suppose A user sending 0.01 BTC to B. 1) While sending how user A come to know how much fee will be applied 2) If A select custom fee , how that can be applied to the current transactionsPankaj Kumar 2019-01-04T08:55:49.363

I am not sure I understand your question. Each tx requires an estimate of the required mining fee to receive confirmation within reasonable time after being broadcast. Subsequent txs must repeat this process independently, as the blocks may have gotten full or empty and the necessary fee rate has changed.James C. 2019-01-04T08:58:57.317

User regiser with username and i am making the rpc regtest call to assign he wallet adddress to the username Now user can send and recieve the BTC . On the server i am using rpc call to send and recieve BTC. Now here is what i needed 1) Suppose User A wants to send BTC to B user . 2) While A sending the BTC to B on the form there must be a option to select the transcation priority (If his transacation can be processed on high priority or not. ) A can also select the custom fee (sat/byte) 3) I cant see any rpc call for custom fee or transaction priorityPankaj Kumar 2019-01-04T09:15:30.810

Because the priority or fee us implied in the tx. It is the difference between output amounts and previous output amounts referenced by the inputs. The fee is not explicitly set somewhere, it is simply subtracted from the available previous output amount referenced by your tx.James C. 2019-01-04T09:18:06.877

Please check this screenshot https://www.awesomescreenshot.com/image/3807635/a65560c9fd2af89cf268a350bae80dd5. Blockchain.com allowing the user to selection priority and also customize the fee .

Pankaj Kumar 2019-01-04T09:39:41.047

Yes, it will add the fee automatically, so person B will receive the amount you specified, but the “input” amount will be higher, namely by the fee amount. But on the protocol level, there is no fee data structure, just input amounts (referenced) and output amounts (explicitly encoded).James C. 2019-01-04T10:29:37.793

PrioritiseTransaction , James i have found this RPC call , can you please check it https://bitcoin.org/en/developer-reference#prioritisetransaction .I think with this we can set the priority for the transaction

Pankaj Kumar 2019-01-08T12:03:51.777

This call only prioritizes the tx for miners who are building new block templates from the mempool of your node. It will not prioritize for any other miners on the network, they only see your fee and prioritize accordingly.James C. 2019-01-08T12:05:39.843

Ok Suppose , my node have a transaction with high fee(more then all bitcoin network ) then what are the possibilities that the next block will add this transactions on the bitcoin network ?Pankaj Kumar 2019-01-08T12:10:24.963

Good question, check recently confirmed block txs to get an estimate. There are bitcoin fee estimation algorithms you can find and research on the web.James C. 2019-01-08T13:47:26.323