How to encode a string into a bitcoin address? (Not a brain-wallet, an address, like a vanity-address)

-1

I would like to know if a bitcoin burn address can be tied to a string. This question is not about OP_RETURN or other ways of embedding into a blockchain.

Here's the processes that I went through:

Where did I go wrong?

nick carraway

Posted 2019-03-15T22:44:11.857

Reputation: 215

2May I ask why you would want to do this? You can have an address that commits to a string without burning money.Pieter Wuille 2019-03-16T02:55:53.097

Sure Pieter big fan of your work. Omni transactions take up the OP_RETURN call. So if you want a cross-platform proof-of-burn token, that also puts data into the chain, you have to add tx outputs to stringified addresses.nick carraway 2019-03-16T03:02:12.230

1Nick, creating unspendable outputs is harmful to the Bitcoin system because it perpetually burdens nodes to carry around state relating to these coins, you should avoid doing this. If you adopt practices like this commercially and at scale, over the long run it may cause Bitcoin users to adopt countermeasures that block your activity. (and this sort of thing is eminently blockable at the cost of making addresses quite a big longer)G. Maxwell 2019-03-16T03:17:12.033

I will try and do it with only 0 Satoshi outputs (as part of a larger tx with more outputs). This should protect the UTXO pool. Nodes should not be holding 0 Satoshi outputs for any reason whatsoever. As far as blockchain "bloat" goes, I'm paying the fee for permanent graffiti, and it won't be very many transactions.nick carraway 2019-03-16T03:24:59.147

1@nick carraway: spending 0-value outputs is legal. Full nodes have no choice but to keep such outputs in their UTXO set.Pieter Wuille 2019-03-16T04:44:35.503

Aight well then i can try and create a new address version number for burning (to label the addresses used by my protocol) but i dont know if a node will accept it. If nodes start banning my non compliant version numbers i will just disguise them as traditional addresses.nick carraway 2019-03-16T17:58:53.527

@PieterWuille, you mentioned that spending 0-value outputs is legal, which is true. But generating 0-value outputs is not allowed through Core?nick carraway 2019-03-30T19:17:53.037

1@nickcarraway The consensus rules allow it. There are policies around the creation of dust limits, but those don't alleviate the need to keep such outputs around if they're created in a block, as validity of future blocks may depend on them.Pieter Wuille 2019-03-30T20:04:41.340

Answers

0

I had a couple errors. The first byte of aaaaaaaaaaaaaaaaaaaaa should be a version number, which can be 0. 0aaaaaaaaaaaaaaaaaaaa. The hash is appended to the end of the string, not the beginning.

  1. Select a version number: 0
  2. Append a 20-byte string (0aaaabbbbccccddddeeee)
  3. Convert the 21-byte string to hex: 306161616162626262636363636464646465656565
  4. Using a hex-compatible SHA256 (like in the link above), hash the hex string from 3 twice, then take the first 4 bytes. 27ac3662 (in hex, 2 letters = 1 byte)
  5. Append those 4 bytes to END of the 21-byte hex string: 30616161616262626263636363646464646565656527ac3662
  6. Convert the hex to base58 using an encoder: LU6rTvpr7C1AEpQLGwJP5xq7FBthTXAAqw.
  7. Check in the bitcoin validator link above. should be working.

nick carraway

Posted 2019-03-15T22:44:11.857

Reputation: 215