Library to parse and generate Bitcoin payments URI.
Latest commit 0c2f6a4 Aug 2, 2016 @SandroMachado Fix indentation


Release Build Status

BitcoinPaymentURI is an open source library to handle the Bitcoin payment URI based on the BIT 21. The purpose of this library is to provide a simpler way to the developers to integrate in their applications support for this URI Scheme to easily make payments.

Gradle Dependency


First, add the following to your app's build.gradle file:

repositories {
    maven { url "" }

Them include the openalpr-android dependency:

dependencies {

    // ... other dependencies here.     
    compile 'com.github.SandroMachado:BitcoinPaymentURI:1.0.3'



Parse the URI bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=50&label=Luke-Jr&message=Donation%20for%20project%20xyz.

BitcoinPaymentURI bitcoinPaymentURI = BitcoinPaymentURI.parse("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=50&label=Luke-Jr&message=Donation%20for%20project%20xyz");

bitcoinPaymentURI.getAddress(); \\ 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W
bitcoinPaymentURI.getAmount(); \\ 50
bitcoinPaymentURI.getLabel(); \\ "Luke-Jr"
bitcoinPaymentURI.getMessage(); \\ "Donation for project xyz"
bitcoinPaymentURI.getParameters().size(); \\ 0

Generate the following URI bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Donation%20for%20project%20xyz&amount=50.0&req-fiz=biz&foo=bar&label=Luke-Jr

BitcoinPaymentURI bitcoinPaymentURI = new BitcoinPaymentURI.Builder()
    .message("Donation for project xyz")
    .parameter("foo", "bar")
    .requiredParameter("fiz", "biz")