<p>The obvious solution would be to require payments to have an OP_RETURN output with an email address encrypted to you. This isn't simple and there isn't a wallet out there that supports something like that, but it's technically feasible.</p>

<p>For the 1 address problem, you can use a deterministic wallet, which can generate as many addresses as you need. You can use BIP47 if you want to get fancy and be able to offer refunds.</p>

<p>I built a web shop example app for Armory a while back that you might want to look at that generates a new address for any transaction. You may want to take a look:</p>

<p><a href="https://github.com/etotheipi/BitcoinArmory/tree/master/webshop" rel="nofollow">https://github.com/etotheipi/BitcoinArmory/tree/master/webshop</a></p>

CC BY-SA 3.0
2016-07-22T22:57:08.197Z
op_return doesnt really work since the data has to be encrypted right? you cant just put in a regular text string in op_return can you?
Patoshi パトシ
CC BY-SA 3.0
2016-07-23T00:43:15.210Z
Anything in the script that comes after op_return is ignored, and therefore can be whatever you like.  Yes, it's bytes, but bytes can represent a string.  It all depends on what is interpreting the data.  The only restriction is the size of the data.
Jestin
CC BY-SA 3.0
2016-07-23T15:43:23.650Z
duckx, you can put whatever string you want into OP_RETURN, including email addresses. The only thing is that's horrible for the privacy of your customers as their email address is now recorded for all to see on the blockchain.
Jimmy Song
CC BY-SA 3.0
2016-07-22T19:56:38.790Z
2016-07-22T19:56:38.790Z
Jimmy Song
<p>I'm building an single page web app, where I need to send the users inputted string (email address) along with their bitcoin payment. Say for example I have a single page web app that issues gift certificate barcodes and accept Bitcoin or altcoins. The problem I'm having is that if the user pays to my static bitcoin address, how do I know where to send the barcode information to? I need some form of contact, in my case it's an email address that the user inputs on to the page. What ways can the user send me their email address?</p>

<p>Some problems I ran into was the static bitcoin address. If multiple people paid to the same bitcoin address, I won't know who to send the barcode to. But if I have 100 pre-generated addresses. And one of them was chosen at random then combined with the email address. It would less likely have a collision of someone paying at the same time to the same btc address. </p>

<p>Now the issues is getting that email+btc address to me to verify the transaction has been completed. </p>

<p>One of the other solutions I came up with was requiring another altcoin that had messaging ability built in. The only 2 I know of is Florincoin and NXT where you can include a message with each transaction. The only issue with this is that it requires the app owner to hold florincoin or nxt (i don't believe you can attach a message in ethereum?). Using shapeshift to convert BTC to one of these coins works, but you cannot attach a message during this shapeshift swap. If shapeshift enabled the ability to also attach a message during their conversion this would technically solve the issue by getting the email address to the app owner. </p>

<p>What are some other solutions that might not require a centralized server to collect this data? Centralized server solutions are okay too if you have a solution.</p>

<nxt><message><webapp><transaction-messaging>
Attaching additional data / text message to a Bitcoin transaction?
Patoshi パトシ
# Attaching additional data / text message to a Bitcoin transaction?

(Asked by: username_0 on 2016-07-22)

I'm building an single page web app, where I need to send the users inputted string (email address) along with their bitcoin payment. Say for example I have a single page web app that issues gift certificate barcodes and accept Bitcoin or altcoins. The problem I'm having is that if the user pays to my static bitcoin address, how do I know where to send the barcode information to? I need some form of contact, in my case it's an email address that the user inputs on to the page. What ways can the user send me their email address?

Some problems I ran into was the static bitcoin address. If multiple people paid to the same bitcoin address, I won't know who to send the barcode to. But if I have 100 pre-generated addresses. And one of them was chosen at random then combined with the email address. It would less likely have a collision of someone paying at the same time to the same btc address.

Now the issues is getting that email+btc address to me to verify the transaction has been completed.

One of the other solutions I came up with was requiring another altcoin that had messaging ability built in. The only 2 I know of is Florincoin and NXT where you can include a message with each transaction. The only issue with this is that it requires the app owner to hold florincoin or nxt (i don't believe you can attach a message in ethereum?). Using shapeshift to convert BTC to one of these coins works, but you cannot attach a message during this shapeshift swap. If shapeshift enabled the ability to also attach a message during their conversion this would technically solve the issue by getting the email address to the app owner.

What are some other solutions that might not require a centralized server to collect this data? Centralized server solutions are okay too if you have a solution.

**Tags:** nxt, message, webapp, transaction-messaging


---

## 1 answers

### Answer by username_1 on 2016-07-22. Score: 1 | Accepted answer

The obvious solution would be to require payments to have an OP\_RETURN output with an email address encrypted to you. This isn't simple and there isn't a wallet out there that supports something like that, but it's technically feasible.

For the 1 address problem, you can use a deterministic wallet, which can generate as many addresses as you need. You can use BIP47 if you want to get fancy and be able to offer refunds.

I built a web shop example app for Armory a while back that you might want to look at that generates a new address for any transaction. You may want to take a look:

<https://github.com/etotheipi/BitcoinArmory/tree/master/webshop>

> **Comments:**
> **username_0**: op_return doesnt really work since the data has to be encrypted right? you cant just put in a regular text string in op_return can you?  
> **username_2**: Anything in the script that comes after op_return is ignored, and therefore can be whatever you like.  Yes, it's bytes, but bytes can represent a string.  It all depends on what is interpreting the data.  The only restriction is the size of the data.  
> **username_1**: duckx, you can put whatever string you want into OP_RETURN, including email addresses. The only thing is that's horrible for the privacy of your customers as their email address is now recorded for all to see on the blockchain.  

---

