Show Posts
|
Pages: [1] 2 3 »
|
Yesterday, I had a conversation (in real life) with a person who I really think is very knowledgeable in Bitcoin.
I will not provide more details about his setup, because I value his privacy. I asked him to join the forum and open a thread to discuss about it. The forum would have a lot to learn from him. He will not...
He provided me with some important arguments against BIP39, but most importantly, he described a backup system that he finds superior.
But this system was (and still is) a red flag for me.
He said that he prefers to GPG encrypt private keys in WIF format and store them digitally.
So... What are your thoughts? I am aware that this system caused Luke Dashjr losing a lot of funds, so I can't believe he literally suggested it.
I won't be very active this weekend, but I will be back to read and discuss with you next week.
|
|
|
Warning:I am placing it here, at the top, to make sure you will see it. Use this script only for fun. The human brain is by orders of magnitude inferior to the dumbest computer when generating entropy (randomness). Background:I was asked to develop a brain wallet generator in Bash. So, I used most of the code I wrote in BASH21 and I slightly changed it to take a phrase as command line argument, to use it to generate the wallet. Prerequisites:sudo apt install base58 sudo apt install xxd sudo apt install qrencode
The script:#! /bin/bash
############################################### ################# FUNCTIONS ################### ###############################################
calculate_checksum(){ prefix=$1 value=$2 suffix=$3 s1=$(echo -n "${prefix}${value}${suffix}" | xxd -r -p | openssl sha256 | awk '{print $2}') s2=$(echo -n ${s1} | xxd -r -p | openssl sha256 | awk '{print $2}') checksum=$(echo ${s2} | head -c 8) echo ${checksum} }
hash_160(){ input=$1 sha=$(echo -n ${input} | xxd -r -p | openssl sha256 | awk '{print $2}') echo -n ${sha} | xxd -r -p | openssl ripemd160 | awk '{print $2}' }
generate_p2pkh(){ hash160=$1 checksum=$(calculate_checksum "00" ${hash160} "") echo -n "00${hash160}${checksum}" | xxd -r -p | base58 }
generate_p2sh(){ input=$1 hash160=$(hash_160 "0014${input}") checksum=$(calculate_checksum "05" ${hash160} "") echo -n "05${hash160}${checksum}" | xxd -r -p | base58 }
print_keys(){ echo "Entropy: "$1 echo "PK: "$2 echo "WIF: "$3 echo "Public Key: "$4 echo "Compressed Public Key: "$5 echo "HASH160: "$6 echo "Legacy Address: "$7 echo "Segwit Address: "$8 }
print_qr_codes(){ qrencode -s 6 -l M -o legacy_address.png $1 qrencode -s 6 -l M -o segwit_address.png $2 }
############################################### ################# MAIN ######################## ###############################################
# CONVERT ENTROPY TO WIF KEY
entropy=$1
pk=$(echo -n ${entropy} | openssl sha256 | awk '{print $2}')
checksum=$(calculate_checksum "80" ${pk} "01")
wif=$(echo -n "80${pk}01${checksum}" | xxd -r -p | base58)
# CONVERT PRIVATE KEY TO COMPRESSED PUBLIC KEY USING OPENSSL SECP256K1
public_key=$(openssl ec -inform DER -text -noout -in <(cat <(echo -n "302e0201010420") <(echo -n ${pk}) <(echo -n "a00706052b8104000a") | xxd -r -p) 2>/dev/null | tail -6 | head -5 | sed 's/[ :]//g' | tr -d '\n' && echo)
x_coord=$(printf ${public_key} | cut -c -66 | cut -c 3-) last_byte=$(printf ${public_key} | cut -c 129-) last_int=$(printf "%d" 0x${last_byte}) is_odd=$(expr ${last_int} % 2) if [ "$is_odd" == 1 ]; then compressed_public_key=03${x_coord} else compressed_public_key=02${x_coord} fi
# CONVERTING PUBLIC KEY TO COMPRESSED LEGACY ADDRESS
hash160=$(hash_160 ${compressed_public_key})
legacy_address=$(generate_p2pkh ${hash160})
segwit_address=$(generate_p2sh ${hash160})
# PRINT DATA
print_keys "${entropy}" ${pk} ${wif} ${public_key} ${compressed_public_key} ${hash160} ${legacy_address} ${segwit_address} > data.txt
print_qr_codes ${legacy_address} ${segwit_address}
Usage:Create a .sh script file anywhere on your computer: Copy paste the code and save it. The easiest way is with nano: nano brainwallet.sh <paste the code> Ctrl+o (save) Ctrl+x (exit)
Make it executable for the current user: Run it: ./brainwallet.sh 'apogio created a brainwallet generator using bash' Execution results:1. A file data.txt which includes the sensitive data (keys etc.) of the wallet. 2. A file legacy_address.png which displays a QR code for the wallet's legacy (P2PKH) address. 3. A file segwit_address.png which displays a QR code for the wallet's segwit (P2WPKH-P2SH) address. data.txt file format:Entropy: apogio created a brainwallet generator using bash PK: 913fc1abf77ae447c662cbd14a0803e519df65f8c40b3bcb20a911f0f31091dc WIF: L264Cp6WU73fzmQCvJ8Te2EazXTr3A17yAC13NQDQBwQvyUAaiG3 Public Key: 04582ed090da2d4e4fda943923910a0720391a9903fa5259aa9d50cf3710ed40bbc6ce378a86ab86f2b2d6635e8797e9c4fa2021eff4f57942c22395d7ad1afe83 Compressed Public Key: 03582ed090da2d4e4fda943923910a0720391a9903fa5259aa9d50cf3710ed40bb HASH160: 8ef81d4f19a7f284e68b32dd58931c6817ceb275 Legacy Address: 1E2xBY8kVhGgNZuRK8RwbvimpeW1E6DPat Segwit Address: 3MpZWJr5ct3Y4zEeSmbA1R17vj2RrRhfNw
Some notes:1. I don't encrypt the sensitive data, like I did in BASH21. It's one more way, from my side, to convince you that this script should be used only for fun. 2. Make sure to use single quotes to include the phrase. Otherwise Bash will think that each word is a separate command line argument and the results will be totally unexpected. 3. Make sure to remember that in brain wallets, every character matters. Thus, 'I am the best' is different from 'i am the best', or from 'I am the best '.
|
|
|
As the title suggests, I developed an easy to use script that generates a BIP39 mnemonic. I implemented it for fun. I don't plan to use it for real money. The script:# contact: apogio@proton.me from secrets import token_hex from hashlib import sha256
# read bip39 wordlist from file and import in a list bip39_wordlist_file = open("bip39_wordlist.txt", "r") bip39_wordlist = bip39_wordlist_file.read().split('\n')
# entropy entropy = bin(int(token_hex(16), 16))[2:] while len(entropy) != 128: entropy = bin(int(token_hex(16), 16))[2:] print('---------') print('ENTROPY: ') print('---------') print(entropy)
# calculate SHA256 sha256_hex = sha256(bytes.fromhex(hex(int(entropy,2))[2:])).hexdigest() sha256_bin = bin(int(sha256_hex, 16))[2:]
# calculate checksum checksum = sha256_bin[0:4]
# final seed to be converted into BIP39 mnemonic final = entropy + checksum
num_of_words = 12 word_length = len(final) // num_of_words
# calculate mnemonic res = [] for idx in range(0, len(final), word_length): res.append(final[idx : idx + word_length])
mnemonic = [] for idx in range(0, num_of_words): binary_place = res[idx] decimal_place = int(binary_place,2) mnemonic.append(bip39_wordlist[decimal_place])
print('\n-------------') print('BIP39 PHRASE: ') print('-------------') for w in range(0, len(mnemonic)): print(str(w+1) + ': ' + mnemonic[w])
How to run:1. Create a file on your machine (example mnemonic_gen.py). 2. Copy - paste the code from above. 3. Create a file on your machine, called bip39_wordlist.txt and copy-paste the wordlist into the file. 4. Make sure to have both files in the same directory. 5. Just run python mnemonic_gen.pySample output:--------- ENTROPY: --------- 11101110101000001011111101111000111100001001001100010000100001110011110100010011010100011000011001100100011111100100010111011100
------------- BIP39 PHRASE: ------------- 1: upgrade 2: album 3: taste 4: thrive 5: country 6: drum 7: violin 8: health 9: major 10: catalog 11: multiply 12: ride
Extra notes:1. The script uses secrets module to generate entropy. It is essentially a CSPRNG and is the recommended approach to generate pseudo-random numbers in Python. Internally, it makes use of os.urandom as well. 2. For best security, use it offline, by just running the script on an airgapped device. 3. This is not a complete wallet. You must import the seed phrase on an offline wallet that you like, in order to convert the BIP39 phrase into a seed and produce the corresponding xpriv and xpub. 4. This method is only recommended if you don't trust the entropy source of your device and you want to use CSPRNG on an airgapped computer though python libraries. 5. It is similar to Ian Coleman's BIP39 implementation, in a sense that they both must be executed offline. The difference lies in the libraries that are used, as Ian's implementation uses javascript, whereas the script above uses python libraries.
|
|
|
Hello, I am not entirely sure if this is the right place to post it. I have noticed an issue (inconsistency), in BIP39 mnemonic generation, between Ian Coleman's website and LearnMeABitcoinI have tried to generate a mnemonic, by feeding these websites with my own entropy (in binary format). They produce different mnemonics. In Ian Coleman's website I made sure to select a 12 word length mnemonic. So, naturally, I wanted to try and find out what is wrong... I generated the following entropy: 10010100101010110101111110001011000101000011110111100011101111000001011110010101101011010000011000011111111011110010000000111001 This entropy provided the following mnemonics: Ian Coleman's website: steel tiny neither hospital waste off essence cruise leaf antenna dawn bracket LearnMeABitcoin: net foot tissue chronic taste task furnace remember alcohol youth siege indoor Unless I am missing something here, do you have any thoughts?
|
|
|
Background:I have been sick for the past couple of days, so I decided to test my coding skills. I took some inspiration from this post. To be honest, I don't like paper wallets, but I thought I could learn more about how bitcoin works, through implementing a paper wallet in bash. Disclaimers:1. I have no experience in Bash scripting. 2. I will not use this program and I also advise you to use it only for educational purposes. Prerequisites:sudo apt install base58 sudo apt install xxd sudo apt install qrencode
The script:#! /bin/bash
############################################### ################# FUNCTIONS ################### ###############################################
calculate_checksum(){ prefix=$1 value=$2 suffix=$3 s1=$(echo -n "${prefix}${value}${suffix}" | xxd -r -p | openssl sha256 | awk '{print $2}') s2=$(echo -n ${s1} | xxd -r -p | openssl sha256 | awk '{print $2}') checksum=$(echo ${s2} | head -c 8) echo ${checksum} }
hash_160(){ input=$1 sha=$(echo -n ${input} | xxd -r -p | openssl sha256 | awk '{print $2}') echo -n ${sha} | xxd -r -p | openssl ripemd160 | awk '{print $2}' }
generate_p2pkh(){ hash160=$1 checksum=$(calculate_checksum "00" ${hash160} "") echo -n "00${hash160}${checksum}" | xxd -r -p | base58 }
generate_p2sh(){ input=$1 hash160=$(hash_160 "0014${input}") checksum=$(calculate_checksum "05" ${hash160} "") echo -n "05${hash160}${checksum}" | xxd -r -p | base58 }
print_keys(){ echo "Entropy: $1" echo "PK: $2" echo "WIF: $3" echo "Public Key: $4" echo "Compressed Public Key: $5" echo "HASH160: $6" echo "Legacy Address: $7" echo "Segwit Address: $8" }
encrypt_keys(){ print_keys $1 $2 $3 $4 $5 $6 $7 $8 | gpg -c -o keys.gpg }
print_qr_codes(){ qrencode -s 6 -l M -o legacy_address.png $1 qrencode -s 6 -l M -o segwit_address.png $2 }
print_addresses(){ echo "Legacy Address: $1" echo "Segwit Address: $2" }
create_addresses_file(){ print_addresses $1 $2 > addresses.txt }
############################################### ################# MAIN ######################## ###############################################
# CONVERT ENTROPY TO WIF KEY
entropy=$(cat /dev/urandom | tr -dc '[:graph:]' | fold -w 64 | head -n 1)
pk=$(echo -n ${entropy} | openssl sha256 | awk '{print $2}')
checksum=$(calculate_checksum "80" ${pk} "01")
wif=$(echo -n "80${pk}01${checksum}" | xxd -r -p | base58)
# CONVERT PRIVATE KEY TO COMPRESSED PUBLIC KEY USING OPENSSL SECP256K1
public_key=$(openssl ec -inform DER -text -noout -in <(cat <(echo -n "302e0201010420") <(echo -n ${pk}) <(echo -n "a00706052b8104000a") | xxd -r -p) 2>/dev/null | tail -6 | head -5 | sed 's/[ :]//g' | tr -d '\n' && echo)
x_coord=$(printf ${public_key} | cut -c -66 | cut -c 3-) last_byte=$(printf ${public_key} | cut -c 129-) last_int=$(printf "%d" 0x${last_byte}) is_odd=$(expr ${last_int} % 2) if [ "$is_odd" == 1 ]; then compressed_public_key=03${x_coord} else compressed_public_key=02${x_coord} fi
# CONVERTING PUBLIC KEY TO COMPRESSED LEGACY ADDRESS
hash160=$(hash_160 ${compressed_public_key})
legacy_address=$(generate_p2pkh ${hash160})
segwit_address=$(generate_p2sh ${hash160})
# PRINT DATA
encrypt_keys ${entropy} ${pk} ${wif} ${public_key} ${compressed_public_key} ${hash160} ${legacy_address} ${segwit_address}
print_qr_codes ${legacy_address} ${segwit_address}
create_addresses_file ${legacy_address} ${segwit_address}
Usage:Create a .sh script file anywhere on your computer: Copy paste the code and save it. The easiest way is with nano: nano paperwallet.sh <paste the code> Ctrl+o (save) Ctrl+x (exit)
Make it executable for the current user: Run it: Execution results:1. A file keys.gpg which includes the sensitive data (keys etc.) of the wallet. The file is encrypted with the password that you set at execution time. 2. A file legacy_address.png which displays a QR code for the wallet's legacy (P2PKH) address. 3. A file segwit_address.png which displays a QR code for the wallet's segwit (P2WPKH-P2SH) address. 4. A file addresses.txt which includes the addresses in .txt format. keys.gpg file format:Entropy: D_}L1jJie.'&p~@GS<@/~Yr;?uj69lm!vT^V`h1uxW!nhYU"'D>H@`7NP]#e7<?{ PK: c46b641982fd74f10a1607d01e70e4d4c7a5aed2c01c7b09bd66044ce26f0913 WIF: L3oXPPp62gS6NtxopBGoGDhvs6g4ovGp4oX34nLXa566d6qNSMyJ Public Key: 048f92eb77547bc8b1f5e1e62b683399d75bfc1e98621fef0e253f36baf27891d8c07e72e095cd5b298bc94182a050e80b66a64d0f76967bd1d44077430289dae4 Compressed Public Key: 028f92eb77547bc8b1f5e1e62b683399d75bfc1e98621fef0e253f36baf27891d8 HASH160: 9ba03f824e7883027d07fb15a627a82a897195ba Legacy Address: 1FBshy1TaRCoWM2ChiJ6dyDZdPmEfDAHHq Segwit Address: 37gzjcd6wssRB2igUWDYNB4cp546ksFXXo
Some notes:- The entropy is produced from /dev/urandom.
- The methods I used are included in the openssl library. I have used sha256, ripemd160 and ec.
- Coding-wise, it sucks, I know... But as I said, it's my first effort with bash scripting.
- I have tested the results on Ian Coleman's website. I have also imported some of the WIFs in Electrum and made sure it produces the correct addresses.
- I could have only printed the WIF and the Address, because that's what paper wallets do, but as I said, it's for educational purposes only, so I printed all the steps of the process.
Changelog:24/01/28 | || | Adds QR code for legacy address, using qrencode linux command. | 24/01/29 | || | Refactors code. Adds more functions. | 24/01/30 | || | Adds Segwit (p2wpkh-p2sh) address. Minor code changes. |
|
|
|
Links to other tutorials from the series:[BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) https://bitcointalk.org/index.php?topic=5476754.0[BitcoinTalk Node Tutorial #2] Installing Electrs from source https://bitcointalk.org/index.php?topic=5477339.0[BitcoinTalk Node Tutorial #3] Sparrow terminal / infinite Whirlpool mixes https://bitcointalk.org/index.php?topic=5470024.0[BitcoinTalk Node Tutorial #4] Connecting BISQ to our node https://bitcointalk.org/index.php?topic=5478756.0Size required on disk:$ sudo du -sh /media/apogio/BTC/monero 174G /media/apogio/BTC/monero
Hosting a Monero node on the same machineAs I have mentioned in various places in this forum, I am a huge fun of Monero. So, without further delay, let's run a monero node on our Raspberry Pi. Configuring Firewall to allow incoming connections on ports 18080 & 18089I am using ufw for this tutorial. So the command should be: sudo ufw allow 18080 sudo ufw allow 18089
Downloading & Installing Monero binariesWe will download the binaries in our Downloads folder and we will install them. mkdir ~/Downloads/monero wget https://downloads.getmonero.org/cli/linuxarm8 tar -xvf linuxarm8 -C monero cd ~/Downloads/monero/monero-aarch64-linux-gnu-v0.18.3.1 sudo install -m 0755 -o root -g root -t /usr/local/bin monero*
Now, all the binaries are install in our /usr/local/bin directory. Let's check if they work using the command It should print an output that displays the available options for monerod binary. Configuring Monero nodeWe are almost ready to roll, but we need to create the configuration file for our node. We will create it in our external SSD, in the path /media/apogio/BTC/monero. nano /media/apogio/BTC/monero/monerod.conf
Now let's paste the following data inside the file: # Data directory (blockchain db and indices) data-dir=/media/apogio/BTC/monero
# Logs log-file=/media/apogio/BTC/monero/monerod.log max-log-file-size=0
# P2P configuration p2p-bind-ip=0.0.0.0 # Bind to all interfaces (the default) p2p-bind-port=18080 # Bind to default port public-node=true
# RPC configuration rpc-restricted-bind-ip=0.0.0.0 # Bind restricted RPC to all interfaces rpc-restricted-bind-port=18089 # Bind restricted RPC on custom port to differentiate from default unrestricted RPC (18081)
# Node settings no-igd=1 # Disable UPnP port mapping no-zmq=1
# Block known-malicious nodes from a DNSBL enable-dns-blocklist=1
# Peers out-peers=64 in-peers=1024
The last 2 lines will be removed after the initial blockchain synchronization. Let's start our node by running the following: monerod --config-file=/media/apogio/BTC/monero/monerod.conf --detach
Now monero runs on the background, downloading the blockchain. We can easily check the status by running: It will return something like the following example: Height: 319704/3054494 (10.5%) on mainnet, not mining, net hash 14.05 MH/s, v1, 33(out)+0(in) connections, uptime 0d 0h 26m 3s
That's it, we are now running a monero node. Connecting Monero GUI wallet to our nodeThe final step is to connect a wallet to our node. Of course we could use the monero-wallet-cli binary, but for our tutorial we will connect the Monero GUI wallet to our node. After downloading the appropriate version for our OS, we will need to choose the "Advanced mode". Create a new wallet: Then head over to the node settings and simply add the IP where the node is hosted and the port.
|
|
|
Links to other tutorials from the series:[BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) https://bitcointalk.org/index.php?topic=5476754.0[BitcoinTalk Node Tutorial #2] Installing Electrs from source https://bitcointalk.org/index.php?topic=5477339.0[BitcoinTalk Node Tutorial #3] Sparrow terminal / infinite Whirlpool mixes https://bitcointalk.org/index.php?topic=5470024.0[BitcoinTalk Node Tutorial #5] Hosting a Monero node on the same machine https://bitcointalk.org/index.php?topic=5480371.0 Connecting BISQ to our nodeThis tutorial is slightly different. In this tutorial we will need another computer to install BISQ. Then we will connect BISQ to our Bitcoin Node through TOR. Doing that, BISQ will communicate with the Bitcoin network exclusively through our node. Exposing Bitcoin Core as a TOR hidden serviceWe have already set up our bitcoin.conf to run behind TOR in our tutorial#1. Most of the times, the directive proxy=127.0.0.1:9050 is sufficient. Now let's go to /etc/tor/torrc file and let's edit it. For me some of the following lines where already there but I had to uncomment them: ControlPort 9051 CookieAuthentication 1 CookieAuthFileGroupReadable 1 DataDirectoryGroupReadable 1 HiddenServiceDir /var/lib/tor/bitcoin-service/ HiddenServicePort 8333 127.0.0.1:8333
Then, just restart the service with: sudo systemctl restart tor Now, it's time to read our .onion address: cat /var/lib/tor/bitcoin-service/hostname The address will be there for us. Finally, we need to stop Bitcoin Core and add the ip in the configuration file. bitcoin-cli --datadir=/media/apogio/BTC/bitcoincore stop nano /media/apogio/BTC/bitcoincore/bitcoin.conf Add the following directive: externalip=<the onion address> Installing BISQSince I am not a professional documentation writer, I certainly can't write the installation guide any better than the guys from BISQ. Therefore, depending on your OS, follow the equivalent guide from this page: https://bisq.wiki/Downloading_and_installingNote: make sure to validate every signature and binary you download. Connecting BISQ to our nodeLuckily, this is very simple and you can just follow my screenshots. Let's head to Settings - Network Info: There, simply tick the "Use Tor for Bitcoin network" and "Use custom Bitcoin nodes". Then, add the address and press Enter. If done properly, you should see that Bisq connect to Bitcoin network with 1 peer only. This peer, as you 've already guessed is your own node.
|
|
|
Links to other tutorials from the series:[BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) https://bitcointalk.org/index.php?topic=5476754.0[BitcoinTalk Node Tutorial #3] Sparrow terminal / infinite Whirlpool mixes https://bitcointalk.org/index.php?topic=5470024.0[BitcoinTalk Node Tutorial #4] Connecting BISQ to our node https://bitcointalk.org/index.php?topic=5478756.0[BitcoinTalk Node Tutorial #5] Hosting a Monero node on the same machine https://bitcointalk.org/index.php?topic=5480371.0Size required on disk:$ sudo du -sh /media/apogio/BTC/electrs 42G /media/apogio/BTC/electrs
Installing Electrs from sourceWe have to download the sources from github: https://github.com/romanz/electrsIn order to do this, we need some packages, which we will install using the following command: sudo apt install cargo clang cmake git curl
Then, we will download the sources for Electrs in our home directory: cd ~ git clone https://github.com/romanz/electrs.git
We need to run the following command to install electrs: cargo build --locked --release
This will take a while... Now that the installation is finished, I want to run the electrs executable which is located in the path: ~/electrs/target/release/electrs. However, I want to be able to run it from everywhere, so I will move it where the bitcoin core binaries are: mv ~/electrs/target/release/electrs /usr/local/bin
Now we must create a directory in our external SSD, alongside our bitcoincore directory. mkdir /media/apogio/BTC/electrs
We will create a configuration file ( electrs.conf) inside this directory. cd /media/apogio/BTC/electrs nano electrs.conf
At this point, we need to specify some details in our configuration file. network="bitcoin" auth="<user>:<pass>" daemon_dir="/media/apogio/BTC/bitcoincore" db_dir="/media/apogio/BTC/electrs/db" daemon_rpc_addr="127.0.0.1:8332" daemon_p2p_addr="127.0.0.1:8333" electrum_rpc_addr="127.0.0.1:50001" index_lookup_limit=1000 log_filters="INFO" timestamp=true
Notice that I have set log_filters level to INFO and not DEBUG but if I need more information I will change it. Now it is time to run electrs using the following command: electrs --conf /media/apogio/BTC/electrs/electrs.conf
After it is finished, the electrum server will be running on port 50001.
|
|
|
Links to other tutorials from the series:[BitcoinTalk Node Tutorial #2] Installing Electrs from source https://bitcointalk.org/index.php?topic=5477339.0[BitcoinTalk Node Tutorial #3] Sparrow terminal / infinite Whirlpool mixes https://bitcointalk.org/index.php?topic=5470024.0[BitcoinTalk Node Tutorial #4] Connecting BISQ to our node https://bitcointalk.org/index.php?topic=5478756.0[BitcoinTalk Node Tutorial #5] Hosting a Monero node on the same machine https://bitcointalk.org/index.php?topic=5480371.0Size required on disk:$ sudo du -sh /media/apogio/BTC/bitcoincore 627G /media/apogio/BTC/bitcoincore
I will create a series of posts (at my own slow pace). In this series, I will create a custom Bitcoin Node on a GUI-less OS. I will add various features on this node.
I encourage all of you to share your thoughts and suggestions. In fact, some decisions will be determined by your suggestions. Hardware / Software used in the seriesComputer | Raspberry Pi 4b 8GB RAM | Software | Raspberry Pi OS Lite (64-bit) | Storage | 2TB external SSD |
Installing and running Bitcoin Core on Raspbian LiteDownloading Bitcoin CoreFirstly, we create a directory on the home path, where we will download the necessary packages, let's say we create it inside the Downloads directory: mkdir -p ~/Downloads/Core cd ~/Downloads/Core
Now, the latest version is 25.1, so the following command will download the core software and the checksum in our directory: wget https://bitcoincore.org/bin/bitcoin-core-25.1/bitcoin-25.1-aarch64-linux-gnu.tar.gz wget https://bitcoincore.org/bin/bitcoin-core-25.1/SHA256SUMS
Let's check whether the checksum is correct: sha256sum --ignore-missing --check SHA256SUMS
So, now we must extract the installer from the tarball: tar -xvf bitcoin-25.1-aarch64-linux-gnu.tar.gz
Personally, I install my binaries in /usr/local/bin, so I will use the following command: sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-25.1/bin/*
We must be done, let's check: We should receive a prompt that the version is 25.1. Let's delete the directory we created to download the stuff we needed. It's no longer necessary: cd ~; rm -rf ~/Downloads/Core
Running Bitcoin CoreMost of the time, when the external storage is connected, it mounts to a specific filesystem location. Let's check where it is: This will return something like: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS ... sdb 8:16 0 1.9T 0 disk `-sdb1 8:17 0 1.9T 0 part /media/apogio/BTC ...
From this, we can see that the external drive is mounted on /media/apogio/BTC. This will be our home directory for Bitcoin Core. Let's create a configuration file and start Bitcoin Core: cd /media/apogio/BTC mkdir bitcoincore nano bitcoin.conf
This will open up nano and create a file called bitcoin.conf inside the directory /media/apogio/BTC/bitcoincore. The following lines are ok for the moment: datadir=/media/apogio/BTC/bitcoincore dbcache=5000 daemon=1 server=1
Now we are ready to go. Let's run Bitcoin Core and wait until the IBD is finished: bitcoind -conf=/media/apogio/BTC/bitcoincore/bitcoin.conf
This will take some days. So relax and let it work. If at any time you wish to stop the daemon, just run: bitcoin-cli --datadir=/media/apogio/BTC/bitcoincore stop
The IBD is finished, I will stop Bitcoin Core, and I will refresh my bitcoin.conf file as follows: # basic directives datadir=/media/apogio/BTC/bitcoincore
# bitcoin daemon daemon=1 server=1 listen=1
# tor proxy=127.0.0.1:9050 bind=127.0.0.1
# network rpcuser=<my user> rpcpassword=<my pass>
[main] rpcbind=127.0.0.1 rpcbind=<the local ip of my RPi> rpcallowip=127.0.0.1 rpcallowip=192.168.0.0/16
# optimimizations maxconnections=30
|
|
|
There are too many topics about it, but I haven't found the answer I want. I would post on older topics but I got the warning that the topics were older than 120 days, so I started a new one.
I have 2 nodes and I am currently setting up my 3rd node. The first 2 nodes were constructed between blocks 700,000 and 750,000 and the process went okay-ish. On the 3rd node, my IBD is very slow. Let me share my setup. Hardware:1. Raspberry Pi 4 Model B with 8GB RAM. 2. Cat6 ethernet cable. 3. 2TB SSD 2.5''. 4. SATA (on the disk) to USB 3.0 (on the Rpi) Internet speed:Download: 200 Mbps Upload: 5 Mbps Ping: 4 ms Software:Raspbian OS Bitcoin Core 25.0 My conf is:datadir=... server=1 daemon=1 txindex=1
After reaching block 790,000 the process slowed down a lot. I have spent 5 days until block 790,000 and 3 more days until 810,000 and there are still approximately 10,000 blocks left, which will take even more It's normal, I know! Because it scans and validates recursively. Does anyone know if -txindex=1 slows up the Initial Blockchain Download ? If so, is there a reason?
|
|
|
Καλησπέρα,
Το ελληνικό board έχει ξεφύγει. Δεν ήρθα να μας σώσω, δεν με ενδιαφέρει ιδιαίτερα.
Ωστόσο βλέπω απαράδεκτες συμπεριφορές και δηλώσεις. Βρισίδια και αναίσχυντες εκφράσεις.
Όσοι θέλουν το forum τελείως ζούγκλα, να ξέρετε ότι υπάρχουν και άνθρωποι που δεν γουστάρουν να βλέπουν τόσο χαμηλού επιπέδου posts.
Ναι, δεν είμαστε υποχρεωμένοι ούτε να σας διαβάζουμε, ούτε να απαντάμε, αλλά έφτασε ο κόμπος στο χτένι.
Η μόνη παράκληση που κάνω είναι να σεβαστείτε ανθρώπους που ΔΕΝ θέλουν να διαβάζουν ύβρεις μέρα-νύχτα.
Μην ξεχνάτε ότι προσβάλλοντας με βρισιές έναν συμφορουμίτη, χαλάτε την ποιότητα των posts για όλους όσους διαβάζουν.
Υ.Γ. Δεν είμαι σε forums πολλά χρόνια, οπότε δεν ξέρω πολλά από forums. Υ.Γ Θα ζητήσω να βρεθούν moderators γιατί δεν πάει άλλο.
|
|
|
Problem: I have really been struggling with understanding how the transaction size is calculated.
Question: I will post my thoughts below. I will ask my questions with red color.
The best answer: Every answer is much appreciated. However, I would be very happy if one could also point an example, either from a real transaction or not.
A bitcoin transaction takes N inputs and produces X outputs. The transaction includes the following parts:Version
| 4 bytes
| # of Inputs
| (How many bytes is this ?)
| Inputs
| Each input's size (*)
| # of Outputs
| (How many bytes is this ?)
| Outputs
| Each output's size (**)
| Locktime
| 4 Bytes
| * Each input consists of the following fields:TXID
| 32 bytes
| VOUT
| 4 bytes
| ScriptSig Size
| (How many bytes is this ?)
| ScriptSig
| (How many bytes is this ?)
| Sequence
| 4 Bytes
| ** Each output consists of the following fields:Value
| 8 bytes
| ScriptPubKey Size
| (How many bytes is this ?)
| ScriptPubKey
| (How many bytes is this ?)
|
|
|
|
I am curious to know if (and how much) Bitcoin is adopted in low- and middle-income countries. I am reading the Bitcoin Magazine (Issue 24 - The El Salvador Issue). Here are some stats, according to the magazine: - The global average cost of sending $200 remained high at 6.5% - or $13, in 2020.
- In Sub-Saharan Africa, the average cost of sending $200 was 8.2% in 2020.
- Sending money from Japan to Brazil cost 11.5% in remittance costs in 2020
- 1 out of 9 people on the planet depend on remittances sent by migrant workers to support their families.
According to these, do you feel like Bitcoin has helped? Do you use it to avoid all those remittance costs?
|
|
|
Καλημέρα σε όλους.
Όπως συζητήθηκε σε άλλο topic, η γνώμη μου είναι πως σαν ελληνική κοινότητα αποτύχαμε να διαδώσουμε το bitcoin.
Οι σκέψεις μου είναι πολλές, αλλά θα ηθελα να ξεκινήσει η συζήτηση και να παραθέσω τις ιδέες μου μέσα από το διάλογο.
Πάντως η εκτίμηση μου κυρίως πηγάζει από το ότι η πλειοψηφία των ανθρώπων στους οποίους μιλώ για το bitcoin φαίνεται να το τσουβαλιαζουν μαζί με όλα τα cryptos. Ταυτόχρονα, όπως εύστοχα επισημάνθηκε, οι περισσότεροι θεωρούν πως είναι τζόγος, βλέποντας το μέσα από συμβατικές οικονομικές παρωπιδες.
Πείτε μου λοιπόν γνώμες.
Λόγω πολλών υποχρεώσεων, θα συμμετέχω αυτή τη βδομάδα λίγο πιο ανενεργά, αλλά είμαι σίγουρος ότι θα παίξετε μπάλα σωστά όλοι οι υπόλοιποι.
Αν βάλατε σχόλια στο άλλο topic στα οποία δεν απάντησα, δεν τα αγνόησα, απλώς θεωρω σκόπιμο να τα αναφέρετε κι εδώ.
|
|
|
According to Coingecko, at the time of writing, BTC dominance is at 49.3%. This lead me to the following chart (by Coingecko), which represents the market dominance history. According to this image BTC has always been far ahead from other shitcoins. What I am curious to know is what happened in 2017 and in 2021. I have been searching on the internet and I have found that in 2017 ETH had the Byzantium fork which reduced the block reward from 5 ETH to 3 ETH. But ETH has no max supply so I was expecting that this wouldn't affect its price so much. At the same time, I couldn't really find anything related to Bitcoin in 2017, but I was surprised to see that BTC's price went from $1000 to $20K in a year. So if there was a 20x increase in price, how could the dominance go that low? In 2021, I remember everyone talking about NFTs, so I guess this explains why shitcoins gained market cap.
|
|
|
There are two options in my mind, now that I think about creating a new multisig wallet for personal usage. I will be the one to take care of the cosigners. I have been thinking a 2-of-3 or a 2-of-2 set up. I already own a 2-of-3 wallet and I need another one, but perhaps I could change the set up a little bit. Option A (2-of-3):Cosigners A, B, C (Seed A, Seed B, Seed C, XPUB A, XPUB B, XPUB C) Backup (each item in different locations): - Seed A, XPUB B
- Seed B, XPUB C
- Seed C, XPUB A
Option A (2-of-2):Cosigners A, B (Seed A, Seed B, XPUB A, XPUB B) Backup (each item in different locations): - Seed A, XPUB B
- Seed A, XPUB B
- Seed B, XPUB A
- Seed B, XPUB A
Questions: 1. Is it cheaper to have less total cosigners to define the wallet? In that case, would a 2-of-2 be cheaper than a 2-of-3? 2. Is my backup set ups above optimal? 3. Any other thoughts?
|
|
|
This tutorial is no longer valid. Since Sparrow 1.9.0 the mixing feature is no longer supported.
Links to other tutorials from the series:[BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) https://bitcointalk.org/index.php?topic=5476754.0[BitcoinTalk Node Tutorial #2] Installing Electrs from source https://bitcointalk.org/index.php?topic=5477339.0[BitcoinTalk Node Tutorial #4] Connecting BISQ to our node https://bitcointalk.org/index.php?topic=5478756.0[BitcoinTalk Node Tutorial #5] Hosting a Monero node on the same machine https://bitcointalk.org/index.php?topic=5480371.0 Sparrow terminal / infinite Whirlpool mixesInstalling SparrowSteps:Find the proper version for our architecture and download with wget: wget "https://github.com/sparrowwallet/sparrow/releases/download/1.7.9/sparrow-server_1.7.9-1_arm64.deb" Install the deb file using the command: sudo dpkg -i sparrow-server_1.7.9-1_arm64.deb By default, the Sparrow binary will be in Running SparrowNote: Using ssh can be tricky. If you initiate a session, start sparrow and then close ssh, it will close sparrow too. So we will use the "screen" command. If it is not installed, run: Steps:Run screen command: Navigate to the path mentioned above ("/opt/sparrow/bin") and run Sparrow. It will load the following screen: Insert the preferences tab and go to server: Then choose the option you desire for the node to which you wish Sparrow to be connected. Personally I run Sparrow on the same linux device as my node, so it looks like this: Then head back to the wallets tab and click on it: Click on "Create wallet": Go to the "Deposit" tab: It will give you an address where you can send your funds: Go to the UTXO tab and click on "Mix Selected" Once the process goes further, head back to "Postmix" tab: There, you will be presented with your UTXOs Final StepsClick: this will get you out of the Sparrow app and it will leave it running on the background. Whenever you decide, you can enter Sparrow will be presented to you exactly where you left it and you can enjoy your free mixes.
|
|
|
Hello. I have been thinking a lot about buying ASIC miners and start mining.
However, I have some questions for the forum members, that will give me a general picture of the mining process and how to make it efficient.
Furthermore, I think we could gain some insight on what most people do in regards to mining.
My purpose is to observe experienced people and see how they mine, so perhaps I can follow their instructions.
So my questions are:
1. Are you mining? If no, what is the main reason? I reckon financial issues will be the top factor, but let's see. 2. Are you solo mining or mining using a pool? Please elaborate on what kind of devices you use. Also, in case you use a pool, if you feel comfortable, share which ones you use. 3. Are you mining on your premises or are you using hosting facilities? If you mine on premises, how do you deal with the electricity costs and the noise? 4. (Leave every other note you have here - free text)
|
|
|
Hello guys.
I want 240,000 sats in BTC and in exchange I offer 250,000 on the Lightning Network.
Notes:
1. As I don't have any trust in this forum, I will pay the invoice first. In fact I want to increase my trust here, so I would appreciate it if I could get a good feedback afterwards.
2. I want the other user to have positive feedback since as I said I will pay first.
3. Normally I do this via Robosats but I can't find any offers there.
4. Feel free to contact me via PM.
|
|
|
|