Meshbits / pirate-chain-ios-wallet

iOS version of the Pirate Wallet
MIT License
3 stars 2 forks source link

Pop this iOS wallet if clicked on payment link using ARRR URI #4

Closed satindergrewal closed 3 years ago

satindergrewal commented 3 years ago

Add the URI handling, that is so we can get a bitpay like payments system where users click to buy on a website and it pops open the wallet to a payment confirmation screen.

Will have more better details soon on this task.

While I collect more detail information form other developers and team, have a look at this Bitcoin's standard URI scheme: https://developer.bitcoin.org/devguide/payment_processing.html

Bitcoin proposes URI like this:

bitcoin:mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN\
?amount=0.10\
&label=Example+Merchant\
&message=Order+of+flowers+%26+chocolates

And for Pirate Chain we can possibly use URI like this:

arrr:zs1j8kz2pkfdmwatkufwlu0e9kkvxmk7g6k78ymld53tg20q8php4s9d26s5jk53f85qxvm6v046em
?amount=0.10\
&label=Example+Merchant\
&message=Order+of+flowers+%26+chocolates

Where the label and message can be input in the MEMO field while making a transaction. iOS wallet allows inputting an optional MEMO text, and we can utilise that for the URI data storage.

satindergrewal commented 3 years ago

This Bitcoin Improvement Protocol BIP-0021 is good link to understand the Bitcoin specific URI standard. And it also has links to other relevant implementations of this URI scheme.

Here's link to the Swift URI scheme for Bitcoin, which as I browsed through and understand, can easily be adapted for Pirate Chain: BitcoinPaymentURISwift

lastw0nd3r commented 3 years ago

Here is the format used - arrr://zs1j8kz2pkfdmwatkufwlu0e9kkvxmk7g6k78ymld53tg20q8php4s9d26s5jk53f85qxvm6v046em?amount=0.0001&label=Example+Merchant&message=Order%20of%20flowers%20%26%20chocolates

lastw0nd3r commented 3 years ago

Implemented and tested.