Bitcoin Forum
May 10, 2024, 12:09:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: can i programmatically find out whether this phone has N bitcoins on its wallet?  (Read 515 times)
Kimbrough Software (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 1


View Profile
January 04, 2017, 04:03:13 PM
Merited by ABCbits (1)
 #1

the use case is: i have a bitcoin-aware app A on an andriod phone, which would then like to trigger a bitcoin payment request to be executed by an on-phone bitcoin wallet via the BIB20/bitcoin: URI mechanism. Rather than generating the payment request directly and immediately for an arbitrary amount of bitcoin, is there a way to in effect ask the bitcoin wallet if it has at least N bitcoins in it first?
1715342988
Hero Member
*
Offline Offline

Posts: 1715342988

View Profile Personal Message (Offline)

Ignore
1715342988
Reply with quote  #2

1715342988
Report to moderator
1715342988
Hero Member
*
Offline Offline

Posts: 1715342988

View Profile Personal Message (Offline)

Ignore
1715342988
Reply with quote  #2

1715342988
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715342988
Hero Member
*
Offline Offline

Posts: 1715342988

View Profile Personal Message (Offline)

Ignore
1715342988
Reply with quote  #2

1715342988
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
January 04, 2017, 04:05:15 PM
 #2

It depends on the wallet if it has the functionality to make available this information to other apps.

Kimbrough Software (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 1


View Profile
January 04, 2017, 04:25:01 PM
 #3

I guess I'm asking if this exists implicitly or explicitly in the bip20 / bip 70 / a.n. other protocol which wallets sign up to?  By the way, which wallets allow this kind of query? 
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
January 04, 2017, 04:30:38 PM
Merited by ABCbits (2)
 #4

I guess I'm asking if this exists implicitly or explicitly in the bip20 / bip 70 / a.n. other protocol which wallets sign up to? 
Wallets don't sign up to anything, that is not how it works. For the payment protocol to work you need to have the users click on a link. The person creating that payment request has no idea how much money the payer has. The amount is whatever the requester sets.

By the way, which wallets allow this kind of query? 
AFAIK, no wallet allows this.

Kimbrough Software (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 1


View Profile
January 04, 2017, 07:45:51 PM
 #5

by "sign up to" i mean the wallet developer decides at design time to implement BIP20 - this functionality is already there in some wallets.  they've signed up to implementing and responding to this kind of protocol message.

Does anyone have any other thoughts on the matter?

thanks,
John
Kimbrough Software
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
January 04, 2017, 08:09:04 PM
Merited by ABCbits (2)
 #6

by "sign up to" i mean the wallet developer decides at design time to implement BIP20 - this functionality is already there in some wallets.  they've signed up to implementing and responding to this kind of protocol message.
Nearly all wallets implement the BIP 21 (note not 20, 20 was replaced by 21) URI Scheme. Most (but not all) wallets support the BIP 70 Payment Protocol. However there is no such standard for a wallet to announce its balance, and nor should there be any such protocol.

For whatever you want to do, just create the BIP 21 URI and when the user clicks on the link, the wallet should open and automatically fill in the necessary send parameters as specified by your URI.

Kimbrough Software (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 1


View Profile
January 04, 2017, 09:28:13 PM
 #7

many thanks guys!

John, Kimbrough Software
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!