1

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.

1 Answer 1

1

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

3
  • 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? Jul 22, 2016 at 22:57
  • 1
    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
    Jul 23, 2016 at 0:43
  • 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.
    – Jimmy Song
    Jul 23, 2016 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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