Pages:
Author

Topic: Bitcoin API - solved! (Read 15448 times)

newbie
Activity: 24
Merit: 0
June 11, 2018, 04:57:22 PM
#37
BlockCypher API! BlockCypher is a simple JSON API, mostly RESTful for using blockchain, accessible via HTTP or HTTPS from the api.blockcypher.com domain. Currently, BlockCypher supports Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Testnet3, and BlockCypher Test Chain.
BlockCypher's API provides a superset of the endpoints you'll find in reference implementations, in addition to some special features that make BlockCypher uniquely powerful, such as Unconfirmed Confidence Factor, WebHook Event or Web-based WebSockets Reliable, On-Chain Micro Transactions, and Payment Forward.

As a result, if you are familiar with the implementation of blockchain referrals, you will feel at home using BlockCypher, but without worrying about scale or implementation challenges. And if you're not familiar - with the application of referrals or blockchain in general - BlockCypher's API is a great way to dip your toes into the development of blockchain, without a lengthy regulatory process. In any case, BlockCypher has 99.99% time-active, and maintains the expressive and logical API you'll like.
member
Activity: 140
Merit: 17
BITCOIN===>THE DISRUPTIVE CYBERCURRENCY
June 09, 2018, 04:09:51 PM
#36
I added this bounty to the list of active bounties: https://en.bitcoin.it/wiki/Active_Bounties

I solved my problem, and I am hereby paying the bounty to myself the bounty has been paid to blockexplorer.com!

Problem:
Lazy web designer (me) wants to use bitcoins without dealing with installing bitcoin on a server, installing a shopping cart interface, or using ugly merchant services with callbacks.

Solution for sending bitcoins:
Use the MtGox API (https://mtgox.com/support/tradeAPI)

Solution for receiving bitcoins:
1) Input a list of bitcoin receiving addresses to your database
2) Give a bitcoin address to a potential customer
3) Have the customer tell you when they have sent the coins and have at least 1 confirmation (you can choose a number higher than 1 if you are worried about double-spending)
4) Check blockexplorer to see if they sent the right amount (i.e. http://blockexplorer.com/q/getreceivedbyaddress/19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH/1) - the /1 is the number of confirmations you require
5) Give them what they paid for
6) After a reasonable amount of time has passed, you can re-use the address for another customer

You could avoid having a list of addresses and reusing them if one of the wallet services someday lets you get a new address via API call, but this will work for now.

Bad idea:
Selling bars of gold this way (owner of blockexplorer.com could rip you off)

Good(?) idea:
Selling naked pictures of your grandma this way (owner of blockexplorer.com won't bother)

Shameless begging:
If this info is useful to you, please consider a donation: 19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH

Maybe I'm the only one this lazy, but just in case, I added a page to the wiki: https://en.bitcoin.it/wiki/Lazy_API

Thanks to theymos for making changes to blockexplorer.com to make it even easier to do this. Because of those changes to better support what I want to do, I paid Theymos the 20BTC bounty. You can support blockexplorer.com too by donating to 1Cvvr8AsCfbbVQ2xoWiFD1Gb2VRbGsEf28

this sounds too like wayyyy too much effort! Smiley haha

===>

https://en.bitcoin.it/wiki/Lazy_API
newbie
Activity: 24
Merit: 0
March 02, 2014, 06:01:22 AM
#35
Yes, I'm trying to do exactly that but experience this error on testing their API:

https://bitcointalksearch.org/topic/blockchain-api-test-returns-error-495631
full member
Activity: 154
Merit: 100
March 02, 2014, 03:46:17 AM
#34
Now as MtGox has gone down, is there another API/webpage that can be recommended?
What features do you require?

I do not use it myself but I have heard good things about blockchain.info's API.
newbie
Activity: 24
Merit: 0
March 02, 2014, 02:47:35 AM
#33
Now as MtGox has gone down, is there another API/webpage that can be recommended?
newbie
Activity: 14
Merit: 0
February 08, 2014, 03:03:32 AM
#32
Here you have one interesting page  http://176.221.46.81/chain/Quarkcoin....
jlp
sr. member
Activity: 266
Merit: 264
February 07, 2014, 10:07:52 PM
#31
1) bitcoind - I think this might be the same as configuring bitcoin to run as server. I believe it uses an RPC API to run transactions from the command line.
Pros: Everything stays on my server
Cons: I have to find a server that will let me compile and install this, rather than just some PHP/MySQL farm in the cloud, which is what I prefer

You can run the front-end on one server and the back-end on another (and communicate via JSON-RPC over HTTPS).  That's how I'm able to run the Faucet and ClearCoin on Google's App Engine (they talk with bitcoind processes running on linode.com and aws.amazon.com servers).  bitcoind doesn't take much memory, bandwidth, or CPU (just don't turn on coin generation), so, for now, anyway, you can even use an Amazon "micro" server (which costs something like $100 per year).

I'm not selling anything so can't comment on the shopping cart interfaces.  Screen-scraping web pages is a bad idea for lots of reasons.


What is the speed/performance like if one runs the web app and bitcoind on two separate remote servers?  Won't the speed be slow?

The JSON-RPC in the web app sends the user name and password to access the bitcoind API.  Do both the web app's server and the bitcoind server need HTTPS, or just the bitcoind server is sufficient?

Which hosting company is best for this type of architecture?  Google App Engine, AWS EC2, DigitalOcean or Linode?

What about security?  Do I need to encrypt the wallet on the server?  How do I ensure that nobody at the hosting company accesses my server, reads the rpcuser and rpcpassword in bitcoin.conf and then starting sending Bitcoins out of my wallet?  If I move away, how do I ensure that the hosting company or the next customer doesn't take a copy of my wallet?
newbie
Activity: 22
Merit: 0
August 05, 2013, 10:37:42 PM
#30
This thread is 2 years old.
legendary
Activity: 1001
Merit: 1005
August 05, 2013, 02:31:10 PM
#29
How can i create a new address?

A tool (that claims to run on client side - have not verified) is bitaddress, which lets you generate random addresses.
legendary
Activity: 1261
Merit: 1000
April 08, 2013, 05:35:43 PM
#28
How can i create a new address?
newbie
Activity: 12
Merit: 0
May 23, 2011, 02:48:09 PM
#27
Cool, thanks!
administrator
Activity: 5222
Merit: 13032
May 23, 2011, 02:41:32 PM
#26
Fixed. Thanks.
newbie
Activity: 12
Merit: 0
May 23, 2011, 01:13:55 PM
#25

Hi theymos,

Your examples give me an error, it doesn't seem to work anymore:
Quote
ERROR: this page never counts 0-confirmation transactions
administrator
Activity: 5222
Merit: 13032
April 04, 2011, 03:16:59 PM
#24
Since theymos made changes to support what I want to do, I paid the 20BTC bounty using the donation address for blockexplorer.com

Theymos, please support laziness by adding a link to the API description from the blockexplorer.com home page. Thanks!

Thanks for the 20 BTC! I added a link.
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
April 04, 2011, 11:06:20 AM
#23

That is absolutely perfect. I updated my forum post and the wiki to reflect this method. I even put your blockexplorer.com donation address at the bottom  Tongue

Since theymos made changes to support what I want to do, I paid the 20BTC bounty using the donation address for blockexplorer.com

Theymos, please support laziness by adding a link to the API description from the blockexplorer.com home page. Thanks!
administrator
Activity: 5222
Merit: 13032
administrator
Activity: 5222
Merit: 13032
April 03, 2011, 11:39:03 PM
#21
(Just realized my solution is still vulnerable: the transaction could pay you, go away, you wait n blocks, and a different transaction pays you, you recheck the balance and it looks good, but then the 2nd transaction goes away.)

Yeah, /q/getreceivedbyaddress is currently only suitable when you need just 1 confirmation. I'll add a "minconf" parameter when I get time.
Hal
vip
Activity: 314
Merit: 4276
April 03, 2011, 10:21:19 PM
#20
I added a step to the wiki:

# Recheck blockexplorer to make sure the address still shows the right amount, in case the block chain reorganizes

Checking the address balance once, then waiting for more blocks, is not safe by itself as the transaction may go away.

(Just realized my solution is still vulnerable: the transaction could pay you, go away, you wait n blocks, and a different transaction pays you, you recheck the balance and it looks good, but then the 2nd transaction goes away.)
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
April 03, 2011, 03:57:19 PM
#19
I modified the wiki page to use BBE's API pages:
http://blockexplorer.com/q/getreceivedbyaddress/19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH
http://blockexplorer.com/q/getblockcount

You shouldn't scrape the HTML pages. The layout can change at any time.

Nice! That will be much easier. I updated my post above as well.

I found the complete API description here: http://blockexplorer.com/q/

It would be nice if the front page of blockexplorer.com linked to that page.
administrator
Activity: 5222
Merit: 13032
April 02, 2011, 12:16:02 AM
#18
I modified the wiki page to use BBE's API pages:
http://blockexplorer.com/q/getreceivedbyaddress/19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH
http://blockexplorer.com/q/getblockcount

You shouldn't scrape the HTML pages. The layout can change at any time.
Pages:
Jump to: