<p>I'm the founder of <a href="https://github.com/cryptocoinjs" rel="nofollow">CryptoCoinJS</a> and use the library for my own software. This is probably obvious, when scanning QR codes, check for both. When generating QR codes, for backup I'd just do the address and for payment requests, I'd use the URI scheme.</p>

CC BY-SA 3.0
2014-02-05T05:34:35.860Z
2014-02-05T05:34:35.860Z
JP Richardson
<p>I've met the <a href="http://coinpunk.org/" rel="nofollow">Coinpunk</a> developer last month at a meeting and he was discussing about how hard it was for him to create an entirely HTML5-based bitcoin QR code generator, that would work also on iOS devices. Apparently he was successful.</p>

<p>I'd therefore suggest to look into his project which is open-source: <a href="https://github.com/kyledrake/coinpunk" rel="nofollow">https://github.com/kyledrake/coinpunk</a></p>

CC BY-SA 3.0
2014-02-05T08:04:17.193Z
qrcode.js used in my project internally is open source and works (see Github page for continuous integration status). I'll check Coinpunk too.
Mikko Ohtamaa
CC BY-SA 3.0
2014-02-04T15:39:20.347Z
2014-02-04T15:39:20.347Z
Luca Matteis
<p>I'm adding more info on the matter. </p>

<p>This is a format proposed in <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch02.asciidoc#payment-request-QR" rel="nofollow noreferrer">Chapter2 of Bitcoinbook (How Bitcoin Works)</a></p>

<pre><code>bitcoin:1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA?
amount=0.015&amp;
label=Bob%27s%20Cafe&amp;
message=Purchase%20at%20Bob%27s%20Cafe

Components of the URL

A bitcoin address: "1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA"
The payment amount: "0.015"
A label for the recipient address: "Bob's Cafe"
A description for the payment: "Purchase at Bob's Cafe"
</code></pre>

<p>And I believe it's pretty much the same as <a href="https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki" rel="nofollow noreferrer">BIP21</a>. Thanks for referencing it.</p>

CC BY-SA 4.0
2019-08-29T13:33:46.523Z
2019-08-29T13:33:46.523Z
Gus
<p>I'm working on a Bitcoin project, and what I've seen are:</p>

<ul>
<li>Just the Bitcoin address</li>
<li>A url parameter-like scheme with the format "bitcoin:{plus the bitcoin address}" (no brackets used)</li>
<li>A more elaborate url parameter that includes the amount, like "bitcoin:{bitcoin addr}?amount={the amount}</li>
</ul>

<p>Coinbase uses the last scheme and it is fully recognized by the BlockChain iPhone app, enabling you to request a certain amount of Bitcoin directed to a specific address.</p>

<p>Coinbase uses the (deprecated) Google chart apis and the full querystring they use to build a QR code looks like this: </p>

<pre><code>&lt;img width="300" height="300" alt="Chart?cht=qr&amp;amp;chl=bitcoin%3a1k1yfezde2c37pwdevjnin1yc2qbtly6bk%3famount%3d0" src="https://chart.googleapis.com/chart?cht=qr&amp;amp;chl=bitcoin%3A1K1yfEZde2C37pWDevjnin1yc2qBtLy6bk%3Famount%3D0.01&amp;amp;choe=UTF-8&amp;amp;chs=300x300"&gt;
</code></pre>

<p>If you run that src url through a <a href="http://meyerweb.com/eric/tools/dencoder/">url decoder</a>, you'll find that it requests 0.01 BTC to the address 1K1yfEZde2C37pWDevjnin1yc2qBtLy6bk.  </p>

<p>When you're building a QR code, you don't need to url-encode the data.  Coinbase is only doing so because they have to request the QR code from Google through a url addressing scheme.</p>

<p>I build my QR codes on my own server and display them as images on a web page, and I just use non-encoded data.</p>

CC BY-SA 3.0
2014-02-05T08:05:50.310Z
My project internally uses qrcode.js which can built QR codes on the client-side and claims compatibility down to IE6. Check it out, I highly recommend.
Mikko Ohtamaa
CC BY-SA 3.0
2014-02-05T08:06:49.267Z
Also the eloborate URL parameter is called "Bitcoin URI Scheme" and can be found under proposal BIP 0021.
Mikko Ohtamaa
CC BY-SA 3.0
2014-02-05T18:22:27.460Z
@Mikko, thanks for the pointer to BIP21.  I reviewed that after I posted this response and it helped me understand what I was seeing.
ChrisW
CC BY-SA 3.0
2017-04-30T09:37:50.613Z
BIP0021 does state that "Characters must be URI encoded properly."
alexg
CC BY-SA 4.0
2021-03-22T14:07:38.093Z
"Properly" means according to RFC 3986 section 2; in particular https://tools.ietf.org/html/rfc3986#section-2.4 . Don't just percent-encode characters willy-nilly. Percent-encoding delimiter characters that are meant as delimiters is incorrect.
Daira-Emma Hopwood
CC BY-SA 3.0
2014-02-04T18:16:24.423Z
2014-02-04T18:26:20.103Z
2014-02-04T18:26:20.103Z
ChrisW
<p>I am the author of <a href="http://miohtama.github.com/bitcoinaddress.js/" rel="noreferrer">bitcoinaddress.js</a> library and I am wondering what's the best content for Bitcoin QR codes.</p>

<p>What Bitcoin QR codes should contain (for mobile wallet apps and other barcode scanners):</p>

<ul>
<li><p>Only Bitcoin address (this is only one I have seen wild myself)</p></li>
<li><p>Bitcoin URI scheme link (BIP 21) with payment amount, transaction note, etc.</p></li>
</ul>

<p>Currently I implemented address only, as I don't know how well-spread BIP 21 support is among the mobile phones and mobile wallets. If anyone can give me some answers and pointers to the prior research regarding the matter I'd be grateful.</p>

<address><qrcode>
Bitcoin QR codes: raw address or Bitcoin URI scheme
Mikko Ohtamaa
# Bitcoin QR codes: raw address or Bitcoin URI scheme

(Asked by: username_0 on 2014-02-04)

I am the author of [bitcoinaddress.js](http://miohtama.github.com/bitcoinaddress.js/) library and I am wondering what's the best content for Bitcoin QR codes.

What Bitcoin QR codes should contain (for mobile wallet apps and other barcode scanners):

* Only Bitcoin address (this is only one I have seen wild myself)
* Bitcoin URI scheme link (BIP 21) with payment amount, transaction note, etc.

Currently I implemented address only, as I don't know how well-spread BIP 21 support is among the mobile phones and mobile wallets. If anyone can give me some answers and pointers to the prior research regarding the matter I'd be grateful.

**Tags:** address, qrcode


---

## 4 answers

### Answer by username_4 on 2014-02-04. Score: 10 | Accepted answer

I'm working on a Bitcoin project, and what I've seen are:

* Just the Bitcoin address
* A url parameter-like scheme with the format "bitcoin:{plus the bitcoin address}" (no brackets used)
* A more elaborate url parameter that includes the amount, like "bitcoin:{bitcoin addr}?amount={the amount}

Coinbase uses the last scheme and it is fully recognized by the BlockChain iPhone app, enabling you to request a certain amount of Bitcoin directed to a specific address.

Coinbase uses the (deprecated) Google chart apis and the full querystring they use to build a QR code looks like this:

```
<img width="300" height="300" alt="Chart?cht=qr&amp;chl=bitcoin%3a1k1yfezde2c37pwdevjnin1yc2qbtly6bk%3famount%3d0" src="https://chart.googleapis.com/chart?cht=qr&amp;chl=bitcoin%3A1K1yfEZde2C37pWDevjnin1yc2qBtLy6bk%3Famount%3D0.01&amp;choe=UTF-8&amp;chs=300x300">

```

If you run that src url through a [url decoder](http://meyerweb.com/eric/tools/dencoder/), you'll find that it requests 0.01 BTC to the address 1K1yfEZde2C37pWDevjnin1yc2qBtLy6bk.

When you're building a QR code, you don't need to url-encode the data. Coinbase is only doing so because they have to request the QR code from Google through a url addressing scheme.

I build my QR codes on my own server and display them as images on a web page, and I just use non-encoded data.

> **Comments:**
> **username_0**: My project internally uses qrcode.js which can built QR codes on the client-side and claims compatibility down to IE6. Check it out, I highly recommend.  
> **username_0**: Also the eloborate URL parameter is called "Bitcoin URI Scheme" and can be found under proposal BIP 0021.  
> **username_4**: @username_0, thanks for the pointer to BIP21.  I reviewed that after I posted this response and it helped me understand what I was seeing.  
> **username_5**: BIP0021 does state that "Characters must be URI encoded properly."  
> **username_6**: "Properly" means according to RFC 3986 section 2; in particular https://tools.ietf.org/html/rfc3986#section-2.4 . Don't just percent-encode characters willy-nilly. Percent-encoding delimiter characters that are meant as delimiters is incorrect.  

---

### Answer by username_1 on 2014-02-05. Score: 3

I'm the founder of [CryptoCoinJS](https://github.com/cryptocoinjs) and use the library for my own software. This is probably obvious, when scanning QR codes, check for both. When generating QR codes, for backup I'd just do the address and for payment requests, I'd use the URI scheme.


---

### Answer by username_2 on 2014-02-04. Score: 1

I've met the [Coinpunk](http://coinpunk.org/) developer last month at a meeting and he was discussing about how hard it was for him to create an entirely HTML5-based bitcoin QR code generator, that would work also on iOS devices. Apparently he was successful.

I'd therefore suggest to look into his project which is open-source: <https://github.com/kyledrake/coinpunk>

> **Comments:**
> **username_0**: qrcode.js used in my project internally is open source and works (see Github page for continuous integration status). I'll check Coinpunk too.  

---

### Answer by username_3 on 2019-08-29. Score: 1

I'm adding more info on the matter.

This is a format proposed in [Chapter2 of Bitcoinbook (How Bitcoin Works)](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch02.asciidoc#payment-request-QR)

```
bitcoin:1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA?
amount=0.015&
label=Bob%27s%20Cafe&
message=Purchase%20at%20Bob%27s%20Cafe

Components of the URL

A bitcoin address: "1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA"
The payment amount: "0.015"
A label for the recipient address: "Bob's Cafe"
A description for the payment: "Purchase at Bob's Cafe"

```

And I believe it's pretty much the same as [BIP21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki). Thanks for referencing it.


---

