Difference between revisions of "Electrum"

From Bitcoin Wiki
Jump to: navigation, search
(How to send a transaction with an offline wallet)
(ElectrumX)
 
(68 intermediate revisions by 15 users not shown)
Line 1: Line 1:
[[Image:Electrum_logo.png]]
+
[[Image:Electrum_logo.png|400px]][[Image:Capture-Electrum.png|right|600px|screenshot of Electrum with its Qt gui]]
  
Electrum is a lightweight Bitcoin client, based on a client-server protocol.  
+
[https://electrum.org Electrum] is a lightweight Bitcoin client, based on a client-server protocol.  
It was released on november 5, 2011.
+
It was released on November 5, 2011.
  
[[Image:Capture-Electrum.png|right|600px|screenshot of Electrum with its Qt gui]]
+
== Main features ==
 
+
* Encrypted wallet: the file that contains bitcoin [[private keys]] is protected with a password, and never leaves the user's computer.
'''Main features:'''
+
* Deterministic key generation: If you lose your wallet file, you can recover it from its [[seed phrase|seed]]. You are protected from your own mistakes. (Note that Electrum's seed phrase is not according to the BIP39 standard.)
* Encrypted wallet
+
* Instant on: by default the client does not download the blockchain, it requests that information from a server. No delays, always up-to-date.
* Deterministic key generation. If you lose your wallet, you can recover it from its seed.
+
* Transactions are signed locally: Your private keys are not shared with the server. You do not have to trust the server with your money.
* No blockchain download; the client requests that information from a server
+
* [[Cold storage]]: Keeping private keys offline is supported. Has a watch-only mode for online use.
* Private keys are not shared with the server.
+
* [[Multisignature]]: Dividing the power to spend coins between multiple wallets is supported.
 +
* [[Hardware wallet]] integration: Many leading hardware wallets can interface with Electrum, including [[Coldcard]], [[Trezor]] and [[Ledger]].
 +
* Redundancy: You are not tied to a particular server, and the server does not need to know you. One server going down doesn't cause user downtimes.
 +
* No single point of failure: The server code is open source, anyone can run a server. Private keys can be exported and imported into other wallets.
 
* Firewall friendly: The client does not need to open a port, it simply polls the server for updates.
 
* Firewall friendly: The client does not need to open a port, it simply polls the server for updates.
* No single point of failure: The server code is open source, anyone can run a server.
+
* Free software: MIT License. Anyone can audit the code.
* Python. Very compact code, easy to contribute.
+
* Written in Python. The code is short, and easy to review.
 +
* Add-ons: third-party plugins are supported.
 +
* Support for Bitcoin URIs, signed URIs and Bitcoin aliases
  
 
__TOC__
 
__TOC__
  
===Graphical User Interfaces===
+
==Documentation==
Electrum has two GUIs: one that is based on Gtk, and a newer one based on Qt. The Qt GUI is enabled by default. To use the gtk interface, type:
+
 
<pre>
+
Documentation is hosted on http://docs.electrum.org/
$ ./electrum -g gtk
+
 
</pre>
+
It includes tutorials for the multisignature, cold storage and hardware wallet features.
In addition, Electrum has a rich set of commands for the command line interface.
+
 
 +
==History==
  
===Brain Wallet===
+
Electrum was announced November 5, 2011<ref>[http://bitcointalk.org/index.php?topic=50936.0 Electrum - a new thin client]</ref>.
  
Electrum uses a type 2 deterministic key generation algorithm.
+
== Server software ==
This means that all the keys are derived from a seed.
 
  
Typical seeds have 128 bits of entropy. Electrum provides mnemonic code in order to represent the seed.
+
The server code is open source, anyone can run a server. There are several implementations.
  
Example:
+
Public Electrum servers run by strangers can easily spy on Electrum users. For this reason many people run their own server. For maximum [[Full node#Why should you use a full node wallet|trustlessness, privacy and security]]; users should point Electrum to their own servers.
*hexadecimal: 431a62f1c86555d3c45e5c4d9e10c8c7
 
*mnemonic: "constant forest adore false green weave stop guy fur freeze giggle clock"
 
  
You can display the seed with the command line interface. Example:
+
=== bwt ===
<pre>
 
$ ./electrum seed
 
Password:
 
431a62f1c86555d3c45e5c4d9e10c8c7 "constant forest adore false green weave stop guy fur freeze giggle clock"
 
</pre>
 
  
===Multiple wallets===
+
'''bwt''' is a lightweight and performant HD wallet indexer backed by a bitcoin full node that [https://github.com/shesek/bwt#electrum-plugin can also be installed as an Electrum plugin].
Electrum uses one single file per wallet. Your default wallet is located in your user account.
 
If you want to use another wallet, use the -w option followed by the wallet path and name:
 
<pre>
 
$ ./electrum -w /path/to/my/wallet/wallet_name
 
</pre>
 
  
===Export and import addresses===
+
=== ElectrumX ===
  
You can export your private keys using the 'addresses' command:
+
ElectrumX is the latest iteration of general purpose Electrum servers. Written in python, it tries to be as efficient as possible to keep synchronization times low. ElectrumX is able to serve thousands of clients at once, it is suited to be an always-on server that contributes to bitcoin. Make sure that the version of ElectrumX you download supports Bitcoin. As of May 2020 some versions of ElectrumX only support [[altcoin]]s.
<pre>
 
$ ./electrum addresses -ak
 
Password:
 
1LGoehbyeX4QBEPK1a6dhyaoMQZfqg5LKX:5JBSttEGhjEcPidSovW66Rin2EZ6LEHZ2qx8Pu2RqqNaDTBVWaF 
 
1KcsBJa2cCxVkGJfSsg5bUeXN7Y5uLa8mP:5KiP4uiNT6KG8jnXbainCM8rDWRrgxt3PAyut4FFpDoCo1Rh6VM 
 
1PXsn7LVXTccGhJPTUL8r2EGB4fF9kvex3:5Kj8mvBJReyk8xEBMx5cTnciQCxto5JmudiTPkqwMcd61Kf1Jqc 
 
1KteSFTAphyByLTtUfFiVQ9s7fMVmx7c2h:5JeZ3FTbWcksLt3PKydd5U9p952UQRHwv3LoxzCA9LZ7V2bku5p 
 
1GE5ZChAobeTEPLHDCDDKTSg3XvLkcQFjS:5JwtGEygTwF2nouhRVzW3w5DWZd1sCgxLtnd1v51wjkbUrp5sqH 
 
12YNehfAoYTiwjTXULwaZqTCauu2D61fq6:5Jvcq19ePCXKcVun4n7US99CsrEByUK2kgxXBA3rBVBqYZjhfwD  [change]
 
</pre>
 
There are two options in this example:
 
* option -a means: 'list all addresses'. if you don't use it, change addresses are not listed.
 
* option -k means: display the private keys
 
  
You can also import addresses into an electrum wallet, with the 'import' command:
+
GitHub: https://github.com/spesmilo/electrumx
<pre>
 
$ ./electrum import 1LGoehbyeX4QBEPK1a6dhyaoMQZfqg5LKX:5JBSttEGhjEcPidSovW66Rin2EZ6LEHZ2qx8Pu2RqqNaDTBVWaF
 
keypair imported
 
</pre>
 
Note that imported keys do not belong to the deterministic sequence of your wallet; if you import keys in a wallet, you must back it up!
 
  
===Offline wallet===
+
<!-- seems less relevant now... not sure
 +
Interview with author: https://btcmanager.com/nobody-has-setup-an-electrum-server-for-over-a-year/ archive: https://archive.is/lUnfa -->
  
It is possible to create a transaction on an offline computer,
+
=== Electrum Personal Server ===
and to broadcast them from another computer, with a wallet that does not have the seed or private keys.
 
  
====How to prepare an offline wallet ====
+
Electrum Personal Server has a different approach to a normal server. It is intended to be used by a single person only. Instead of creating a database of every transaction and address ever used on the bitcoin blockchain, Electrum Personal Server only tracks the user's own wallets. This allows it to be much more efficient with resources, it does not need any extra data files and is compatible with [[Bitcoin Core]]'s pruning feature.
*step 1: create a wallet on your offline computer
 
<pre>
 
$ ./electrum -w wallet create
 
</pre>
 
*step 2: save the seed of your wallet to a file that will remain on the offline computer:
 
<pre>
 
./electrum -w wallet seed | awk '{print $1}'> seedfile
 
</pre>
 
*step 3: blank the seed in your wallet file.
 
For example, under linux, you may type:
 
<pre>
 
$ cat w | sed "s/`cat seedfile`/trololololo/g" > wallet.no_seed
 
</pre>
 
or you can open the file in an editor and do it manually. After this step you may remove the wallet file:
 
<pre>
 
rm wallet
 
</pre>
 
*step 4: transfer the wallet.no_seed file to the online computer.
 
For example, copy the wallet file to a usb stick:
 
<pre>
 
$ cp wallet.no_seed /my/usb/wallet.no_seed
 
</pre>
 
and once you have plugged the usb key to the online computer:
 
<pre>
 
$ cp /my/usb/wallet.no_seed ./wallet.no_seed
 
</pre>
 
*step 5: run electrum on the online computer; this will synchronize your wallet with the bitcoin network, and you will be able to monitor incoming transactions:
 
<pre>
 
./electrum -w wallet.no_seed
 
</pre>
 
  
====How to send a transaction with an offline wallet====
+
Electrum Personal Server is probably the best way to combine Electrum's feature-richness (hardware wallet integration, multisignature, [[seed phrase]], etc) with a [[full node]]'s strong security and privacy.
*step 1: copy the synchronized wallet file to your offline computer
 
<pre>
 
$ cp wallet.no_seed /usb/stick/wallet.no_seed
 
</pre>
 
*step 2: edit the wallet file and restore the seed :
 
<pre>
 
$ cat w | sed "s/trololololo/`cat seedfile`/g" > wallet.seed
 
</pre>
 
you may also do this manually with a file editor if you do not know how to use sed.
 
  
*step 3: create the transaction
+
GitHub: https://github.com/chris-belcher/electrum-personal-server
<pre>
 
./electrum -w wallet.seed mktx <recipient> <amount>  >  tx_file
 
</pre>
 
*step 4: with the usb stick, copy the transaction to the online computer:
 
<pre>
 
$cp tx_file /usb/tx_file
 
</pre>
 
and, on the online computer:
 
<pre>
 
$cp /usb/tx_file tx_file
 
</pre>
 
*step 5: broadcast the transaction:
 
<pre>
 
./electrum sendtx  `cat tx_file`
 
</pre>
 
  
=== List of commands ===
+
==See Also==
  
{| class="wikitable sortable"
+
* [[Thin Client Security]]
|-
+
* [[Hardware wallet]]
! command !! description !! syntax !! requires password !! needs to be online
+
* [[Seed phrase]]
|-
+
* [[Multisignature]]
| help || display the help for a command || help [command] || no || no
+
* [[Cold storage]]
|-
 
| validateaddress || check is the argument is a valid bitcoin address || validateaddress <address> || no || no
 
|-
 
| balance || shows the balance of your wallet or of an address || balance [address] || no || yes
 
|-
 
| contacts || print your list of contacts || contacts || no || no
 
|-
 
| create || create a new wallet || create || no || no
 
|-
 
| restore || restore a wallet from seed || restore || no || yes
 
|-
 
| payto || create and broadcast a transaction || payto [-s sourceaddr] [-c changeaddr] [-f fee] <address> <amount> || yes || yes
 
|-
 
| mktx || create a transaction and dump it || mktx [-s sourceaddr] [-c changeaddr] [-f fee] <address> <amount>  || yes || no
 
|-
 
| sendtx || broadcast a transaction || sendtx <tx> || no || yes
 
|-
 
| password || update your password || password || yes || no
 
|-
 
| addresses || show your list of addresses, optionally with private keys. || addresses [-a] [-b] [-k] || iff -k || no
 
|-
 
| history || print the transaction history || history || no || yes
 
|-
 
| label || change the label of a transaction or address || label <label> || no || no
 
|-
 
| seed || print your seed || seed || yes || no
 
|-
 
| import || import a keypair || import <address:private_key> || yes || no
 
|-
 
| signmessage || sign a message (as in bitcoind) || signmessage <address> <message> || yes || no
 
|-
 
| verifymessage || verify a message (as in bitcoind) || verifymessage <address> <signature> <message> || no || no
 
|-
 
| eval || call python eval || eval <expression> || no || no
 
|}
 
  
=== Security ===
+
==External Links==
  
See [[Thin Client Security]]
+
* [http://electrum.org/ Electrum] project website
 +
* [https://github.com/spesmilo/electrum/ Electrum] project source
  
===links===
+
==References==
*homepage: http://ecdsa.org/electrum
+
<references />
*source code: https://gitorious.org/electrum
 
*download: <tt>git clone git://gitorious.org/electrum/electrum.git</tt>
 
  
[[category:Clients]]
+
[[Category:Clients]]
 +
[[Category:Open Source]]

Latest revision as of 13:15, 6 June 2020

Electrum logo.png
screenshot of Electrum with its Qt gui

Electrum is a lightweight Bitcoin client, based on a client-server protocol. It was released on November 5, 2011.

Main features

  • Encrypted wallet: the file that contains bitcoin private keys is protected with a password, and never leaves the user's computer.
  • Deterministic key generation: If you lose your wallet file, you can recover it from its seed. You are protected from your own mistakes. (Note that Electrum's seed phrase is not according to the BIP39 standard.)
  • Instant on: by default the client does not download the blockchain, it requests that information from a server. No delays, always up-to-date.
  • Transactions are signed locally: Your private keys are not shared with the server. You do not have to trust the server with your money.
  • Cold storage: Keeping private keys offline is supported. Has a watch-only mode for online use.
  • Multisignature: Dividing the power to spend coins between multiple wallets is supported.
  • Hardware wallet integration: Many leading hardware wallets can interface with Electrum, including Coldcard, Trezor and Ledger.
  • Redundancy: You are not tied to a particular server, and the server does not need to know you. One server going down doesn't cause user downtimes.
  • No single point of failure: The server code is open source, anyone can run a server. Private keys can be exported and imported into other wallets.
  • Firewall friendly: The client does not need to open a port, it simply polls the server for updates.
  • Free software: MIT License. Anyone can audit the code.
  • Written in Python. The code is short, and easy to review.
  • Add-ons: third-party plugins are supported.
  • Support for Bitcoin URIs, signed URIs and Bitcoin aliases

Documentation

Documentation is hosted on http://docs.electrum.org/

It includes tutorials for the multisignature, cold storage and hardware wallet features.

History

Electrum was announced November 5, 2011[1].

Server software

The server code is open source, anyone can run a server. There are several implementations.

Public Electrum servers run by strangers can easily spy on Electrum users. For this reason many people run their own server. For maximum trustlessness, privacy and security; users should point Electrum to their own servers.

bwt

bwt is a lightweight and performant HD wallet indexer backed by a bitcoin full node that can also be installed as an Electrum plugin.

ElectrumX

ElectrumX is the latest iteration of general purpose Electrum servers. Written in python, it tries to be as efficient as possible to keep synchronization times low. ElectrumX is able to serve thousands of clients at once, it is suited to be an always-on server that contributes to bitcoin. Make sure that the version of ElectrumX you download supports Bitcoin. As of May 2020 some versions of ElectrumX only support altcoins.

GitHub: https://github.com/spesmilo/electrumx


Electrum Personal Server

Electrum Personal Server has a different approach to a normal server. It is intended to be used by a single person only. Instead of creating a database of every transaction and address ever used on the bitcoin blockchain, Electrum Personal Server only tracks the user's own wallets. This allows it to be much more efficient with resources, it does not need any extra data files and is compatible with Bitcoin Core's pruning feature.

Electrum Personal Server is probably the best way to combine Electrum's feature-richness (hardware wallet integration, multisignature, seed phrase, etc) with a full node's strong security and privacy.

GitHub: https://github.com/chris-belcher/electrum-personal-server

See Also

External Links

References