How does Electrum work?
Electrum is designed to be a fast and efficient Bitcoin wallet. It uses minimal system resources while making Bitcoin transactions simpler for users. The wallet starts up quickly because it works with powerful servers that manage the complex aspects of the Bitcoin network.
What information does Electrum share with its servers?
Electrum doesn’t fully trust the servers it connects to.
It keeps your private keys and seed phrases safe by never sending them to any server. Electrum also checks all information it gets from servers using a method called Simple Payment Verification (SPV).
Electrum usually connects to about ~10 servers at once. It asks these servers to send updates about new block headers and regularly checks them for dynamic fee suggestions. Most of these servers only provide this basic information. Getting block headers from several places helps Electrum spot servers that are behind, and notice if there are any splits or forks in the Bitcoin blockchain.
Electrum picks one server as its main connection. This server has more responsibilities than the others:
- Electrum tells this server about its Bitcoin addresses, so it can learn about new transactions involving these addresses. It also gets its transaction history from this server. This approach is faster, but it does mean the server can guess that all these addresses belong to one user.
- Electrum checks confirmed transactions using Simple Payment Verification. However, for unconfirmed transactions, it has to trust the server’s information.
- Electrum servers might not always show you all your transactions. This can happen with both confirmed and unconfirmed transactions. A server could leave out some transactions, either by mistake or on purpose.
- Electrum asks all connected servers about transaction fees. If you let Electrum connect to servers automatically, it uses the middle value from all the answers it gets. If not, it only uses the main server’s answer. Electrum always checks these fee suggestions to make sure they’re reasonable.
- When you make a transaction, Electrum uses the main server to send it to the Bitcoin network.
- Electrum also asks the main server for a list of other servers it can connect to. This helps Electrum find new servers, though it also has some server addresses built into its code to start with.
When Electrum connects to servers, they can see your device IP address. This might be your real IP or the address of a VPN or Tor, if you’re using one.
Electrum is designed to start up quickly and use less of your computer’s resources. However, this comes with some privacy trade-offs, as explained earlier. The good news is that Electrum is built to minimize how much you need to trust these servers.
Anyone can set up their own Electrum server. If you’re very concerned about privacy, or if you want stronger security than Simple Payment Verification offers, you might want to run your own server. This gives you more control over your wallet’s connection to the Bitcoin network.
What is the seed phrase?
The seed is a randomly generated phrase that serves as the basis for creating your private keys. It’s a crucial element of your wallet’s security and recovery system.
Example:
long guitar dance satoshi segment time okay dismiss hockey muffin canal sure
If you ever need to restore your wallet, you can do so using only this seed phrase. During the wallet setup process, you’ll find an option labeled “I already have a seed“. Selecting this allows you to input your existing seed and re-create your wallet.
This seed phrase, provided as an example, is strongly discouraged to use for a real wallet. Since this seed phrase is already known and publicly available, anyone can get full access to the wallet created with it and dispose of the funds there. Using such a seed phrase for a real wallet will inevitably lead to the loss of your assets.
How secure is the seed?
The seed phrase generated by Electrum possesses 132 bits of entropy, providing a security level equivalent to that of a Bitcoin private key (256 bits in length). This equivalence is derived from the properties of elliptic curve cryptography:
For a key of length n bits: Security strength = n/2 bits
Therefore:
- Electrum seed: 132 bits entropy → 132/2 = 66 bits security
- Bitcoin private key: 256 bits → 256/2 = 128 bits security
Electrum’s seed, despite having 132 bits of entropy, effectively provides 128 bits of security, matching the strength of Bitcoin’s 256-bit private keys. This is because 2^128 is the closest power of 2 to 2^132, and cryptographic security is typically expressed in powers of 2.
How do I access my wallet if I forgot my password?
It is not possible to recover your password. However, you can restore your wallet from its seed phrase and choose a new password. If you lose both your password and your seed, there is no way to recover your money. This is why we ask you to save your seed phrase on paper.
To restore your wallet from its seed phrase, create a new wallet, select the type, choose “I already have a seed” and proceed to input your seed phrase.
How to create a wallet?
The first thing you must do to start receiving and sending Bitcoins is to create a wallet.
In this example we will look at creating a standard wallet, but you can create a Two-Factor Authentication or Multi-signature wallet.
- Name your wallet. It may be any name.
- Select the type of wallet, we will select Standard Wallet.
- At this point you must choose whether you are creating a new wallet or plan to use an old one (import seed phrase)
- Save the seeds in a safe place, preferably on paper or with metal backup.
This seed phrase, provided as an example, is strongly discouraged to use for a real wallet. Since this seed phrase is already known and publicly available, anyone can get full access to the wallet created with it and dispose of the funds there. Using such a seed phrase for a real wallet will inevitably lead to the loss of your assets.
- Enter your seed phrase for confirmation
- Choose a strong password for your wallet.
Great job! You’ve created a standard Electrum wallet. Be sure to keep your seed phrase and password in a safe place so you don’t lose your funds.
How to change wallet password?
- Click on the lock icon at the bottom of the Electrum.
- Enter your current password and select a new password, click OK.
The password has been successfully changed. Remember to write it down and keep it in a safe place.
Where does Electrum get Bitcoin prices from?
Electrum gets the Bitcoin price from a third party, but provides various options. Please see Menu → Tools → Preferences → Fiat to view the current setting or choose a new one.
What to do if a transaction is not confirmed for a long time?
Bitcoin transactions are confirmed when miners include them in the blockchain. Confirmation speed usually depends on the transaction fee. Higher fees typically result in faster confirmation as miners prioritize these transactions.
Newer Electrum versions use “dynamic fees” to ensure appropriate fee amounts. This feature is on by default in recent Electrum releases.
If you have an unconfirmed transaction, you have several options:
- Wait it out.
You can wait for the transaction to be either confirmed or cancelled. At worst, this process can take several days.
- Increase the fee.
This option is available for Replace-By-Fee (RBF) unconfirmed transactions. Electrum creates replaceable transactions by default, except for Lightning Network channel operations. To increase the fee:
- Find the transaction in the “History” tab.
- Right-click and select “Increase Fee“.
- Set a new, higher fee.
- Click “OK“.
- A window will popup with the unsigned transaction. Click on “Sign” and then “Broadcast”.
- Use “Child Pays for Parent” (CPFP).
A CPFP transaction pays a high fee to offset the low fee of its parent transaction. Either the sender or recipient can create a CPFP transaction. To do this:
- Locate the unconfirmed transaction in the “History” tab.
- Right-click and choose “Child pays for parent“.
- Set an appropriate fee.
- Click “OK“.
- A window will popup with the unsigned transaction. Click on “Sign” and then “Broadcast”.
- Cancel the transaction.
This is possible only for “replaceable” unconfirmed transactions. To cancel:
- Find the transaction in the “History” tab.
- Right-click and select “Cancel (double-spend)“.
- Set an appropriate fee.
- Click “OK“.
- A window will popup with the unsigned transaction. Click on “Sign” and then “Broadcast”.
Note: Replaceable transactions are marked as “Replace by fee: True” in the transaction details screen. Electrum creates replaceable transactions by default, except for Lightning Network channel open/close transactions.
What does it mean to “freeze” an address in Electrum?
In Electrum, “freezing” an address is a way to protect specific funds in your wallet. When you freeze an address:
- The bitcoins stored in that address become unavailable for spending.
- Electrum will not use these funds when you try to send Bitcoin’s.
This feature is useful when you want to set aside some funds or prevent accidental spending.
Important points to remember:
- You can still receive bitcoins to a frozen address.
- You need enough funds in unfrozen addresses to send coins.
- If most of your funds are in frozen addresses, you might not be able to send transactions even if your total balance is sufficient.
To use frozen funds, you need to “unfreeze” the address first. This returns the funds to your available balance for spending.
Is my wallet file encrypted?
Electrum uses a two-tier encryption system to protect your data:
- Electrum encrypts your seed and private keys with AES-256-CBC. When you need to sign a transaction, you must enter your password to briefly decrypt the private keys. This approach minimizes the time sensitive information remains unencrypted in your computer’s memory.
- Your wallet file can also be encrypted on your disk. However, during an active session, the wallet information stays unencrypted in your computer’s memory. Opening an encrypted wallet requires a password. Electrum doesn’t store this password in memory. Instead, it uses asymmetric encryption (ECIES) to save the wallet on disk without needing the password.
Since version 2.8
, wallet file encryption is on by default. This feature not only protects your privacy but also prevents you from accidentally requesting Bitcoins to a wallet you don’t control.
Can I use Electrum with a cold wallet?
Electrum does support cold wallets, which are a secure way to store your Bitcoin offline. See Cold Storage.
Can I import private keys into Electrum from other Bitcoin clients?
In Electrum 2.0, you cannot import private keys in a wallet that has a seed. You should sweep them instead.
If you want to import private keys and not sweep them, you need to create a special wallet that does not have a seed. For this, create a new wallet, select “restore”, and instead of typing your seed, type a list of private keys, or a list of addresses if you want to create a watching-only wallet.
You will need to back up this wallet, because it cannot be recovered from a seed.
How do I sweep private keys in Electrum?
Sweeping private keys means to send all the bitcoins they control to an existing address in your wallet. The private keys you sweep do not become a part of your wallet. Instead, all the bitcoins they control are sent to an address that has been deterministically generated from your wallet seed.
To sweep private keys, go to the Wallet Menu → Private Keys → Sweep. Enter the private keys in the appropriate field. Leave the “Address” field unchanged. That is the destination address, and it will be from your existing electrum wallet. Click on “Sweep”. It’ll now take you to the send tab where you can set an appropriate fee and then click on “Send” to send the coins to your wallet.
Where is the Electrum data directory?
The data directory of Electrum is where wallet files, config settings, logs, blockchain headers, etc are stored.
Windows:
- Enable “Show hidden files” in File Explorer options.
- Go to X:\Users\username\AppData\Roaming\Electrum (You can also type
%APPDATA%\Electrum
in the File Explorer address bar).
macOS:
- Open Finder
- Go to folder (Shift+CMD+G) and type
~/.electrum
Linux:
- Open your Home Folder
- Click “Go” in the menu, then “Location“
- Enter:
~/.electrum
Where can I find my Electrum wallet file?
The default wallet file in Electrum is named default_wallet
. This file is created automatically when you first run the application. It’s stored in a folder called wallets
, which is located inside the main Electrum data directory (datadir).
How do I enable debug logging in Electrum?
- Logging to file
On Linux/Windows/macOS, you can enable logging to disk.
Using the GUI, go to Menu → Tools → Preferences → Misc, and tick “Write logs to file”. After restarting Electrum, debug logs will be written to the logs/
folder inside the datadir.
If you encounter an error while opening a wallet and hence cannot get to “Preferences” to enable logging, as a workaround you can create a temporary throwaway wallet and access the settings there.
Using CLI/RPC, you can enable file logging via e.g.:
electrum setconfig log_to_file true
- Logging to terminal (standard error)
On Linux/macOS, if you start Electrum from terminal, you can specify the -v
flag, to enable debug logs in the terminal (to stderr). This option does not work on Windows (when using the binaries).
On macOS, when using the official binary, try e.g.:
/Applications/Electrum.app/Contents/MacOS/run_electrum -v
How do I make a bulk payment in Electrum?
Electrum supports bulk payments, also known as transaction batching. This feature allows you to send Bitcoin to multiple recipients in a single transaction.
In the GUI, you can create a batched transaction by entering multiple recipients. For each recipient, type the address and amount on a separate line, using a comma to separate them.
address, amount
address2, amount
address3, amount
The amounts should be entered in the current unit set in your Electrum client. As you add recipients, the interface will display the total amount for the transaction.
For larger batches, Electrum offers a convenient import option. You can prepare a CSV file with the recipient addresses and amounts, then import it directly into the “Pay to” field by clicking the folder icon.
Does Electrum allow me to create and sign raw transactions?
Yes, Electrum supports creating and signing raw Bitcoin transactions directly within its user interface.
Why does Electrum freeze when I try to send Bitcoins?
If Electrum freezes when you attempt to send bitcoins, it may be due to a large number of unspent transaction outputs (UTXOs) in your wallet. This situation often occurs when you’ve received many small payments, such as from Bitcoin faucets or numerous small donations.
When creating a new transaction, Electrum searches through all your wallet’s UTXOs to find suitable inputs. If you have hundreds or thousands of small UTXOs, this process can be time-consuming and may cause the application to appear frozen.
To resolve this issue, you can consolidate your UTXOs. This process involves sending smaller amounts of bitcoin to one of your own wallet addresses. Think of it as exchanging many small coins for larger denominations.
Here’s how to consolidate your UTXOs:
- Choose a quiet time when transaction fees are low.
- Send a portion of your balance to another address in your wallet.
- Repeat this process a few times if necessary.
By consolidating your UTXOs, you’ll reduce the number of inputs Electrum needs to process for future transactions, which should prevent freezing and improve overall wallet performance.
What is the gap limit?
The gap limit is a crucial concept in Electrum. It defines the maximum number of consecutive unused addresses allowed in your wallet’s deterministic address sequence. Electrum uses this limit to determine when to stop searching for new addresses in your wallet.
By default, Electrum 2.0 and later versions set the gap limit to 20. This means the wallet will continue to generate and check addresses until it encounters a series of 20 unused addresses in a row. Once this limit is reached, Electrum assumes it has found all the active addresses in your wallet.
How do I pre-generate new addresses in Electrum?
Electrum automatically creates new addresses as you use them, up to a certain limit called the “gap limit.” However, you might need to create more addresses ahead of time. Here’s how to do it:
Creating a Single New Address:
- Open the Electrum Console.
- Type this command:
wallet.create_new_address(False)
- Press Enter.
This will generate one new address. In the address tab, this new address will have a red background. The red color shows that the address is beyond the normal gap limit. It will stay red until you use enough addresses to reach it.
To create several addresses at once, you can use a loop. For example, to make 50 new addresses:
- Open the Electrum Console.
- Type this command:
[wallet.create_new_address(False) for i in range(50)]
- Press Enter.
Important Notes:
- Addresses created beyond the gap limit won’t be automatically recovered from your seed phrase.
- To recover these addresses later, you’ll need to either:
- Increase your client’s gap limit.
- Generate new addresses until you reach the ones you used.
Remember, only create extra addresses if you really need them. Letting Electrum manage address creation automatically is usually the best approach for most users.
How to Upgrade Electrum?
Always write down your wallet seed on paper or backup private keys before you upgrade Electrum. This is a crucial safety step.
To upgrade, simply install the latest version of Electrum on Download page. The exact steps will vary depending on what type of computer you’re using.
Electrum keeps your wallet files separate from the program itself. This means you can safely remove the old version of Electrum if your computer doesn’t do this automatically.
New versions of Electrum sometimes change how wallet files are stored. Because of this, it’s best not to switch back to an older version of Electrum after you’ve opened your wallet with a newer version. The older version might not be able to read your updated wallet file correctly.
The following issues should be considered when upgrading Electrum 1.x wallets to Electrum 2.x:
- When you upgrade to Electrum 2.x, it will need to recreate all your Bitcoin addresses. This might take longer than usual, so please be patient during the upgrade.
- The upgrade will replace your old wallet file with a new Electrum 2.x version. After this, Electrum 1.x won’t be able to use your wallet anymore.
- The first time you open Electrum 2.x after upgrading, you might not see any addresses in the “Addresses” tab. This is normal. Just restart Electrum 2.x, and your addresses should appear.
- If you’re using Electrum offline, it can’t sync with the network to show your addresses. To see some of your addresses, you can use this command in the Console:
wallet.synchronize()
. After running this, restart Electrum to see your addresses.
Why does my antivirus program detect Electrum as malware?
Electrum binaries are often misidentified as malware by anti-virus programs. This is due to the heuristic methods these programs use to detect potential threats, which can lead to false positives. The Electrum development team cannot prevent these false-positive detections, so please stop reporting this.
If you trust the Electrum project developers, you can safely ignore anti-virus warnings after verifying the GPG signature of the Electrum binary. This verification process ensures the software you’ve downloaded is authentic and hasn’t been tampered with.
For users who prefer additional security measures, there are two alternatives:
- Build the Electrum binaries from source code yourself. This gives you complete control over the compilation process.
- Run Electrum directly from its source code, bypassing the need for pre-compiled binaries.
It’s worth noting that relying solely on anti-virus software for system security has limitations. For maximum security, consider using an operating system with more robust built-in security features that doesn’t depend heavily on anti-virus software.
Electrum needs a newer version of Python on my old Linux system. How to fix it?
There are several ways to resolve this.
- Use the Electrum AppImage.
- Download the AppImage.
- Optional: Verify the GPG signature.
- Make it executable and run it.
Note: This AppImage is only for x86_64 (amd64) systems
wget https://download.electrum.is/3.3.4/electrum-3.3.4-x86_64.AppImage $ chmod +x electrum-3.3.4-x86_64.AppImage $ ./electrum-3.3.4-x86_64.AppImage
- Use Backports: For Debian users, check packages in stable-backports.
- Upgrade Your Linux Distribution: For example, switch from Debian stable to Debian testing.
- Compile Python and Install PyQt5.
python3 -m pip install --user pyqt5
Note: This pip method for PyQt5 mainly works on x86/x86_64 systems
- Run a different Linux distribution with newer packages in a virtual machine.
Is the connection between Electrum clients and servers authenticated?
Electrum uses a client-server system to communicate. The Electrum protocol, based on JSON-RPC, allows clients and servers to exchange information. There are two main ways the client can connect:
- JSON-RPC over SSL/TLS over TCP.
- JSON-RPC over TCP.
However, the client always uses SSL for security, so plain TCP isn’t used. This means all connections are encrypted.
When it comes to verifying server identity, Electrum accepts two types of SSL certificates:
- Certificates signed by trusted Certificate Authorities (CA).
- Self-signed certificates.
The first time Electrum connects to a server, it remembers what type of certificate the server uses. This process is called “pinning”.
- For servers with self-signed certificates, Electrum uses a “Trust On First Use” (TOFU) approach. It will only accept that specific certificate for that server until the certificate expires.
- For servers with CA-signed certificates, Electrum will always expect CA-signed certificates from that server in the future.
If you’re setting up your own Electrum server, you can choose between self-signed and CA-signed certificates. Each has its pros and cons:
- Self-signed certificates are easier to create but could be vulnerable to a Man-in-the-Middle (MITM) attack during the first connection.
- CA-signed certificates provide more security but require you to trust Certificate Authorities.
Remember, Electrum no longer allows connecting without SSL encryption. This change was made to improve security for all users.
Does Electrum support altcoins?
Electrum is designed specifically for Bitcoin. It doesn’t support any other cryptocurrencies, often called “altcoins”.
Electrum is open-source software with a permissive MIT license. This means other developers can modify it. As a result, there are many versions of Electrum created by others to work with different cryptocurrencies.
- These altered versions are separate projects, not connected to the original Electrum.
- The Electrum team doesn’t check or approve the code of these other versions.
- We don’t officially support or recommend these altered versions.
If you’re using a version of Electrum modified for other cryptocurrencies, please contact the developers of that specific version for any help or questions. The original Electrum team can’t assist with these modified versions.