0% found this document useful (0 votes)
18 views2 pages

Notes on Bitcoin 32

A Bitcoin wallet stores funds and contains public and private keys for transactions. Private keys are secret strings that allow spending of bitcoins and must be securely stored, as losing them means losing access to funds. Sweeping private keys transfers funds to a new address, while importing private keys can pose security risks if not handled properly.

Uploaded by

prototype199191
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Notes on Bitcoin 32

A Bitcoin wallet stores funds and contains public and private keys for transactions. Private keys are secret strings that allow spending of bitcoins and must be securely stored, as losing them means losing access to funds. Sweeping private keys transfers funds to a new address, while importing private keys can pose security risks if not handled properly.

Uploaded by

prototype199191
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Your Bitcoin Wallet

[ Unlocking Private and Public Keys ]


Not only does a bitcoin wallet serve as a way to store your funds — similar to a bank account — it
also allows you to send and receive funds. The presented bitcoin wallet address is the identification
number by which you are known as a member of the bitcoin network. It acts as your account number
to send, receive, and store bitcoins.

The bitcoin wallet contains the public and private key for each of your bitcoin addresses.

A bitcoin private key is a randomly generated secret string (numbers and letters), allowing bitcoins to
be spent. A private key is the starting point for calculating a public key. Every Bitcoin wallet contains
one or more private keys, which are saved in the wallet file. A private key is always mathematically
related to the bitcoin wallet addresses, but is impossible to reverse engineer due to a strong
encryption code base. A private key is also used to generate signatures, and these signatures have a
mathematical connection to the public key. These mathematical connections are what allow you to
lock and unlock bitcoins when making transactions. If you don’t back up your private key and you lose
it, you can no longer access your bitcoin wallet to spend funds. It is important that they are kept
secret and safe. Private keys can be kept on computer files, but are also often written on paper.
Private keys themselves are almost never handled by the user, instead the user will typically be given
a seed phrase that encodes the same information as private keys. Private keys themselves do not
appear publicly in the blockchain. The purpose of a private key is to be kept private, so they should
be stored securely on your computer and only used when generating signatures to unlock bitcoins
which is what a bitcoin wallet does when you make a transaction.

It's used as the source for creating a public key. Never use a private key generated by a website, or
enter your private key into a website. Websites can easily save the private key and use it to steal your
bitcoins. The critical part to generating a private key is to use a reliable source of randomness.

A valid private key is any number between (and including) the following range of numbers where
min(equals): 1 and max(equals):
115792089237316195423570985008687907852837564279074904382605163141518161494336

The default random number functions in programming languages are typically not secure enough for
generating private keys. It is imperative to find functions that generate cryptographically secure
random numbers. For example, the libbitcoin library (specifically the bx seed command line tool)
caused the loss of over $900,000 worth of bitcoin in 2023 due to not using cryptographically secure
random numbers for generating seed phrases.
The only thing stopping someone from stealing you bitcoins is the fact that they cannot guess or
randomly generate the same private key as you. The range of possible private keys (the "key space")
is so inconceivably large that it's effectively impossible for two different people/computers to ever
generate the same private key as long as they have been generated securely. This may seem hard to
believe, but to give you some perspective, there are roughly 2 to the power 256(2 multiplied 256
times) or 10 to the power 77
(100000000000000000000000000000000000000000000000000000000000000000000000000000)
possible private keys, and there are roughly 10 to the power 78
(1000000000000000000000000000000000000000000000000000000000000000000000000000000)
atoms in the universe. So it's like asking two different people to randomly select an atom in the
universe and for both to choose the exact same one. That’s as far as generation goes hence never
reveal a private key and leave it somewhere that someone could access it. It is quite literally the only
way a thief is ever going to find a private key.

Sweeping is the act of transferring funds associated with the private key to a new address.

Some wallets allow private keys to be imported without generating any transactions while other
wallets or services require that the private key be swept. When a private key is swept, a transaction is
broadcast that sends the balance controlled by the private key to a new address in the wallet. Just as
with any other transaction, there is risk of swept transactions to be double-spending.

bitcoind is the daemon, a background service, for Bitcoin Core, which is the full node implementation
of Bitcoin that allows users to interact with the Bitcoin blockchain through a command-line interface or
through its RPC (Remote Procedure Call) API. It's used by developers, miners, and businesses who
require direct interaction with the Bitcoin network. In contrast, bitcoind provides a facility to import a
private key without creating a sweep transaction. This is considered very dangerous, and not
intended to be used even by power users or experts except in very specific cases since there are
associated security risks and no immediate protection. Importing an untrusted private key means any
malicious actor who has had access to the key could use it to steal the funds at any time. Keys
generated offline but then compromised (e.g., through a flawed random number generator) are
similarly at risk. When you sweep a private key, you move the funds to a new, secure address. By not
sweeping, you keep the funds associated with the original key, which might already be exposed.
Importing private keys directly is usually reserved for very specific scenarios, such as recovering
funds from an old wallet or accessing funds where no other recovery option exists. Importing keys
could also lead to the Bitcoins being stolen at any time, from a wallet which has imported an
untrusted or otherwise insecure private key - this can include private keys generated offline and never
seen by someone else.

For cold storage private keys are intended to be generated securely on air-gapped devices or
hardware wallets.

You might also like