Electrum: Implement bump fee (increase fee) for RBF transactions on the command line (CLI)

Created on 22 Nov 2019  Â·  4Comments  Â·  Source: spesmilo/electrum

Using electrum 3.3.4.

usage: electrum payto [-h] [-v [VERBOSITY]] [-D ELECTRUM_PATH] [-P]
[-w WALLET_PATH] [--testnet] [--regtest] [--simnet]
[-f FEE] [-F FROM_ADDR] [-c CHANGE_ADDR] [--nocheck]
[-u] [--rbf RBF] [-W PASSWORD] [--locktime LOCKTIME]
destination amount

Create a transaction.

positional arguments:
destination Bitcoin address, contact or alias
amount Amount to be sent (in BTC). Type '!' to send the
maximum available.

optional arguments:
-h, --help show this help message and exit
-f FEE, --fee FEE Transaction fee (in BTC)
-F FROM_ADDR, --from_addr FROM_ADDR
Source address (must be a wallet address; use sweep to
spend from non-wallet address).
-c CHANGE_ADDR, --change_addr CHANGE_ADDR
Change address. Default is a spare address, or the
source address if it's not in the wallet
--nocheck Do not verify aliases
-u, --unsigned Do not sign transaction
--rbf RBF Replace-by-fee transaction
-W PASSWORD, --password PASSWORD
Password
--locktime LOCKTIME Set locktime block number

global options:
-v [VERBOSITY] Set verbosity filter
-D ELECTRUM_PATH, --dir ELECTRUM_PATH
electrum directory
-P, --portable Use local 'electrum_data' directory
-w WALLET_PATH, --wallet WALLET_PATH
wallet path
--testnet Use Testnet
--regtest Use Regtest
--simnet Use Simnet

It is unclear from the documentation how to use --rbf parameter.
Suppose I have json file with a transaction that had been broadcasted, but got stuck in the mempool.
If I want to increase the fees, my next actions suppose to be ... ???
electrum payto --rbf 30000 1... 1.0 > txrbf.json

Is it correct?
I am asking because I looked up the fees on that txrbf.json and they are the same as were specified via
electrum setconfig fee_per_kb

So it looks like if I am to broadcast txrbf.json I would just create a new transaction. Correct?

What suppose to be a proper way to use --rbf then?

CLRPC ▶ enhancement ✨ topic-wallet 👛

Most helpful comment

I have tried to clear up the "rbf" argument in https://github.com/spesmilo/electrum/commit/c31fa059fe01a38ae5f382715283fbec5f6dca9a

You have misunderstood what it does: it should be a boolean, and you can set whether the transaction should be replaceable using it (whether to signal opt-in RBF). If not specified, it gets set according to the config, which by default is True.

What you are looking for is to actually replace a tx that did signal RBF, with a new one; to increase/bump the fee.
This is not implemented atm on the command-line, only in the Qt/kivy GUIs.

All 4 comments

I have tried to clear up the "rbf" argument in https://github.com/spesmilo/electrum/commit/c31fa059fe01a38ae5f382715283fbec5f6dca9a

You have misunderstood what it does: it should be a boolean, and you can set whether the transaction should be replaceable using it (whether to signal opt-in RBF). If not specified, it gets set according to the config, which by default is True.

What you are looking for is to actually replace a tx that did signal RBF, with a new one; to increase/bump the fee.
This is not implemented atm on the command-line, only in the Qt/kivy GUIs.

What you are looking for is to actually replace a tx that did signal RBF, with a new one; to increase/bump the fee.
This is not implemented atm on the command-line, only in the Qt/kivy GUIs.

I have changed this issue to be a feature request now.

This is not implemented atm on the command-line, only in the Qt/kivy GUIs.

And this is kinda strange thing to hear.
I read "The Art of Unix Programming", a book by Eric S. Raymond and understood that gui should be a wrap around cli. So to get full control and full features I should always use cli.

And it is unclear what should I do now. :)

I read "The Art of Unix Programming", a book by Eric S. Raymond and understood that gui should be a wrap around cli.

Electrum is architectured such that there is a core library, and the different GUIs and the CLI are just users ("interfaces" :P) of that library, not all of them implementing/exposing all functionality of the underlying library.

And it is unclear what should I do now. :)

The easiest thing would be to open your wallet using the Qt GUI, and increase the fee there.
You can keep using it via the CLI after, if you prefer that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cculianu picture cculianu  Â·  5Comments

ZoZoRocks picture ZoZoRocks  Â·  4Comments

Akshansh1903 picture Akshansh1903  Â·  4Comments

2600box picture 2600box  Â·  5Comments

Kixunil picture Kixunil  Â·  4Comments