Back to main index

Bitcoin-core

Install

Download link: https://bitcoin.org/en/download

# as root
su
cd /opt
wget https://bitcoin.org/bin/bitcoin-core-31.0/bitcoin-31.0-x86_64-linux-gnu.tar.gz
wget https://bitcoin.org/bin/bitcoin-core-31.0/SHA256SUMS
if ! grep bitcoin-31.0-x86_64-linux-gnu.tar.gz SHA256SUMS | sha256sum --check; then
    echo "ERROR: Checksum validation failed. File may be corrupted or malicious."
    exit 1
fi
echo "Success: File is verified."
tar -zxvf bitcoin-31.0-x86_64-linux-gnu.tar.gz
cd bitcoin-31.0/share
wget ftp://vasilian.net/Devel/btc_250x250.png
cd /opt
chown -Rv root:root bitcoin-31.0
chcon -u system_u -Rv bitcoin-31.0
rm -v bitcoin-31.0-x86_64-linux-gnu.tar.gz
Create a shortcut
cat > /usr/share/applications/bitcoin.desktop << EOF
[Desktop Entry]
Name=Bitcoin 31.0
GenericName=Bitcoin 31.0
Comment=Bitcoin 31.0
Exec=/opt/bitcoin-31.0/bin/bitcoin-qt
Terminal=false
Icon=/opt/bitcoin-31.0/share/btc_250x250.png
Type=Application
Categories=Network;
Version=1.0
X-Desktop-File-Install-Version=0.23
EOF

chcon -u system_u -v /usr/share/applications/bitcoin.desktop

Allow inbound connections on 8333/TCP

firewall-cmd --zone=public --add-port=8333/tcp
firewall-cmd --runtime-to-permanent
firewall-cmd --list-all

Forward the port internally btc_port_8333_tcp

Synchronize

Start the app
btc_start_application

Use existing block chain directory
btc_welcome_to_bitcoin_core

Synchronize with the network
btc_synchronizing_with_network

The Wallet

Create a wallet with password btc_create_wallet_0

Type in the password btc_create_wallet_1

Confirm wallet encryption btc_create_wallet_2

The wallet will be encrypted. The password will be necessary when sending coins. btc_create_wallet_3

You can move BTC_1 folder offline for protection. btc_create_wallet_4

The Master Seed

The wallet structure

      [ The Master Seed / Descriptor ]  <-- Represents your ENTIRE wallet
                     |
        +------------+------------+
        |                         |
[ Private Key A ]         [ Private Key B ]  ... Thousands more keys
        |                         |
[ Address A ]             [ Address B ]      ... Each key makes 1 address

Unlock the wallet and dump the Master Seed (xprv)
xprv9s21.... is truncated below for visibility.

walletpassphrase "your_wallet_password" 60
listdescriptors true


08:08:21
{
  "wallet_name": "BTC_1",
  "descriptors": [
    {
      "desc": "pkh(xprv9s21..../44h/0h/0h/0/*)#et6kdcch",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "pkh(xprv9s21..../44h/0h/0h/1/*)#gllhsdg0",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    },
    {
      "desc": "sh(wpkh(xprv9s21..../49h/0h/0h/0/*))#78fpena0",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "sh(wpkh(xprv9s21..../49h/0h/0h/1/*))#cypyz7km",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    },
    {
      "desc": "tr(xprv9s21..../86h/0h/0h/0/*)#85z3vafq",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "tr(xprv9s21..../86h/0h/0h/1/*)#kq8s3gec",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    },
    {
      "desc": "wpkh(xprv9s21..../84h/0h/0h/0/*)#nk7q8z0e",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "wpkh(xprv9s21..../84h/0h/0h/1/*)#zzmp6hlp",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    }
  ]
}

Let's look at the dump data

The master seed is exactly 111 characters
xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d

It shows up 8 times because the wallet handles 4 generations of Bitcoin.
For each generation it dumps 2 keys.

pkh(...)      Legacy: addresses starts with 1 (BIP44 standard)
sh(wpkh(...)) Nested SegWit: starting with 3 (BIP49 standard)
wpkh(...)     Native SegWit: default, starting with bc1q (BIP84 standard) 
tr(...)       Taproot: newest format starting with bc1p (BIP86 standard)

xprv9s21..../0/* This means External. These generate the public addresses you see when clicking "Receive".
xprv9s21..../1/* This means Internal. These create silent addresses used behind the scenes to receive back change when you spend a partial amount of coins.


If someone gains access to your Master Seed, they can STEAL YOUR COINS almost instantly from any computer in the world without needing your wallet file, linux login, or encryption password.


The Recovery

Create a blank wallet btc_make_blank_wallet

To recreate the wallet structure from Master Seed use the json template below.

[
    {
      "desc": "pkh(XPRV/44h/0h/0h/0/*)#et6kdcch",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "pkh(XPRV/44h/0h/0h/1/*)#gllhsdg0",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    },
    {
      "desc": "sh(wpkh(XPRV/49h/0h/0h/0/*))#78fpena0",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "sh(wpkh(XPRV/49h/0h/0h/1/*))#cypyz7km",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    },
    {
      "desc": "tr(XPRV/86h/0h/0h/0/*)#85z3vafq",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "tr(XPRV/86h/0h/0h/1/*)#kq8s3gec",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    },
    {
      "desc": "wpkh(XPRV/84h/0h/0h/0/*)#nk7q8z0e",
      "timestamp": 1786027997,
      "active": true,
      "internal": false,
    },
    {
      "desc": "wpkh(XPRV/84h/0h/0h/1/*)#zzmp6hlp",
      "timestamp": 1786027997,
      "active": true,
      "internal": true,
    }
  ]
Replace XPRV with the master seed.
Pick a date, convert it to unix timestamp and replace it in the json.
The Unix timestamp 1786027997 represents 
Thursday, August 6, 2026, at 14:53:17 UTC (2:53 PM).
Import the modified json
importdescriptors '[{"desc": "pkh(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/44h/0h/0h/0/*)#et6kdcch", "timestamp": 1786027997, "active": true, "internal": false}, {"desc": "pkh(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/44h/0h/0h/1/*)#gllhsdg0", "timestamp": 1786027997, "active": true, "internal": true}, {"desc": "sh(wpkh(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/49h/0h/0h/0/*))#78fpena0", "timestamp": 1786027997, "active": true, "internal": false}, {"desc": "sh(wpkh(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/49h/0h/0h/1/*))#cypyz7km", "timestamp": 1786027997, "active": true, "internal": true}, {"desc": "tr(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/86h/0h/0h/0/*)#85z3vafq", "timestamp": 1786027997, "active": true, "internal": false}, {"desc": "tr(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/86h/0h/0h/1/*)#kq8s3gec", "timestamp": 1786027997, "active": true, "internal": true}, {"desc": "wpkh(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/84h/0h/0h/0/*)#nk7q8z0e", "timestamp": 1786027997, "active": true, "internal": false, "range": [0, 1050]}, {"desc": "wpkh(xprv9s21ZrQH143K3yDKGMX1Fq86Z38mVLCMhb2BxvVuvqgtRyzMC9DkUCp5bU9fYL7KxfPwyyYTDNdokvgsyrsosnjq5DM8BUUJ8xcsA1EyX6d/84h/0h/0h/1/*)#zzmp6hlp", "timestamp": 1786027997, "active": true, "internal": true}]'
btc_importdescriptors

Bitcoin Core will scan the blocks from the specific timestamp forward.
It will calculate the actual balance.
Your transaction list will populate automatically as it scans.

The Entrophy

The master seed of a wallet is generated in 2 steps:
Cryptographic Entropy (Randomness)
The programs requests 32 bytes (256 bits) of pure random data from the linux kernel using the getrandom() system call. Then it mixes this with its own internal software-based random number generator (RNG) engine.
HMAC-SHA512 Derivation
This 256-bit random number is passed through a mathematical hashing function called HMAC-SHA512 along with a standard structural formula (BIP32 standard). The result is the 512-bit binary root data that gets encoded into the 111-character xprv (Extended Private Key).


Address and Key Derivation (Asymmetric Math)
ECDSA (secp256k1)
Bitcoin uses the Elliptic Curve Digital Signature Algorithm on a specific mathematical curve called secp256k1. Your master seed uses this math to generate all individual private keys, which then generate your public keys.
Hashing (SHA256 and RIPEMD160)
To turn a public key into a readable address (like a bc1q Bech32 string), the public key is hashed using SHA256 and then RIPEMD160. This mathematical process is strictly one-way.


Wallet File Protection (Symmetric Encryption)
AES-256-CBC
This is a military-grade symmetric encryption standard. Your master seed and keys are encrypted inside the wallet file using a 256-bit encryption key.
Scrypt
To prevent hackers from using high-speed graphics cards (GPUs) to brute-force guess your password, Bitcoin Core uses the Scrypt key derivation function. It intentionally forces the computer to use memory and processing time to check every single password attempt, making brute-force attacks mathematically unfeasible.



Back to main index