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

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

CC BY-SA 4.0
2019-03-16T02:48:25.890Z
2019-03-16T02:48:25.890Z
nick carraway
<p>I would like to know if a bitcoin burn address can be tied to a string. This question is not about <code>OP_RETURN</code> or other ways of embedding into a blockchain. </p>

<p>Here's the processes that I went through:</p>

<ul>
<li>Create a 21-byte string (aaaaaaaaaaaaaaaaaaaaa)</li>
<li>Convert this string to hex here: <a href="http://string-functions.com/string-hex.aspx" rel="nofollow noreferrer">http://string-functions.com/string-hex.aspx</a>. I get: 616161616161616161616161616161616161616161</li>
<li>Take the SHA256 of it here twice: <a href="http://extranet.cryptomathic.com/hashcalc/index" rel="nofollow noreferrer">http://extranet.cryptomathic.com/hashcalc/index</a> Get the first four bytes: 7df8e299</li>
<li>Now I have a hex string: 7df8e299616161616161616161616161616161616161616161. I convert it using a hex to base58 encoder: <a href="https://incoherency.co.uk/base58/" rel="nofollow noreferrer">https://incoherency.co.uk/base58/</a></li>
<li>Finally I get this string: sgwP7Xqw3GWATXNF9TW3RyDG16vbzTgRHA. Which I plug into the bitcoin address cheker: <a href="http://lenschulwitz.com/base58" rel="nofollow noreferrer">http://lenschulwitz.com/base58</a>. </li>
<li>The error that I get is <code>Invalid Bitcoin address! Bad SHA-256 checksum!</code></li>
</ul>

<p>Where did I go wrong?</p>

CC BY-SA 4.0
2019-03-16T02:55:53.097Z
May I ask why you would want to do this? You can have an address that commits to a string without burning money.
Pieter Wuille
CC BY-SA 4.0
2019-03-16T03:02:12.230Z
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
CC BY-SA 4.0
2019-03-16T03:17:12.033Z
Nick, 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
CC BY-SA 4.0
2019-03-16T03:24:59.147Z
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
CC BY-SA 4.0
2019-03-16T04:44:35.503Z
@nick carraway: spending 0-value outputs is legal. Full nodes have no choice but to keep such outputs in their UTXO set.
Pieter Wuille
CC BY-SA 4.0
2019-03-16T17:58:53.527Z
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
CC BY-SA 4.0
2019-03-30T19:17:53.037Z
@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
CC BY-SA 4.0
2019-03-30T20:04:41.340Z
@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
<address><address-generation><vanity-address>
How to encode a string into a bitcoin address? (Not a brain-wallet, an address, like a vanity-address)
nick carraway
# How to encode a string into a bitcoin address? (Not a brain-wallet, an address, like a vanity-address)

(Asked by: username_0 on 2019-03-15)

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:

* Create a 21-byte string (aaaaaaaaaaaaaaaaaaaaa)
* Convert this string to hex here: <http://string-functions.com/string-hex.aspx>. I get: 616161616161616161616161616161616161616161
* Take the SHA256 of it here twice: <http://extranet.cryptomathic.com/hashcalc/index> Get the first four bytes: 7df8e299
* Now I have a hex string: 7df8e299616161616161616161616161616161616161616161. I convert it using a hex to base58 encoder: <https://incoherency.co.uk/base58/>
* Finally I get this string: sgwP7Xqw3GWATXNF9TW3RyDG16vbzTgRHA. Which I plug into the bitcoin address cheker: <http://lenschulwitz.com/base58>.
* The error that I get is `Invalid Bitcoin address! Bad SHA-256 checksum!`

Where did I go wrong?

**Tags:** address, address-generation, vanity-address

> **Comments:**
> **username_1**: May I ask why you would want to do this? You can have an address that commits to a string without burning money.  
> **username_0**: Sure username_1 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.  
> **username_2**: username_0, 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)  
> **username_0**: 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.  
> **username_1**: @username_0: spending 0-value outputs is legal. Full nodes have no choice but to keep such outputs in their UTXO set.  
> **username_0**: 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.  
> **username_0**: @username_1, you mentioned that spending 0-value outputs is legal, which is true. But generating 0-value outputs is not allowed through Core?  
> **username_1**: @username_0 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.  

---

## 1 answers

### Answer by username_0 on 2019-03-16. Score: 1 | Accepted answer

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.


---

