10

Suppose I wanted to have a bitcoin treasure hunt, where QR codes were used. The first person who scanned a given QR code should receive some preset amount of bitcoins. Is this possible? (Preferably with as little need for knowledge on the part of the recipient as possible.) As a bonus, is it possible to have a single QR code to have a "pool" of 5 bitcoins it is attached to, give 1 bitcoin away per scan, but only allow scanning by unique devices. (ie; so 1 QR code could be used to claim 1 bitcoin for 5 unique devices) or easiest just to create 5 QR codes? Essentially the same functionality as the "send to QR code" in the Android client, only in reverse - (Scan QR code, and receive coins)

2 Answers 2

8

The easiest way to do this is to have the QR code be a URL. For example, http://www.example.com/bitcoingiveaway/E34IKJ. Just assign a unique code to each location, the E34IKJ in my example.

What that web page does is up to you. It has to track how many times it has been accessed, of course. The first time, it can send a form that allows a person to fill in some kind of identifier, which can be a Bitcoin address. You then send them the coins (or if using some kind of account, credit their account).

Making this work without the scanners having Internet access is much trickier. It can be done, but it would require your to control the scanning devices such that they included a time stamp, and there would be no way to reliably inform people whether they were first right at the point of scan.

Another possibility for the "first come, get coins" model is to have the QR code be the actual private key used to claim the Bitcoins.

3
  • I would prefer the latter (have QR code somehow be actual private key used to claim the bitcoins). However, ideally it would not require any manual steps of behalf of participants other than scanning the code with their client on either iOS or Android. Maybe we aren't there yet with the clients...but would be nice to be able to use QR codes for a one step receipt of bitcoins rather than just a one step send. Commented Sep 13, 2011 at 17:51
  • Then probably the best solution is to have the QR code be the private key, but also offer a web page where people can enter a private key and their Bitcoin address to have the balance transferred. Commented Sep 13, 2011 at 17:54
  • Depending on your knowledge level / abilities it may also be possible to grab one of the open-source Android clients and modify it to allow private key import via QR code scan. Commented Sep 13, 2011 at 17:57
1

QR codes are completely passive. They do not collect any information about the devices used to scan it.

If you want to set this up using only the Bitcoin network, you can create QR codes with private keys of Bitcoin addresses. The device used to scan the code should be able to import the private key and send its bitcoins to another address chosen by the user. The user should destroy the QR code afterwards to avoid stealing attempts by other users.

Having a "pool" of bitcoins in a QR code is not possible in this scenario.


Since mobile clients currently can not import private keys, another easy way to do this would be with Instawallet. People would scan an Instawallet QR code, open the url, type in their address and cash out the bitcoins.
But again, this solution does not allow for a bitcoin "pool". If you really want that feature you should design a dedicated website, like David Schwartz suggested in his answer.

3
  • I suppose I should have been more clear and asked, is there any mobile client that would support the following scenario using QR codes. Not the codes themselves. Commented Sep 13, 2011 at 18:01
  • @lemonginger It shouldn't be hard to implement, but I don't know of any mobile client that currently supports this.
    – nmat
    Commented Sep 13, 2011 at 18:06
  • @lemonginger As an alternative, you could encode an Instawallet URL.
    – nmat
    Commented Sep 13, 2011 at 20:21

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