3

From https://en.bitcoin.it/wiki/Address:

A Bitcoin address, or simply address, is an identifier of 27-34 alphanumeric characters, beginning with the number 1 or 3, that represents a possible destination for a Bitcoin payment.

Is any random address I create following the above rules going to be an address I can sucesfully send Bitcoin to?

For example if I randomly generate these addresses:

  • 1AAAAAAAAAAAAAAAAAAAAAAAAAA
  • 3111111111111111111111111111111111
  • 2FWIOHFEWNFEOWEFHO34234242244EFDE

Are these all valid addresses I can always send Bitcoin payments to? Or do they have to already 'exist' in some capacity?

4

Addresses are randomly generated starting from a private key. The private key is the only truly random value in a whole chain of interesting values. These values are then mathematically derived from the private key. On the other end of the chain of values is the address.

Now if you could simply pick an address and recover the private key that, when passing it through the address derivation mechanism, gives you that address we would be in a lot of trouble. People could simply listen to transactions on the network, extract the receiving address, reconstruct the private key and spend the funds, even if they were not the intended recipient. So at this point it should be clear that simply picking an address and go ahead from there is not possible, in other words some of the functions in the chain are non-reversible.

So starting from the private key, we construct a public key. Already this first step is non-reversible, otherwise public-key cryptosystems would stop working. It should be computationally unfeasible to recover the private key from the public key. Bitcoin further goes ahead and hashes the public key twice. This step is non-reversible as well.

The first character of the address depends on the address version and may not be freely chosen. Then there is the matter of the Base58 encoding, which unlike the other mechanisms is reversible.

Finally the last few characters in the address are a checksum which is again calculated as a double hash of the already hashed public key. So for these last characters there is simply no way of "choosing" them so that the address looks a certain way.

So to answer your question: no, you cannot simply pick an Address that looks nice and use it as yours. That's also the reason why tools like vanitygen exist: they simply pick a random private key, transform it until they get an address and then check whether it has the desired features, e.g., your name in it. The more restrictive you are with what you want your address to look like, the harder it gets to find one that does. This difficulty increases exponentially, hence the term computationally unfeasible above.

  • > So to answer your question: no, you cannot simply pick an Address that looks nice and use it as yours Not quite what I'm asking, I'm asking if I can send BTC to these addresses – Tom Gullen Oct 31 '13 at 15:05
  • There are people sending very small amounts of satoshis to store file checksums, to be able to prove that the file existed at a certain date. proofofexistence.com – Jonas Oestman Oct 31 '13 at 15:33
  • 1
    Ah, my mistake I thought you were asking whether you can use these addresses to receive bitcoins. If you simply want to send them, you can do so to arbitrary addresses (as long as they have a valid version byte and a matching checksum). – cdecker Oct 31 '13 at 15:40
0

An "address" in bitcoin is composed in binary form of:

[1 prefix byte] + [20 bytes of ~public key] + [4 checksum bytes] = 25 bytes

This binary form is then converted to base 58, with 58 characters valid to write it (letters and numbers, except "0, O, I, l" which are confusing). That results in the 26-35 string of characters that is commonly used.

The prefix fixes the "1" or "3" character (P2PKH, P2SH), and the last 4 bytes are calculated from the previous 21 bytes.

So those 20 bytes in the middle could be chosen randomly.

But if those 20 bytes were random the private key would be unknown, and so funds transferred to that "address" would be irrecoverable. The correct process is to choose a private random key, derivate the public from it, and then fill those 20 bytes.

So, the reasons why a random combination of 26-35 letters and numbers won't result in a valid bitcoin address, even if it starts with "1" or "3" and "0, O, I, l" are not present:

  • when passed to binary, the number of bytes obtained may not be 25 exactly.
  • if it mapped to 25 bytes, checksum won't validate the previous 21 bytes.

As for the last question, any address with those 20 middle bytes generated randomly and the checksum and prefix correct, is valid. It will have a zero amount of bitcoins available when checked for the first time (for example at https://blockchain.info), and any funds transferred to it will be received. There's no previous requirement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.