<p>The <a href="https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/uri/BitcoinURI.java" rel="nofollow noreferrer">source file for that method is here</a>  </p>

<p><a href="https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki" rel="nofollow noreferrer">BIP21 wiki</a></p>

<p>Method can be accessed like this  </p>

<pre><code> String bitcoinURI = BitcoinURI.convertToBitcoinURI(String address, Coin amount, String label, String message);
</code></pre>

CC BY-SA 3.0
2017-12-20T18:55:22.563Z
2017-12-20T19:04:40.040Z
2017-12-20T19:04:40.040Z
Chak
<p>i am trying to convert the </p>

<blockquote>
  <p>URI into BIP21</p>
</blockquote>

<p>currently i am generating <strong>URI from bitcoinj</strong> library, but i want it to be on <strong>BIP21</strong> Standard. i have read many articles but didn't found any solution</p>

CC BY-SA 3.0
2017-12-19T19:27:42.210Z
Do you have an example of an URI generated by bitcoinj lib?
Chak
CC BY-SA 3.0
2017-12-19T21:55:56.920Z
yes here: "mqe8V3Vrp77JKYG2tfnQ6P8wpN4YVZ84V2"
Zombie
CC BY-SA 3.0
2017-12-19T22:01:19.467Z
Have you tried convertToBitcoinURI(String address, Coin amount, String label, String message) or convertToBitcoinURI(Address address, Coin amount, String label, String message) ? or https://github.com/bitcoinjs/bip21
Chak
CC BY-SA 3.0
2017-12-19T22:10:41.093Z
no i didn't try this...
Zombie
CC BY-SA 3.0
2017-12-20T11:14:05.913Z
yes i try this but didn't work for me
Zombie
CC BY-SA 3.0
2017-12-20T15:00:04.033Z
Did you get an error or something else?
Chak
CC BY-SA 3.0
2017-12-20T17:43:52.493Z
well, i couldn't access the convertToBitcoinURI
Zombie
CC BY-SA 3.0
2017-12-20T17:44:33.883Z
This is how i am generating URI                                                                     
        // Derive address
        mAddress = mECKey.toAddress(mParams);
Zombie
CC BY-SA 3.0
2017-12-20T18:28:34.073Z
Ohh I forgot, you have access the method in BitcoinURI , so like that ......................................................            String bitcoinURI = BitcoinURI.convertToBitcoinURI(String address, Coin amount, String label, String message)
Chak
CC BY-SA 3.0
2017-12-20T18:33:49.153Z
did this generate BIP21 URI for me?
Zombie
CC BY-SA 3.0
2017-12-20T18:46:28.380Z
bitcoin:mqe8V3Vrp77YMZG2tfnQ6P8wpN4YVZ84V2?amount=0.000001&label=bla&message=So%20this%20is%20it%21%20hmm...This is i got when i print
Zombie
CC BY-SA 3.0
2017-12-20T18:46:37.237Z
That is bip21...???
Zombie
CC BY-SA 3.0
2017-12-20T18:55:32.917Z
Seems fine to me
Chak
<bitcoinj><java><bip21-uri>
how to convert URI into Bip21
Zombie
# how to convert URI into Bip21

(Asked by: username_0 on 2017-12-19)

i am trying to convert the

> URI into BIP21

currently i am generating **URI from bitcoinj** library, but i want it to be on **BIP21** Standard. i have read many articles but didn't found any solution

**Tags:** bitcoinj, java, bip21-uri

> **Comments:**
> **username_1**: Do you have an example of an URI generated by bitcoinj lib?  
> **username_0**: yes here: "mqe8V3Vrp77JKYG2tfnQ6P8wpN4YVZ84V2"  
> **username_1**: Have you tried convertToBitcoinURI(String address, Coin amount, String label, String message) or convertToBitcoinURI(Address address, Coin amount, String label, String message) ? or https://github.com/bitcoinjs/bip21  
> **username_0**: no i didn't try this...  
> **username_0**: yes i try this but didn't work for me  
> **username_1**: Did you get an error or something else?  
> **username_0**: well, i couldn't access the convertToBitcoinURI  
> **username_0**: This is how i am generating URI                                                                              // Derive address         mAddress = mECKey.toAddress(mParams);  
> **username_1**: Ohh I forgot, you have access the method in BitcoinURI , so like that ......................................................            String bitcoinURI = BitcoinURI.convertToBitcoinURI(String address, Coin amount, String label, String message)  
> **username_0**: did this generate BIP21 URI for me?  
> **username_0**: bitcoin:mqe8V3Vrp77YMZG2tfnQ6P8wpN4YVZ84V2?amount=0.000001&label=bla&message=So%20this%20is%20it%21%20hmm...This is i got when i print  
> **username_0**: That is bip21...???  
> **username_1**: Seems fine to me  

---

## 1 answers

### Answer by username_1 on 2017-12-20. Score: 0 | Accepted answer

The [source file for that method is here](https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/uri/BitcoinURI.java)

[BIP21 wiki](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki)

Method can be accessed like this

```
 String bitcoinURI = BitcoinURI.convertToBitcoinURI(String address, Coin amount, String label, String message);

```


---

