Using Electrum Console (Beginner)

This website was created for the convenience of finding most Electrum commands, please see official Python Console Documents for more console information.

The commands on this page are compatible with the following Electrum clients:

Electrum (Bitcoin wallet) - https://electrum.org/#download

Electrum-LTC (Litecoin wallet) - https://electrum-ltc.org/#download

Make sure to only download from the official Electrum website and always verify the digital signatures.


First enable the console tab by going to View -> Show Console.

e1

Continue by clicking the console.

e2

Do not paste code into the console that you do not understand.

Pre Generate Addresses

Command:
for i in range(0,500): wallet.create_new_address(False)

Description: Sometimes you need to pre generate addresses in advance and need a high number of them, this command will pre generate 500 receiving addresses.

>>> for i in range(0,500): wallet.create_new_address(False)

Now that you have generated the addresses, change the gap limit so electrum daemon can sync transactions from these addresses and show true balance.

Command:
wallet.change_gap_limit(550)

>>> wallet.change_gap_limit(550)
True

We can now list the addresses we generated.

Command:
listaddresses()

>>> listaddresses()
[
    "bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd",
    "bc1qqfmcmdzjet4uh58axvucycqsk34pz7fmsltp5r",
    "bc1qq5g8pwfw9ztjvm55hw8nwk87868u9cv8xuh277",
    "bc1q0f9ddt4c4a3s9rv7ce6k95epc7radhmfgcy6zf",
    "bc1qudld089l0rye6qjl5tcka5k0dcxw03enxmwm8d",
    ...
]

getinfo()

Command:
getinfo()

Description: Return network info, wallet path, version, ect.

Example Usage:
>>> getinfo()
{
    "auto_connect": true,
    "blockchain_height": 740127,
    "connected": true,
    "default_wallet": "C:\\Users\\Administrator\\AppData\\Roaming\\Electrum\\wallets\\default_wallet",
    "fee_per_kb": 1521,
    "network": "mainnet",
    "path": "C:\\Users\\Administrator\\AppData\\Roaming\\Electrum",
    "server": "electrumserver.co",
    "server_height": 740127,
    "spv_nodes": 10,
    "version": "4.3.4"
}

getbalance()

Command:
getbalance()

Description: Return Electrum balance (Synchronization required first for true balance).

Example Usage:
>>> getbalance()
{
    "confirmed": "5.250202"
}

getservers()

Command:
getservers()

Description: Return list of Electrum servers.

Example Usage:
>>> getservers()
{
    "104.248.139.211": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "128.0.190.26": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "142.93.6.38": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "157.245.172.236": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "159.65.53.177": {
        "pruning": "-",
        "t": "50001",
        "version": "1.4.2"
    },
    "167.172.42.31": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "188.165.206.215": {
        "s": "50002"
    },
    "188.230.155.0": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "22mgr2fndslabzvx4sj7ialugn2jv3cfqjb3dnj67a6vnrkp7g4l37ad.onion": {
        "pruning": "-",
        "t": "50001",
        "version": "1.4.2"
    },
    "2604:a880:400:d1::849:6001": {
        "s": "50002"
    },
    "2AZZARITA.hopto.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "2azzarita.hopto.org": {
        "s": "50002"
    },
    "2electrumx.hopto.me": {
        "pruning": "-",
        "s": "56022",
        "t": "56021",
        "version": "1.4.2"
    },
    "2ex.digitaleveryware.com": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "37.205.9.165": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "68.183.188.105": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "73.92.198.54": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "89.248.168.53": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "E-X.not.fyi": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "VPS.hsmiths.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "alviss.coinjoined.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "assuredly.not.fyi": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "bejqtnc64qttdempkczylydg7l3ordwugbdar7yqbndck53ukx7wnwad.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.5"
    },
    "bitcoin.aranguren.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "bitcoin.lu.ke": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "bitcoins.sk": {
        "pruning": "-",
        "s": "56002",
        "t": "56001",
        "version": "1.4.2"
    },
    "blackie.c3-soft.com": {
        "pruning": "-",
        "s": "57002",
        "t": "57001",
        "version": "1.4.5"
    },
    "blkhub.net": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "blockstream.info": {
        "pruning": "-",
        "s": "700",
        "t": "110",
        "version": "1.4"
    },
    "btc.electroncash.dk": {
        "pruning": "-",
        "s": "60002",
        "t": "60001",
        "version": "1.4.5"
    },
    "btc.litepay.ch": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "btc.ocf.sh": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "btc.prompt.cash": {
        "s": "61002"
    },
    "btce.iiiiiii.biz": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "de.poiuty.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50004",
        "version": "1.4.5"
    },
    "e.keff.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "e2.keff.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "eai.coincited.net": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "ecdsa.net": {
        "pruning": "-",
        "s": "110",
        "t": "50001",
        "version": "1.4"
    },
    "egyh5mutxwcvwhlvjubf6wytwoq5xxvfb2522ocx77puc6ihmffrh6id.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "electrum.bitaroo.net": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "electrum.blockstream.info": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "electrum.dcn.io": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "electrum.emzy.de": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "electrum.hodlister.co": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4"
    },
    "electrum.hsmiths.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "electrum.jochen-hoenicke.de": {
        "pruning": "-",
        "s": "50006",
        "t": "50099",
        "version": "1.4.5"
    },
    "electrum.neocrypto.io": {
        "s": "50002"
    },
    "electrum.pabu.io": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "electrum.qtornado.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "electrum3.hodlister.co": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4"
    },
    "electrum5.hodlister.co": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4"
    },
    "electrumx.alexridevski.net": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "electrumx.erbium.eu": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "electrumx.schulzemic.net": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "elx.bitske.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "ex.btcmp.com": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "ex03.axalgo.com": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion": {
        "pruning": "-",
        "t": "110",
        "version": "1.4"
    },
    "exs.dyshek.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "fortress.qtornado.com": {
        "pruning": "-",
        "s": "443",
        "version": "1.5"
    },
    "fulcrum.grey.pw": {
        "pruning": "-",
        "s": "51002",
        "t": "51001",
        "version": "1.4.5"
    },
    "gall.pro": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "guichet.centure.cc": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "hodlers.beer": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "horsey.cryptocowboys.net": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "kareoke.qoppa.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "kittycp2gatrqhlwpmbczk5rblw62enrpo2rzwtkfrrr27hq435d4vid.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "lavahost.org": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "mainnet.foundationdevices.com": {
        "s": "50002"
    },
    "node.degga.net": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "node1.btccuracao.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "nuzzg3pku3xbctgamzq3pf7ztakkiidnmmier64arqwh3ajdddovatad.onion": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "qly7g5n5t3f3h23xvbp44vs6vpmayurno4basuu5rcvrupli7y2jmgid.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "ragtor.duckdns.org": {
        "s": "50002"
    },
    "rzspa374ob3hlyjptkdgz6a62wim2mpanuw6m3shlwn2cxg2smy3p7yd.onion": {
        "pruning": "-",
        "s": "50004",
        "t": "50003",
        "version": "1.4.2"
    },
    "skbxmit.coinjoined.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "smmalis37.ddns.net": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "stavver.dyshek.org": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "tardis.bauerj.eu": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4"
    },
    "ty6cgwaf2pbc244gijtmpfvte3wwfp32wgz57eltjkgtsel2q7jufjyd.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "udfpzbte2hommnvag5f3qlouqkhvp3xybhlus2yvfeqdwlhjroe4bbyd.onion": {
        "pruning": "-",
        "s": "60002",
        "t": "60001",
        "version": "1.4.5"
    },
    "v7gtzf7nua6hdmb2wtqaqioqmesdb4xrlly4zwr7bvayxv2bpg665pqd.onion": {
        "pruning": "-",
        "t": "50001",
        "version": "1.4.2"
    },
    "v7o2hkemnt677k3jxcbosmjjxw3p5khjyu7jwv7orfy6rwtkizbshwqd.onion": {
        "pruning": "-",
        "t": "57001",
        "version": "1.4.5"
    },
    "venmrle3xuwkgkd42wg7f735l6cghst3sdfa3w3ryib2rochfhld6lid.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "vmd71287.contaboserver.net": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "vmd84592.contaboserver.net": {
        "pruning": "-",
        "s": "50002",
        "version": "1.4.2"
    },
    "wsw6tua3xl24gsmi264zaep6seppjyrkyucpsmuxnjzyt3f3j6swshad.onion": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    },
    "xtrum.com": {
        "pruning": "-",
        "s": "50002",
        "t": "50001",
        "version": "1.4.2"
    }
}

getunusedaddress()

Command:
getunusedaddress()

Description: Return an unused receiving address.

Example Usage:
>>> getunusedaddress()
"bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd"

getaddressbalance()

Command:
getaddressbalance(address)

Description: Return balance from address.

Example Usage:
>>> getaddressbalance('bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd')

getaddresshistory()

Command:
getaddresshistory(address)

Description: Return history from address.

Example Usage:
>>> getaddresshistory('bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd')

getaddressunspent()

Command:
getaddressunspent(address)

Description: Return unspent from address.

Example Usage:
>>> getaddressunspent('bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd')

payto()

Command:
payto(destination, amount)

Description: Send amount to destination address, using '!' will send entire balance, returns transaction ID for later broadcast.

Example Usage:
>>> payto('bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd', '!')
000000FFEEAABBCCDDEE010203040506070809

broadcast()

Command:
broadcast(tx);

Description: Broadcast a transaction, used after payto().

Example Usage:
>>> broadcast('000000FFEEAABBCCDDEE010203040506070809')
true

listaddresses()

Command:
listaddresses()

Description: Return list of receiving addresses.

Example Usage:
>>> listaddresses()
[
    "bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd",
    "bc1qqfmcmdzjet4uh58axvucycqsk34pz7fmsltp5r",
    "bc1qq5g8pwfw9ztjvm55hw8nwk87868u9cv8xuh277",
    "bc1q0f9ddt4c4a3s9rv7ce6k95epc7radhmfgcy6zf",
    "bc1qudld089l0rye6qjl5tcka5k0dcxw03enxmwm8d",
    "bc1qavv5hc0xhefu90nmgp5jrlurv3kke38nuvuxq7",
    "bc1q2h8gcs23qklr7q770ttdletddhlh2tt2yfpl6w",
    "bc1q79555fxdv74fmxl2vgcw3sunnvwk8lcwle5hmy",
    "bc1qlsyyswgc80urm75vc20zhcpqd5tw8kqly8f7hk",
    "bc1qg9t7n4kwx8mp4ewkmrg7f3azk0qcv88fke3r8k",
    "bc1qjvu3rkkdsrpqp4a0za0ystut7lpwhzfcwhg3jg",
    "bc1qcetuqm3h2j8gmygr063utn3pk4hvnuncuvcxfq",
    "bc1qspcxcqly7mv5jzujwx9u48ely2gatupargs0kz",
    "bc1qea2k46znqec63xvhafl3tu9z34ux2wguf3tx05",
    "bc1qzpk3jlr7y66j6zjec96x7dhhj808az23m307wt",
    "bc1q0mq8f7r0wxmqtrntpj52a3lz9nungyjwrrxg23",
    "bc1qgm87pjaq2mcg574t5gq4ryprcudzlxvtkcav75",
    "bc1qj4ttlxn8sqfh9mds5sk4lx75zmzwjtyrrsl2sr",
    "bc1q6svmnmg0qv6mhgkd5qdrc2avdcwezcmpt8shfj",
    "bc1q07fy39esl2v57l52kl54f0pqngzl8m789yn6l4",
    "bc1qdm9r0x02q9j9sqxmlaqhrtqhtv4ywsla4ae0m3",
    "bc1q7aw34hx0f06spcndk05j5dc2mykj7nedplfsqx",
    "bc1q8q08m0gwqcx8hs6vecel2g8ddaenlrd28c0tve",
    "bc1q83unr4atkmjs8c4tuacahhnj2lnqecr7qjaajs",
    "bc1q8shwm2cmvqnlq4mfz6zjks9slj9pzgwlprql5w",
    "bc1q9caqs642wz22m2wlyvpmunqwn3uvdkupvdjrze",
    "bc1qtkevk6lky3a5rql68873qrlfre58ylttzqft80",
    "bc1qyfddunmqlfu8e9ukj40hgjk8frra4k52cdpe70",
    "bc1q5vapwjukxr8apxq9y2rqyz9lqmzxz4vjv5qtau",
    "bc1qarpvw7mgzvcy7l4gsg330esm0pnw4dzaw04zwg"
]

is_synchronized()

Command:
is_synchronized()

Description: Return Electrum daemon syncronization status.

Example Usage:
>>> is_synchronized()
true

close_wallet()

Command:
close_wallet()

Description: Closes Electrum wallet.

Example Usage:
>>> close_wallet()
true

version()

Command:
version()

Description: Return Electrum client version.

Example Usage:
>>> version()
"4.3.4"

freeze()

Command:
freeze(address)

Description: Freeze address so funds cannot be withdrawn.

Example Usage:
>>> freeze('bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd')

unfreeze()

Command:
unfreeze(address)

Description: Unfreeze address so funds can be withdrawn.

Example Usage:
>>> unfreeze('bc1qdnldkz3n4hdzt5ph59cq2se60t5w8gjanss6yd')

help()

Command:
help()

Description: Return list of all console commands.

Example Usage:
>>> help()
[
    "add_peer",
    "add_request",
    "addtransaction",
    "broadcast",
    "bumpfee",
    "changegaplimit",
    "clear_invoices",
    "clear_ln_blacklist",
    "clear_requests",
    "close_channel",
    "close_wallet",
    "commands",
    "convert_currency",
    "convert_xkey",
    "create",
    "createmultisig",
    "createnewaddress",
    "decode_invoice",
    "decrypt",
    "delete_invoice",
    "delete_request",
    "deserialize",
    "dumpgraph",
    "dumpprivkeys",
    "enable_htlc_settle",
    "encrypt",
    "export_channel_backup",
    "freeze",
    "freeze_utxo",
    "get",
    "get_channel_ctx",
    "get_invoice",
    "get_request",
    "get_ssl_domain",
    "get_tx_status",
    "get_watchtower_ctn",
    "getaddressbalance",
    "getaddresshistory",
    "getaddressunspent",
    "getalias",
    "getbalance",
    "getconfig",
    "getfeerate",
    "getinfo",
    "getmasterprivate",
    "getmerkle",
    "getminacceptablegap",
    "getmpk",
    "getprivatekeyforpath",
    "getprivatekeys",
    "getpubkeys",
    "getseed",
    "getservers",
    "gettransaction",
    "getunusedaddress",
    "help",
    "import_channel_backup",
    "importprivkey",
    "inject_fees",
    "is_synchronized",
    "ismine",
    "lightning_history",
    "list_channels",
    "list_invoices",
    "list_peers",
    "list_requests",
    "list_wallets",
    "listaddresses",
    "listcontacts",
    "listunspent",
    "lnpay",
    "load_wallet",
    "make_seed",
    "nodeid",
    "normal_swap",
    "notify",
    "onchain_history",
    "open_channel",
    "password",
    "payto",
    "paytomany",
    "rebalance_channels",
    "removelocaltx",
    "request_force_close",
    "reset_liquidity_hints",
    "restore",
    "reverse_swap",
    "searchcontacts",
    "serialize",
    "setconfig",
    "setlabel",
    "signmessage",
    "signtransaction",
    "signtransaction_with_privkey",
    "stop",
    "sweep",
    "unfreeze",
    "unfreeze_utxo",
    "validateaddress",
    "verifymessage",
    "version",
    "version_info"
]