ManojNimbalkar / bitcoin-wallet

Automatically exported from code.google.com/p/bitcoin-wallet
0 stars 0 forks source link

Request open intent for using bitcoin as payment option in other apps #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to have an open intent (maybe similar to those @ 
http://www.openintents.org) to enable developers to include bitcoin payment for 
their apps through bitcoin-wallet. 

I would like to help to develop such an extension!

Original issue reported on code.google.com by flymaste...@gmail.com on 20 Aug 2011 at 8:41

GoogleCodeExporter commented 9 years ago
?! Why is it listed as defect?!

Original comment by flymaste...@gmail.com on 20 Aug 2011 at 8:41

GoogleCodeExporter commented 9 years ago
Try action=android.intent.action.VIEW and add a data URL that follows the 
Bitcoin URL spec described at

https://en.bitcoin.it/wiki/URI_Scheme

minus the hex 'x' syntax, and also try to not use the exponent 'X' syntax. 
Labels and messages are also currently not supported, but at least the label 
will.

Just out of curiosity: Do you have a specific app in mind?

Original comment by andreas....@gmail.com on 20 Aug 2011 at 9:14

GoogleCodeExporter commented 9 years ago
This could be a start but I want to do something more sophisticated. 

Example: 
I would develop a freemium game where players have to buy different 
items/premium features from other players (and the developer :D) to reach their 
goal faster. They buy different items from different people at the same time. A 
player goes shopping and fills his basket and then he wants to check out. 
Inside the app this would create a list of good-type/amount/price and vendors 
which leads to multiple transactions. 
Now it would be great to have an public activity (inside bitcoin-wallet) which 
can be called with the list of pending transactions (by calling 
"startActivityForResult(...)"). Inside bitcoin-wallet a new minimalistic view 
will appear where the player has to authorize the transactions! (otherwise a 
third party app could abuse this feature)
When the player has authorized (or cancelled) the transaction(s) a appropriate 
result should be set and the activity should be finished.

Now the third party app knows if/which transactions where made to the other 
parties. The next step would be a content provider which lists all 
incoming/outgoing transactions and their (trust) state and serves them to 
interested apps. If the player tries to cheat (double spending) a app will 
recognize this after some minutes and could deactivate premium features or 
reverse item trades.

That's my plan.... :)

Original comment by flymaste...@gmail.com on 20 Aug 2011 at 4:31

GoogleCodeExporter commented 9 years ago
I see where you are going with this.

I'd rather not expose that many bitcoin details to a 3rd app, and certainly not 
a list of transactions.

I could imagine returning the transaction ID in the activity result if the user 
decided to sign. And an OK/CANCEL state. That way, you could link that ID with 
your virtual good and use whatever Bitcoin validation you want to use (perhaps 
your own validating node?).

If a content provider is involved, I'd vote for the 3rd party app needing to 
know the tx id(s) to check. No "list all".

In the long term, perhaps a solution for contracts with virtual goods will be 
included in Bitcoin itself? You might want to check with the main Bitcoin 
developers.

Original comment by andreas....@gmail.com on 20 Aug 2011 at 5:22

GoogleCodeExporter commented 9 years ago
[ I could imagine returning the transaction ID in the activity result if the 
user decided to sign. And an OK/CANCEL state. That way, you could link that ID 
with your virtual good and use whatever Bitcoin validation you want to use 
(perhaps your own validating node?).

If a content provider is involved, I'd vote for the 3rd party app needing to 
know the tx id(s) to check. No "list all". ]

That sounds like a good idea. Do you have plans to switch to a Git or HG 
repository in the near future? I think a solution around your android project 
would be a good first step :)

Original comment by flymaste...@gmail.com on 20 Aug 2011 at 5:45

GoogleCodeExporter commented 9 years ago
I just implemented the OK/CANCELED state.

Original comment by andreas....@gmail.com on 20 Aug 2011 at 5:55

GoogleCodeExporter commented 9 years ago
Nice :)thx

Original comment by flymaste...@gmail.com on 20 Aug 2011 at 6:15

GoogleCodeExporter commented 9 years ago
I know this old, but how difficult would it be to also provide the transaction 
hash as well? This would allow a phone-side application to send the expected 
transaction hash back to the payment processing server, and would be quite 
helpful.

Original comment by chrisr...@gmail.com on 20 Feb 2012 at 6:34

GoogleCodeExporter commented 9 years ago
@chrisrico: Yeah, this is what I meant in comment 4. Do you have a specific app 
in mind?

Original comment by andreas....@gmail.com on 20 Feb 2012 at 11:53

GoogleCodeExporter commented 9 years ago
Just in case anyone didn't notice: The tx hash is passed in the result intent. 
You can use the 'integration-android' subproject to integrate Bitcoin payments 
into your app. See 'sample-integration-android' for a simple example.

I'm closing this, as the intent has been implemented.

Original comment by andreas....@gmail.com on 16 Feb 2013 at 10:11