Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
61

A compressed key is just a way of storing a public key in fewer bytes (33 instead of 65). There are no compatibility or security issues because they are precisely the same keys, just stored in a different way. The original Bitcoin software didn't use compressed keys only because their use was poorly documented in OpenSSL. They have no disadvantages other ...


42

To export a private key from your Satoshi bitcoin-qt client: launch your bitcoin client as usual and wait for it to load the blockchain and start up click on 'help' in the menu bar (top right) click on 'debug window' select the 'console' tab type: walletpassphrase "your walletpassphrase here" 600 type: dumpprivkey [your Bitcoin address here] this will ...


39

Run Bitcoin-Core Select Help (to the right of Settings) Select Debug Window Select Console If you encrypted your wallet, unlock it by entering walletpassphrase "YourLongPassphrase" 600 next to the > input box Next to the > input box type importprivkey <bitcoinprivkey> (Note that the private key must not have spaces, remove them if they are included in ...


27

As is normal when doing Elliptic Curve encryption, a private key is simply a random number. In the case of secp256k1, the elliptic curve used by Bitcoin, it has to be a number between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494336 (or in hexadecimal, between 0x1 and 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B ...


27

Essentially, a hardened child key is is computed with hash(parent private key + index), whereas a non-hardened child key is computed with hash(parent public key + index). So what practical consequences does this have? With an extended public key, you can derive non-hardened child public keys. This is useful in situations where you want to accept payments ...


23

Thomas' answer is correct, but I think an easy version may be appreciated as well. I suppose you know the concept of public key cryptography? If you don't, here is a very short explanation (or read the wikipedia page): Public key cryptography (as used in Bitcoin), allows you to hand people a public key and use the corresponding private key to prove the ...


22

There's a lot of confusion here, mostly bits and pieces of the whole scheme that is Hierarchical Deterministic derivation, and finally two questions that seem to indicate missing some point about it. The answer to the first question is No. The second question is more interesting : Let's start from extended keys, specifically BIP32 keys. Like private keys ...


19

It gets it from the keypool, which has 100 pre-generated addresses by default. The next time you enter your passphrase, it will refill the pool with new addresses. Here's an example that shows the pool running out, and refilling when the password is supplied. The following commands were performed by a trained professional. Please don't try this at home (...


19

Yes, this is possible. However, I want to upfront state that this is not advisable for multiple reasons: Bitcoin keys are intended to be single use for privacy reasons, and leveraging them for encryption unnecessarily encourages treating them as a long-lived identity. There may be ugly and dangerous interactions when keys are used for multiple protocols ...


18

What you are requesting is described as computing the Wallet Import Format for that private key: http://en.bitcoin.it/wiki/Wallet_import_format Using your example: 1.) Take a private key (Below is the HEX representation of binary value) 7542FB6685F9FD8F37D56FAF62F0BB4563684A51539E4B26F0840DB361E0027C 2.) Add a 0x80 byte in front of it ...


18

Importing a private key can lead to non-intuitive behaviour, and that can be exploited by an attacker. Imagine I'm evil. I give you a paper wallet with 1 mBTC on it. You're happy and import it. I keep the private key and wait. Depending on the client/user, maybe someday you'll put some real money on there as change/received funds. Then I can swipe them ...


18

With HD wallets, a single key can be used to generate an entire tree of key pairs. This single key serves as the "root" of the tree. The word seed is simply a more human-readable way of expressing the key used as the root, as it can be algorithmically converted into the root private key. Those words, in that order, will always generate the exact same key. ...


16

Format (private keys): uncompressed: 0x80 + [32-byte secret] + [4 bytes of Hash() of previous 33 bytes], base58 encoded compressed: 0x80 + [32-byte secret] + 0x01 + [4 bytes of Hash() previous 34 bytes], base58 encoded case 1: secret (hex): 1111111111111111111111111111111111111111111111111111111111111111 uncompressed: secret (base58): ...


15

Bitcoin private keys are 32 bytes, but are often stored in their full OpenSSL-serialized form of 279 bytes. They are serialized as 51 base58 characters, or 64 hex characters. Bitcoin public keys (traditionally) are 65 bytes (the first of which is 0x04). They are typically encoded as 130 hex characters. Bitcoin compressed public keys (as of 0.6.0) are 33 ...


14

Note: Recent versions of the satoshi client offer a 'debug window' which can be used to export private keys. This is described in Miguel Moreno's answer to this question, and is easier than the steps I describe below. To export a private key from your satoshi client: run: bitcoin-qt -server and wait for it to load the blockchain and start up if your ...


14

I started implementing BIP32 for the reference client myself, but as there were more urgent matters to deal with, I have temporarily stopped working on it. I certainly plan to complete this, but I can't give any target date or version right now. As far as I know from Alan Reiner (Armory's developer), he plans to switch to BIP32 as soon as the reference ...


14

Key import by itself (from a trusted source of keys, such as your own cold storage or backups) isn't a dangerous thing. However, the vast number of ways one can cause problems for themselves through key import leads to these warnings. Many such warnings appear to address more complex situations beyond bitcoind's scope. In this case, there can be many ...


14

"Improbable" is an understatement. There are 2256 possible keys. In the entire universe, there are estimated to be "only" 2100 atoms. So the odds of someone else ending up with the exact same address/key as you is far, far less than the same atom, out of the entire universe, being randomly picked twice. If you are worried about an address collision, here ...


13

There are three main types of wallets: non-deterministic (random) wallets sequential deterministic wallets hierarchical deterministic wallets With a non-deterministic (random) wallet, all the private/public keypairs are generated randomly. The wallet may generate 100 random private keys as soon as it is initialized, for example. With a sequential ...


12

From a cryptographic point of view, there is just one type of private keys and one type of public keys. A private key is an integer in the range 1 to 115792089210356248762697446949407573529996955224135760342422259061068512044368, a public key is a point on the elliptic curve secp256k1. No magic here. The problem is that Bitcoin uses addresses, and addresses ...


12

Yes, all three assumptions are correct. You can with some effort keep your private keys offline for their entire life. A description of how to sign transactions offline is found here: How to sign a transaction using only an offline computer? Adding a bit of detail on Assumption 3 along the lines of Tim S.'s comment: A computer that is offline would ...


11

A wallet can be as simple as just a private key by itself even as software that has access to that can derive the public address from it. So yes, that data alone can be considered a bitcoin wallet. But you asked if that is all you need to send and receive so for that you will need software that uses the private key to spend the funds. Sometimes the term "...


11

Both of the keys are a part of the Elliptic Curve Digital Signature Algorithm. A private key is just a random number, while the public key is a 2D point coordinate on an Elliptic Curve derived from it. The private key is used to sign messages (in case of Bitcoin - the transactions), and the public key is used to check whether the signature is correct. The ...


10

However, what happens when my generated private key matches a private key that is already used? Then you got lucky, and can spend someone else's coins. Does the protocol reject private keys if they are already used? No, how should it? Keys can be used more than once in normal operation. Fortunately, it is extremely unlikely that this ever happens. See ...


10

The public and private keys in a Bitcoin address are a normal ECDSA key pair. I haven't poked through this particular bit of Bitcoin's own code but the offshoot products I've had a chance to work with typically use the Bouncy Castle crypto library. Bouncy Castle also has an excellent introduction/tutorial on how to use their library. Their examples are in ...


10

You can sign any text with the private key you own and anyone can verify that with a public key associated with a given Bitcoin address. As long as you make the message relevant to the conversation, say "This is LethalFractal, at 2013-09-07, I claim ownership of address 1234567890... as a proof for negotiations with John Smith", the person can know that it ...


10

There's two types of wallet. A conventional wallet is just a collection of random keys, Bitcoin-QT and Multibit fit into this category. A Hierarchical Deterministic like Electrum or Armory generate all the keys in the wallet from a single key, so that one backup is permanently associated with a wallet no mater how many new addresses and change addresses are ...


10

Bitcoin uses the secp256k1 elliptic curve with 256 bit private/public key pair cryptography to render ECDSA functionality. The two bitcoin explorer (bx) commands below replicate statements/results in the site references above. Note the private key is a 256-bit hexadecimal encoded number. % echo "...


10

The wallet.dat was created with Bitcoin Core (in 2011 it was called "Bitcoin"). You should install the newest version of Bitcoin-Core (0.14.2 by the time of writing). The wallet.dat from 2011 should still run. Use the GUI. If you want to export the private key, you don't need to sync (takes a couple of hours / days) Can also be done on a different ...


9

The simplest and most common way of doing this is to do SHA256(passphrase) and to use the result as your private key. You can e.g. use the "Brain wallet" tab on www.bitaddress.org which is all javascript so that you can download it and do everything offline for increased security. Be aware though that your pass phrase must be really long and truly unique ...


Only top voted, non community-wiki answers of a minimum length are eligible