edits of recent new content

This commit is contained in:
Shannon Appelcline 2026-02-19 08:13:45 -10:00 committed by GitHub
parent f1756a8f00
commit 0666a75de2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,13 +89,13 @@ You now have a Bitcoin wallet. But you can't receive funds with a wallet. For th
## Create an Address ## Create an Address
The next thing you need to do is create an address for receiving payments. This is done with the `bitcoin-cli getnewaddress` command. Remember that if you want more information on this command, you should type `bitcoin-cli help getnewaddress`. There are a variety of types of addresses, due to Bitcoin's evolution over the years. [§4.1](04_1_Sending_Coins_The_Easy_Way.md) covers them all. For now, though we're just going to create an address of the default type, which is Bech32. The next thing you need to do is create an address for receiving payments. This is done with the `bitcoin-cli getnewaddress` command. Remember that if you want more information on this command, you should type `bitcoin-cli help getnewaddress`. There are a variety of types of addresses, due to Bitcoin's evolution over the years. [§3.5](03_5_Understanding_the_Address.md) covers them all. For now, though we're just going to create an address of the default type, which is Bech32.
``` ```
$ bitcoin-cli getnewaddress $ bitcoin-cli getnewaddress
tb1q05ua6g7njnjrtsjc0t9w3jc6g2leeznasf4ny9 tb1q05ua6g7njnjrtsjc0t9w3jc6g2leeznasf4ny9
``` ```
You can keep typing the command you'll get a different address each time: If you keep typing the command, you'll get a different address each time:
``` ```
$ bitcoin-cli getnewaddress $ bitcoin-cli getnewaddress
tb1q0psqqqgy0fv5928wmk86ntu7hlax8dva7nl82p tb1q0psqqqgy0fv5928wmk86ntu7hlax8dva7nl82p
@ -117,15 +117,15 @@ $ bitcoin-cli getaddressesbylabel ""
} }
} }
``` ```
Note that this address begins with an "tb1", which [means](https://en.bitcoin.it/wiki/List_of_address_prefixes) that it's a Bech32 address on either signet or testnet. The discussion of different address types in §4.1 will also talk about all of their identifying prefixes. Note that this address begins with an "tb1", which [means](https://en.bitcoin.it/wiki/List_of_address_prefixes) that it's a Bech32 address on either signet or testnet. The discussion of different address types in [§3.5](03_5_Understanding_the_Address.md) will also talk about all of their identifying prefixes.
> :link: **SIGNET vs MAINNET vs TESTNET:** The equivalent mainnet address would start with a "bc1". > :link: **SIGNET vs MAINNET vs TESTNET:** The equivalent mainnet address would start with a "bc1".
Take careful note of the address. You'll need to give it to whomever will be sending you funds. Take careful note of the address. You'll need to give it to whomever will be sending you funds.
> :book: ***What is a Bitcoin address?*** A Bitcoin address is literally where you receive money. It's like an email address, but for funds. It's based on a public key, though different address schemes adjust that in different ways. However unlike an email address, a Bitcoin address should be considered single use: use it to receive funds just _once_. When you want to receive funds from someone else or at some other time, generate a new address. This is suggested in large part to improve your privacy. The whole blockchain is immutable, which means that explorers can look at long chains of transactions over time, making it possible to statistically determine who you and your contacts are, no matter how careful you are. If you keep reusing the same address, then this becomes even easier. > :book: ***What is a Bitcoin address?*** A Bitcoin address is literally where you receive money. It's like an email address, but for funds. It's based on a public key, though different address schemes adjust that in different ways. Unlike an email address, a Bitcoin address should be considered single use: use it to receive funds just _once_. When you want to receive funds from someone else or at some other time, generate a new address. This is suggested in large part to improve your privacy. The whole blockchain is immutable, which means that explorers can look at long chains of transactions over time, making it possible to statistically determine who you and your contacts are, no matter how careful you are. If you keep reusing the same address, then this becomes even easier.
By creating your first Bitcoin address, you've also begun to fill in your Bitcoin wallet. More precisely, you've begun to fill the `wallet.dat` file in the appropriate `~/.bitcoin/signet /wallets/` directory. With a single address in hand, you could jump straight [§3.5: Receiving a Transaction](03_5_Receiving_a_Transaction.md) and begin receiving funds. However, before we get there, we're going to briefly discuss backing up your wallet and a few optional wallet commands that you might want to use in the future. By creating your first Bitcoin address, you've also begun to fill in your Bitcoin wallet. More precisely, you've begun to fill the `wallet.dat` file in the appropriate `~/.bitcoin/signet /wallets/` directory. With a single address in hand, you could jump straight [§3.6: Receiving a Transaction](03_6_Receiving_a_Transaction.md) and begin receiving funds. However, before we get there, we're going to briefly discuss backing up your wallet and a few optional wallet commands that you might want to use in the future.
## Backup Your Wallet ## Backup Your Wallet
@ -136,7 +136,7 @@ $ bitcoin-cli backupwallet ~/backups/mainwallet.dat
``` ```
This will create a backup of the SQLite file that you can later restore from with the `bitcoin-cli restorewallet` command. It's probably best used if you'll be backing up your wallet to a secure (encrypted) storage area. This will create a backup of the SQLite file that you can later restore from with the `bitcoin-cli restorewallet` command. It's probably best used if you'll be backing up your wallet to a secure (encrypted) storage area.
Just having a single backup will be enough to recover your wallet, because it'll contain the seed used to generate the wallet (more on that next chapter). However, it's good to regularly backup your wallet so that you don't lose data about your transactions. Just having a single backup will usually be enough to recover your wallet, because it'll contain the seed used to generate the wallet (more on that next chapter). However, it's good to regularly backup your wallet so that you don't lose data about your transactions. (A few commands also force the creation of a new seed, and you'd need to backup your wallet again in those cases.)
## Optional: Encrypt Your Wallet ## Optional: Encrypt Your Wallet
@ -145,9 +145,9 @@ You can choose to encrypt your wallet. (It actually just encrypts the private in
$ bitcoin-cli encryptwallet "your-great-password" $ bitcoin-cli encryptwallet "your-great-password"
wallet encrypted; The keypool has been flushed and a new HD seed was generated. You need to make a new backup with the backupwallet RPC. wallet encrypted; The keypool has been flushed and a new HD seed was generated. You need to make a new backup with the backupwallet RPC.
``` ```
You should _definitely_ encrypt your wallet if you are using `bitcoin-cli` to deal with real money, but you probably shouldn't do it for this course (or any other use of test networks) because it'll just add new hoops to jump through test out funds. You should _definitely_ encrypt your wallet if you are using `bitcoin-cli` to deal with real money, but you probably shouldn't do it for this course (or any other use of test networks) because it'll just add new hoops to jump through test out funds. Note that this is one of those functions that generates an additional seed: make sure you backup your wallet again afterward if you run it.
Once you have encrypted your wallet, you'll be required to enter a passphrase in order to do many commands: Once you have encrypted your wallet, you'll be required to enter a passphrase prior to running many commands:
``` ```
$ bitcoin-cli walletpassphrase "your-great-password" 3600 $ bitcoin-cli walletpassphrase "your-great-password" 3600
``` ```
@ -160,14 +160,14 @@ $ bitcoin-cli walletlock
## Optional: Reload Named Wallets ## Optional: Reload Named Wallets
If you created a no-name (`""`) wallet, it will automatically load when you restart `bitcoind`. However, if you instead created a named wallet, it will not reload, forcing you to (initially) reload it by hand when you restart. If you created a no-name (`""`) wallet, it will automatically load when you restart `bitcoind`. However, if you instead created a named wallet, it will not reload, forcing you to (initially) reload it by hand when you restart `bitcoind`.
``` ```
$ bitcoin-cli loadwallet mainwallet $ bitcoin-cli loadwallet mainwallet
{ {
"name": "mainwallet" "name": "mainwallet"
} }
``` ```
But you can also make your named wallet load on start by adding a `true` to the end of the `bitcoin-cli loadwallet` command: However, you can make a named wallet load on startup by adding a `true` to the end of the `bitcoin-cli loadwallet` command:
``` ```
$ bitcoin-cli loadwallet mainwallet true $ bitcoin-cli loadwallet mainwallet true
{ {
@ -185,7 +185,7 @@ $ bitcoin-cli createwallet "gamingfunds"
"name": "gamingfunds" "name": "gamingfunds"
} }
``` ```
bitcoin-cli listwallets` will list out all of the wallets currently "loaded", which will include your newly created one(s). `bitcoin-cli listwallets` will list out all of the wallets currently "loaded", which will include your newly created one(s).
``` ```
$ bitcoin-cli listwallets $ bitcoin-cli listwallets
[ [
@ -230,14 +230,14 @@ As discussed above, named wallets will not load by default unless you use `loadw
## Optional: Prove Control ## Optional: Prove Control
In previous versions of Bitcoin Core, you were able to prove control of an address with the `bicoin-cli signmessage` command. This is generally a nice feature because it allows you to assure someone sending you funds that they're sending to a place where you will definitely be able to retrieve the funds (or at least where you can currently). Because of the advent of descriptor wallets, which we'll talk about in the next section, this is no longer possible. You still _can_ prove control of an address by deriving a WIF-format private key from the descriptor for a particular address and then using `bitcoin-cli signmessagewithprivkey` with that specific key, but that's a complex process that goes beyond the scope of this course. In previous versions of Bitcoin Core, you were able to prove control of an address with the `bicoin-cli signmessage` command. This is generally a nice feature because it allows you to offer assurance to someone sending you funds that you'll definitely be able to retrieve those funds (or at least that you can currently). Because of the advent of descriptor wallets, which we'll talk about in the next section, this is no longer possible. You still _can_ prove control of an address by deriving a WIF-format private key from the descriptor for a particular address and then using `bitcoin-cli signmessagewithprivkey` with that specific key, but that's a complex process that goes beyond the scope of this course.
Just keep in mind for the moment that proof of control is a nice feature if you can manage it. Just keep in mind for the moment that proof of control is a nice feature if you can manage it.
## Summary: Setting Up Your Wallet ## Summary: Setting Up Your Wallet
You need to create an address to receive funds. That address is stored in a wallet, which you can backup. But, there's more to both the wallet and the address: they're supported by an interoperable description system called descriptors. Understanding that will be the topic of the next chapter, before we finally get some funds. We'll also be seeing lots more wallet commands in the future, but they'll be things like checking your balance, which require you to have those funds! You need to create an address to receive funds. That address is stored in a wallet, which you can backup. But, there's more to both the wallet and the address: wallets are supported by an interoperable description system called descriptors; and addresses come in a variety of types. We'll cover those in the next two chapters before we finally get to some funds. We'll also be seeing lots more wallet commands in the future, but they'll be things like checking your balance, which require you to have those funds!
## What's Next? ## What's Next?
Step back from "Understanding Your Bitcoin Setup" with [Interlude: Using Command-Line Variables](03_3__Interlude_Using_Command-Line_Variables.md). Continue "Understanding Your Bitcoin Setup" with [§3.4: Undestanding the Descriptor](03_4_Understanding_the_Descriptor.md) and then [§3.5: Understanding the Address](03_5_Understanding_the_Address.md).