https://tests.bitcoin.it/w/api.php?action=feedcontributions&user=Osmosis&feedformat=atomBitcoin Wiki - User contributions [en]2024-03-28T12:46:33ZUser contributionsMediaWiki 1.30.0https://tests.bitcoin.it/w/index.php?title=Meetups&diff=63721Meetups2017-07-26T18:18:12Z<p>Osmosis: </p>
<hr />
<div>Don't add everyone who's going in the "Who?" column, just prominent Bitcoin members and organizers. Also see [http://bitcoin.meetup.com bitcoin.meetup.com]. Also see [[Conferences]].<br />
<br />
Keep an eye on the [http://bitcointalk.org/index.php?board=86.0 Meetups] forum board on BitcoinTalk for announcements.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Group<br />
! When?<br />
! Where?<br />
! Who?<br />
! Other Notes<br />
|-<br />
| [http://www.meetup.com/Bitcoin-in-San-Diego/ Bitcoin in San Diego]<br />
| Bi-Monthly meetups, weekly workshops<br />
| San Diego, CA, United States<br />
| Local and international participants - guest speakers welcome.<br />
| Presentations and workshops, discussion & trade.<br />
|-<br />
| [http://www.meetup.com/Tucson-Bitcoin-Marketplace/ Bitcoin in Tucson]<br />
| short-notice meetups<br />
| Tucson, AZ, United States<br />
| everyone welcome<br />
| breakfast, Bitcoin basics, presentations, cryptocurrencies, blockchains, and economics<br />
|-<br />
| [http://www.meetup.com/blockchaintech/ Blockchain Tech in Phoenix]<br />
| regular and short-notice meetups<br />
| Phoenix, AZ, United States<br />
| everyone welcome<br />
| hack-a-thons and anything directly or indirectly related to blockchain technology!<br />
|-<br />
| [http://bitcoinembassy.ca Bitcoin Embassy]<br />
| Monthly meetups, weekly workshops<br />
| Montreal, QC, Canada<br />
| Local and international participants - guest speakers welcome. Come and visit our hackerspace, startup incubator and soon, Bitcoin store.<br />
| Presentations and workshops, discussion & trade. [http://eepurl.com/GRzAf Register to our mailing list] to receive event invitations. We also post on [https://bitcointalk.org/index.php?board=86.0 BitcoinTalk Meetups], [http://bitcoinembassy.eventbrite.ca/ EventBrite], [https://www.facebook.com/bitcoinembassy Facebook Bitcoin Embassy page], [https://plus.google.com/u/0/100266464273886488866 Google +], etc.<br />
|-<br />
|-<br />
| [http://www.meetup.com/San-Antonio-Bitcoin/ San Antonio Meetup]<br />
| Every Thursday at 7:00 PM<br />
| San Antonio, Texas<br />
Currently at [https://www.google.com/maps/place/17711+Interstate+10+Frontage+Rd,+The+Rim,+San+Antonio,+TX+78257/@29.609714,-98.59871,17z/data=!3m1!4b1!4m2!3m1!1s0x865c6423ecd5d047:0xaa94c89b14a98fc0 Tiago's]<br />
| Miners, entrepreneurs, traders and anyone looking to learn more about Bitcoin and other Cryptocurrencies are welcome.<br />
| [https://bitcointalk.org/index.php?topic=727155.0 Bitcointalk thread]<br />
|-<br />
|-<br />
| [http://www.meetup.com/BitcoinCT/ BitcoinCT Meetup]<br />
| Monthly Meetups<br />
| Stamford, CT<br />
| The Connecticut Bitcoin Meetup brings together Bitcoin users in Connecticut. This meetup is suitable for everyone from Bitcoin newbies to experienced Bitcoiners. You can attend meetups simply to learn more about Bitcoin or to make business connections for entrepreneurs, miners and developers. | We welcome everyone to our meetups even if you're not currently a Bitcoin user, but simply want to find out more about this amazing e-currency. <br />
|-<br />
|-<br />
| [https://bitcash.cz/forum/ Bitcash.cz]<br />
| Ocasionally<br />
| Prague, Brno, Ostrava<br />
| Meetup for Czech and Slovak bitcoin pioneers. <br />
| Discuss and trade with Bitcoin. Events posted also on our [https://www.facebook.com/Bitcash.cz Facebook] profile.<br />
|-<br />
|-<br />
| [http://www.meetup.com/Sydney-Bitcoin-Users-Group/ BitcoinSYD]<br />
| Every Wednesday @ 1800<br />
| [https://goo.gl/maps/okdSm The SG], Downstairs, 32 York St. Look for the guy in the Red Cap.<br />
| Local, National and International peeps looking to Talk and Trade Bitcoin<br />
| We also post our meetups on Reddit and [https://www.facebook.com/pages/Bitcoin-Sydney-Australia/457681220943285 Facebook]<br />
|-<br />
|-<br />
| [https://bitcointalk.org/index.php?topic=27191.0;all Bitcoin Stammtisch]<br />
| each first Thursday of the month<br />
| [http://www.room77.de/ Room 77], Gräfestr. 77, Berlin-Kreuzberg<br />
| Anyone interested in Bitcoin: technically, economically, socially or philosophically.<br />
| If questions contact andreas(at)schildbach.de (founder).<br />
|-<br />
|-<br />
| [http://www.meetup.com/Nashville-Bitcoin-Meetup/ Nashville Bitcoin Meetup]<br />
| weekly and quarterly<br />
| Nashville, TN<br />
| Plenty of room for all!<br />
|<br />
|-<br />
| [http://www.meetup.com/bitcoins/ Bitcoin NYC]<br />
| monthly<br />
| [http://www.xcubicle.com/ xCubicle Hackerspace - New York, NY]<br />
| Any and all Bitcoin aficionados. <br />
|<br />
|-<br />
|-<br />
| [https://en.bitcoin.it/wiki/Bitcoin_Wednesday Bitcoin Wednesday Amsterdam]<br />
| First Wednesday of the Month<br />
| Dutch Bitcoin Users Group of the Netherlands - The country's longest continuously running Bitcoin event.<br />
| [http://www.meetup.com/BitcoinWednesday/ Sign Up - Amsterdam, The Netherlands]<br />
| Open to anyone interested in Bitcoin. Organized by [https://www.PikaPay.com PikaPay.com] @PikaPay or hello-AT-PikaPay.com<br />
|-<br />
|-<br />
| [http://hitspace.org/ HIT Space - Hack it Together]<br />
| monthly<br />
| [http://hitspace.org/where-we-are/ HIT Space - Porto, Portugal]<br />
| Hackerspace members and anyone who want to join us<br />
| send us an email geral[at]hitspace.org<br />
|-<br />
|-<br />
| [http://bitcoin-austria.at Bitcoin Austria]<br />
| monthly - check the [http://bitcoin-austria.at wiki] or subscribe to the [http://lists.bitcoin-austria.at/listinfo/bitcoin mailinglist]<br />
| [https://metalab.at/wiki/Lage Metalab], Vienna hacker space, Rathausstraße 6, 1010 Wien<br />
| Everybody interested in Bitcoin <br />
| <br />
|-<br />
| [http://brmlab.cz brmlab, prague hackerspace]<br />
| 14th Nov 2011<br />
28th Nov 2011<br />
([http://brmlab.cz/event/bitcoin_seminar])<br />
| [http://brmlab.cz/place Brmlab, Bubenska 1]<br />
| brmlab crew, slush, genjix<br />
| <br />
|-<br />
| [http://www.facebook.com/groups/175596065827848/ Bitcoin Boston]<br />
| Every Friday at 4:30 and bi-weekly on Saturday or Sunday ([http://www.facebook.com/groups/175596065827848/ See Facebook page])<br />
| Starbucks in Kendall Square (Ames St & Broadway) and bi-weekly at Starbucks in Harvard Square<br />
| Anyone is welcome!<br />
| Our bi-weekly meetings have been somewhat sporadic but we aim to gain some regularity.<br />
|-<br />
| [http://www.meetup.com/Milwaukee-Area-Bitcoin-Meetup/ Milwaukee Area Bitcoin Meetup]<br />
| Every other Thursday at 6:00pm<br />
| 17025 West Rogers Drive, New Berlin WI<br />
| Open to anyone interested in Bitcoin<br />
| [https://www.facebook.com/groups/BTCMKE Milwaukee Area Bitcoin Meetup Facebook]<br />
|-<br />
| [http://www.meetup.com/bitcoin New York Bitcoin Users]<br />
| 6:00 PM, 3rd Sunday of every month ([http://www.meetup.com/bitcoin/events/past past meetings])<br />
| OnlyOneTV Studios - 290 Fifth Ave New York, NY<br />
| Bruce Wagner (Organizer) and others<br />
| <br />
|-<br />
|-<br />
| [http://www.meetup.com/bitcoin New York Bitcoin Users]<br />
| 6:00 PM, every Wednesday of every month ([http://www.meetup.com/bitcoin/events/past past meetings])<br />
| Just Sweet Dessert House - 83 Third Ave New York, NY<br />
| Yifu Guo (Organizer) and crew<br />
| hosted by Bitsyncom, the people behind [[Bitnavigator]], walk-ins welcome;<br />
|-<br />
|[http://www.meetup.com/MichiganBitcoinMeetup Michigan Bitcoin Meetup]<br />
|<br />
|<br />
|Kinnard Hockenhull (Organizer)<br />
|Sponsored by [[BitBox]]<br />
|-<br />
| [http://www.meetup.com/PhillyBitcoin Philadelphia Bitcoin User Group]<br />
| TBD<br />
| TBD<br />
| Brian Cohen (Organizer) and others<br />
|<br />
|-<br />
| [http://www.meetup.com/BitcoinDC Washington, DC Bitcoin Users]<br />
| 7:00 PM, 1st Monday of every month ([http://www.meetup.com/BitcoinDC/#past past meetings])<br />
| Northside Social, 3211 Wilson Blvd Arlington, VA<br />
| [[User:Dduane|Darrell Duane]] (Organizer) and others<br />
|<br />
|-<br />
| [http://www.meetup.com/Silicon-Valley-Bitcoin-Users Silicon Valley Bitcoin Users]<br />
| 7:00 PM, Tuesday, June 14, 2011 ([http://www.meetup.com/Silicon-Valley-Bitcoin-Users/events/past past meetings])<br />
| 140B S Whisman Road Mountain View, CA <br />
| Brian Mcqueen and others<br />
|<br />
|-<br />
| [http://www.meetup.com/BitcoinChicago Chicago]<br />
| No regular schedule yet ([http://www.meetup.com/BitcoinChicago/events/past past meetings])<br />
| Sunnyvale Art Gallery Cafe, 251 W El Camino Real Sunnyvale, CA<br />
| Igor<br />
|<br />
|-<br />
| [http://www.meetup.com/denver-bitcoin Denver]<br />
| First meeting June 4th, 2011 ([http://www.meetup.com/denver-bitcoin/events/past past meetings])<br />
| Gypsy House Cafe - 1279 Marion St Denver, CO<br />
| bearbones<br />
|<br />
|-<br />
| [http://www.meetup.com/SF-Bitcoin-Devs/ SF Bitcoin Devs]<br />
| About twice a month ([http://www.meetup.com/SF-Bitcoin-Devs/#past past meetings])<br />
| San Francisco, CA<br />
| <br />
| This meetup has a strong technical/engineering focus ([https://www.youtube.com/channel/UCREs0ConyCR2sEFf-DrLRMw see videos of past presentations])<br />
|-<br />
| [http://www.meetup.com/San-Francisco-Bitcoin-Social/ San Francisco Bitcoin Social]<br />
| Every second Thursday and last Tuesday of the month ([http://www.meetup.com/San-Francisco-Bitcoin-Social/#past past meetings])<br />
| San Francisco, CA<br />
| <br />
| More general (less technical) meetup for cryptocurrency aficionados<br />
|-<br />
| [http://www.meetup.com/Los-Angeles-Digital-Currency-Innovators-Group Los Angeles Digital Currency Innovators]<br />
| Thursday July 7th, 2011, 7 PM<br />
| (mt)/Media Temple, Culver City, CA<br />
| [[User:sgornick|Stephen Gornick]] (Interim organizer) and others<br />
| Seeking meetup coordinator<br />
|-<br />
| [http://CryptoParty.vegas/ Las Vegas Crypto Party]<br />
| 1st Thursday 7pm. [http://BitcoinsInVegas.com Weekly Wednesday lunch mobs]<br />
| CoinBus.com, 64 N Pecos, Henderson, NV 89052<br />
| Julian Tosh / Tuxavant<br />
|<br />
|-<br />
| [https://www.facebook.com/groups/195492163844669/ Free State Bitcoin Consortium]<br />
| Every Saturday, at 6:30 PM<br />
| Strange Brew Tavern, Manchester, NH<br />
| ben-abuya (organizer)<br />
| Weekly<br />
|-<br />
| [https://www.facebook.com/groups/195492163844669/ Twin Cities Users]<br />
| Friday, June 10, 2011, 6:30 PM<br />
| Joule - 1200 Washington Ave S Minneapolis, MN<br />
| Mac Manson<br />
|<br />
|-<br />
| [http://www.meetup.com/Bitcoin-of-South-Florida/ Bitcoin of South Florida] and [http://www.meetup.com/Miami-International-Bitcoin-Group/ Miami International Bitcoin]<br />
| Rotated weekly<br />
| Miami, Ft. Lauderdale, and Boca Raton, FL<br />
| All party people are welcome<br />
|-<br />
| [http://www.meetup.com/Bitcoin-Orlando Bitcoin Orlando]<br />
| ([http://www.meetup.com/Bitcoin-Orlando#past past meetings])<br />
| Frank & Steins 150 S. Magnolia Ave, Orlando, FL<br />
| Antonio Gallippi<br />
|<br />
|-<br />
| [http://www.meetup.com/Bitcoin-Enthusiasts/ Bitcoin Tampa]<br />
| Monthly meetings<br />
| Matt Branton -- [https://www.coinlock.com/ Coinlock.com] founder<br />
|<br />
|-<br />
| [http://www.hive13.org/?p=310 Hive13 Hackerspace]<br />
| Bitcoin Exchange, Every Tuesday, 7:30 PM<br />
| Hive13 - 2929 Spring Grove Avenue, Cincinnati, OH<br />
| <br />
|<br />
|-<br />
| [https://www.facebook.com/bitcoinaus Bitcoin Australia]: Melbourne <br />
| [https://www.facebook.com/events/345430765511234/ Wednesday, 23 May 2012, 18:45]<br />
| Melbourne CBD(TBA)<br />
| Facebook, IRC, Bitcointalk Forum...<br />
|<br />
|-<br />
| [[Bitcoin Wiki:Tokyo meetup|Tokyo]]<br />
| Every Thursday<br />
| Shibuya, Roppongi<br />
| Roger Ver (Organizer) and others<br />
| Locations change, check the meetup page<br />
|-<br />
| [http://meetup.com/Bitcoin-Canada Vancouver Canada]<br />
| ([http://www.meetup.com/Bitcoin-Canada/#past past meetings])<br />
| The Brickhouse - 730 Main St.<br />
| humble (and others)<br />
|<br />
|-<br />
| [https://plus.google.com/u/0/communities/113055238568417913658 Zurich / Geneva Switzerland]<br />
| Twice a month<br />
| Kennedy's Irish Pub, Zurich; Lord Nelson Pub, Geneva<br />
| Stefan Thomas (WeUseCoins), Mike Hearn (BitcoinJ), bitdragon, Luzius (Wuala), more ... <br />
|<br />
|-<br />
| Seattle Bitcoin Meetup<br />
| [http://www.meetup.com/SeattleBitCoin/ Semi-regularly].<br />
| [http://maps.google.com/maps?q=cafe+solstice&daddr=4116+University+Way,+Seattle,+WA+98105-6214&hl=en&ll=47.657424,-122.31313&spn=0.007328,0.01929&gl=us&view=map&geocode=CRT9Bdg7zX3vFdcx1wIdWqa1-CFcJ9qrr9CcEQ&t=h&z=16 Solstice Cafe, 2pm]<br />
| [https://bitcointalk.org/index.php?action=profile;u=36217 indolering]<br />
|<br />
|-<br />
| [https://bitcointalk.org/index.php?topic=135723.0 Munich Germany]<br />
| First wednesday of the month, 6:00PM<br />
| [http://www.openstreetmap.org/?minlon=11.5800867080688&minlat=48.1336479187012&maxlon=11.5804319381714&maxlat=48.1338386535645 Nero Pizza], Rumfordstrasse 34, 80469 München<br />
| Bitcoin-users from Munich and around<br />
| [http://www.meetup.com/Bitcoin-Munchen/ @meetup.com]<br />
|-<br />
| [http://www.meetup.com/bitcoin-il/ Israel Bitcoin Meetup Group]<br />
| Occasional<br />
| TBD<br />
| Meni Rosenfeld<br />
|<br />
|-<br />
| [http://www.meetup.com/Dallas-Bitcoin-User-Meetup/ Dallas Bitcoin Meetup Group]<br />
| Biweekly on Saturdays, 6:00PM<br />
| [http://freemandallas.com/ The Free Man Cajun Cafe]<br />
| Justus Ranvier (organizer)<br />
|<br />
|-<br />
| [https://en.bitcoin.it/wiki/Cafe Café Bitcoin Sevilla]<br />
| <br />
| Seville, Spain<br />
| Randy Brito (rdymac / btcven), Eduardo (bitcoin.com.es), Jorge and Alfredo<br />
| http://cafebitcoin.com<br />
|-<br />
| [http://www.meetup.com/BitcoinSingapore/ Bitcoin Singapore Meetup]<br />
| <br />
| Singapore<br />
| Monthly<br />
| [https://www.facebook.com/pages/Bitcoin-Singapore/431452580303555 Bitcoin Singapore Facebook Page]<br />
|-<br />
| [http://www.meetup.com/Lehigh-Valley-Bitcoin-Meetup/ Lehigh Valley (Allentown/Bethlehem PA) Bitcoin]<br />
| <br />
| Westgate Subway; Schoenersville Rd; Bethlehem<br />
| Jim Hoff (organizer)<br />
| http://www.meetup.com/Lehigh-Valley-Bitcoin-Meetup/<br />
|-<br />
| [http://www.meetup.com/LetsUseBitcoin/ Lets Use Bitcoin]<br />
| Monthly<br />
| {{flag|nl}}<br />
| Local and international participants<br />
| Using Bitcoin, discussion of bitcoin and having fun! Sponsored by [[BTC.com]]<br />
|-<br />
| [http://www.meetup.com/Arnhem-Bitcoin-Users Arnhem Bitcoin Users]<br />
| Monthly<br />
| Arnhem Bitcoincity (the Netherlands)<br />
| Beginners and experts<br />
| Spend some time (and bitcoins) in the most Bitcoin-friendly city!<br />
|-<br />
|}<br />
<br />
==See Also==<br />
<br />
* [http://hackerspaces.org/wiki/List_of_Hacker_Spaces List of Hacker Spaces]<br />
* [http://bitimap.net Bitimap.net - Find local meetups (up-to-date)]<br />
<br />
[[Category:Local]]<br />
[[Category:Meetups]]<br />
<br />
<br />
[[de:Treffen]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=API_reference_(JSON-RPC)&diff=42637API reference (JSON-RPC)2013-11-26T01:55:40Z<p>Osmosis: /* Python */</p>
<hr />
<div>== Controlling Bitcoin ==<br />
<br />
Run ''bitcoind'' or ''bitcoin-qt -server''. You can control it via the command-line or by [http://json-rpc.org/wiki/specification HTTP JSON-RPC] commands.<br />
<br />
You must create a bitcoin.conf configuration file setting an rpcuser and rpcpassword; see [[Running Bitcoin]] for details.<br />
<br />
Now run:<br />
$ ./bitcoind -daemon<br />
bitcoin server starting<br />
$ ./bitcoind help<br />
# shows the help text<br />
<br />
A [[Original Bitcoin client/API Calls list|list of RPC calls]] will be shown.<br />
<br />
$ ./bitcoind getbalance<br />
2000.00000<br />
<br />
== JSON-RPC ==<br />
<br />
Running Bitcoin with the -server argument (or running bitcoind) tells it to function as a [http://json-rpc.org/wiki/specification HTTP JSON-RPC] server, but <br />
[http://en.wikipedia.org/wiki/Basic_access_authentication Basic access authentication] must be used when communicating with it, and, for security, by default, the server only accepts connections from other processes on the same machine. If your HTTP or JSON library requires you to specify which 'realm' is authenticated, use 'jsonrpc'.<br />
<br />
Bitcoin supports SSL (https) JSON-RPC connections beginning with version 0.3.14. See the [[Enabling SSL on original client daemon|rpcssl wiki page]] for setup instructions and a list of all bitcoin.conf configuration options.<br />
<br />
Allowing arbitrary machines to access the JSON-RPC port (using the rpcallowip [[Running_Bitcoin|configuration option]]) is dangerous and '''strongly discouraged'''-- access should be strictly limited to trusted machines.<br />
<br />
To access the server you should find a [http://json-rpc.org/wiki/implementations suitable library] for your language.<br />
<br />
== Proper money handling ==<br />
<br />
See the [[Proper Money Handling (JSON-RPC)|proper money handling page]] for notes on avoiding rounding errors when handling bitcoin values.<br />
<br />
== Python ==<br />
<br />
[http://json-rpc.org/wiki/python-json-rpc python-jsonrpc] is the official JSON-RPC implementation for Python.<br />
It automatically generates Python methods for RPC calls.<br />
However, due to its design for supporting old versions of Python, it is also rather inefficient.<br />
[[User:jgarzik|jgarzik]] has forked it as [https://github.com/jgarzik/python-bitcoinrpc Python-BitcoinRPC] and optimized it for current versions.<br />
Generally, this version is recommended.<br />
<br />
While BitcoinRPC lacks a few obscure features from jsonrpc, software using only the ServiceProxy class can be written the same to work with either version the user might choose to install:<br />
<br />
<source lang="python"><br />
from jsonrpc import ServiceProxy<br />
<br />
access = ServiceProxy("http://user:password@127.0.0.1:8332")<br />
access.getinfo()<br />
access.listreceivedbyaddress(6)<br />
#access.sendtoaddress("11yEmxiMso2RsFVfBcCa616npBvGgxiBX", 10)<br />
</source><br />
<br />
The latest version of python-bitcoinrpc has a new syntax.<br />
<source lang="python"><br />
from bitcoinrpc.authproxy import AuthServiceProxy<br />
</source><br />
<br />
== Ruby ==<br />
<br />
<source lang="ruby"><br />
require 'net/http'<br />
require 'uri'<br />
require 'json'<br />
<br />
class BitcoinRPC<br />
def initialize(service_url)<br />
@uri = URI.parse(service_url)<br />
end<br />
<br />
def method_missing(name, *args)<br />
post_body = { 'method' => name, 'params' => args, 'id' => 'jsonrpc' }.to_json<br />
resp = JSON.parse( http_post_request(post_body) )<br />
raise JSONRPCError, resp['error'] if resp['error']<br />
resp['result']<br />
end<br />
<br />
def http_post_request(post_body)<br />
http = Net::HTTP.new(@uri.host, @uri.port)<br />
request = Net::HTTP::Post.new(@uri.request_uri)<br />
request.basic_auth @uri.user, @uri.password<br />
request.content_type = 'application/json'<br />
request.body = post_body<br />
http.request(request).body<br />
end<br />
<br />
class JSONRPCError < RuntimeError; end<br />
end<br />
<br />
if $0 == __FILE__<br />
h = BitcoinRPC.new('http://user:password@127.0.0.1:8332')<br />
p h.getbalance<br />
p h.getinfo<br />
p h.getnewaddress<br />
p h.dumpprivkey( h.getnewaddress )<br />
# also see: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list<br />
end<br />
</source><br />
<br />
== PHP ==<br />
<br />
The [http://jsonrpcphp.org/ JSON-RPC PHP] library also makes it very easy to connect to Bitcoin. For example:<br />
<br />
<source lang="php"><br />
require_once 'jsonRPCClient.php';<br />
<br />
$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');<br />
<br />
echo "<pre>\n";<br />
print_r($bitcoin->getinfo()); echo "\n";<br />
echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";<br />
echo "</pre>";<br />
</source><br />
<br />
== Java ==<br />
<br />
The easiest way to tell Java to use HTTP Basic authentication is to set a default Authenticator:<br />
<br />
<source lang="java"><br />
final String rpcuser ="...";<br />
final String rpcpassword ="...";<br />
<br />
Authenticator.setDefault(new Authenticator() {<br />
protected PasswordAuthentication getPasswordAuthentication() {<br />
return new PasswordAuthentication (rpcuser, rpcpassword.toCharArray());<br />
}<br />
});<br />
</source><br />
<br />
Once that is done, any JSON-RPC library for Java (or ordinary URL POSTs) may be used to communicate with the Bitcoin server.<br />
<br />
== Perl ==<br />
<br />
The JSON::RPC package from CPAN can be used to communicate with Bitcoin. You must set the client's credentials; for example:<br />
<br />
<source lang="perl"><br />
use JSON::RPC::Client;<br />
use Data::Dumper;<br />
<br />
my $client = new JSON::RPC::Client;<br />
<br />
$client->ua->credentials(<br />
'localhost:8332', 'jsonrpc', 'user' => 'password' # REPLACE WITH YOUR bitcoin.conf rpcuser/rpcpassword<br />
);<br />
<br />
my $uri = 'http://localhost:8332/';<br />
my $obj = {<br />
method => 'getinfo',<br />
params => [],<br />
};<br />
<br />
my $res = $client->call( $uri, $obj );<br />
<br />
if ($res){<br />
if ($res->is_error) { print "Error : ", $res->error_message; }<br />
else { print Dumper($res->result); }<br />
} else {<br />
print $client->status_line;<br />
}<br />
</source><br />
<br />
== Go ==<br />
<br />
The [https://github.com/conformal/btcjson btcjson package] can be used to communicate with Bitcoin. You must provide credentials to match the client you are communicating with.<br />
<br />
<source lang="go"><br />
import "github.com/conformal/btcjson"<br />
msg, err := btcjson.CreateMessage("getinfo")<br />
if err != nil {<br />
// Do your error handling<br />
}<br />
// Use your username and password here.<br />
reply, err := btcjson.RpcCommand("user", "password", "localhost:8332", msg)<br />
</source><br />
<br />
== .NET (C#) ==<br />
The communication with rpc service can be achieved using the standard httprequest/response objects.<br />
A library for serialising and deserialising Json will make your life a lot easier:<br />
<br />
* JayRock for .NET 4.0<br />
* Json.Net for .NET 2.0 and above <br />
<br />
The following example uses Json.Net:<br />
<br />
<source lang="csharp"><br />
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://localhost.:8332");<br />
webRequest.Credentials = new NetworkCredential("user", "pwd");<br />
/// important, otherwise the service can't desirialse your request properly<br />
webRequest.ContentType = "application/json-rpc";<br />
webRequest.Method = "POST";<br />
<br />
JObject joe = new JObject();<br />
joe.Add(new JProperty("jsonrpc", "1.0"));<br />
joe.Add(new JProperty("id", "1"));<br />
joe.Add(new JProperty("method", Method));<br />
// params is a collection values which the method requires..<br />
if (Params.Keys.Count == 0)<br />
{<br />
joe.Add(new JProperty("params", new JArray()));<br />
}<br />
else<br />
{<br />
JArray props = new JArray();<br />
// add the props in the reverse order!<br />
for (int i = Params.Keys.Count - 1; i >= 0; i--)<br />
{<br />
.... // add the params<br />
}<br />
joe.Add(new JProperty("params", props));<br />
}<br />
<br />
// serialize json for the request<br />
string s = JsonConvert.SerializeObject(joe);<br />
byte[] byteArray = Encoding.UTF8.GetBytes(s);<br />
webRequest.ContentLength = byteArray.Length;<br />
Stream dataStream = webRequest.GetRequestStream();<br />
dataStream.Write(byteArray, 0, byteArray.Length);<br />
dataStream.Close();<br />
<br />
<br />
WebResponse webResponse = webRequest.GetResponse();<br />
<br />
... // deserialze the response<br />
</source><br />
<br />
There is also a wrapper for Json.NET called Bitnet (https://sourceforge.net/projects/bitnet)<br />
implementing Bitcoin API in more convenient way:<br />
<br />
<source lang="csharp"><br />
BitnetClient bc = new BitnetClient("http://127.0.0.1:8332");<br />
bc.Credentials = new NetworkCredential("user", "pass");<br />
<br />
var p = bc.GetDifficulty();<br />
Console.WriteLine("Difficulty:" + p.ToString());<br />
<br />
var inf = bc.GetInfo();<br />
Console.WriteLine("Balance:" + inf["balance"]);<br />
</source><br />
<br />
== Node.js ==<br />
<br />
* [https://github.com/freewil/node-bitcoin node-bitcoin] (npm: bitcoin) <br />
<br />
Example using node-bitcoin:<br />
<br />
<source lang="javascript"><br />
var bitcoin = require('bitcoin');<br />
var client = new bitcoin.Client({<br />
host: 'localhost',<br />
port: 8332,<br />
user: 'user',<br />
pass: 'pass'<br />
});<br />
<br />
client.getDifficulty(function(err, difficulty) {<br />
if (err) {<br />
return console.error(err);<br />
}<br />
<br />
console.log('Difficulty: ' + difficulty);<br />
});<br />
</source><br />
<br />
Example using Kapitalize:<br />
<br />
<source lang='javascript'><br />
var client = require('kapitalize')()<br />
<br />
client.auth('user', 'password')<br />
<br />
client<br />
.getInfo()<br />
.getDifficulty(function(err, difficulty) {<br />
console.log('Dificulty: ', difficulty)<br />
})<br />
</source><br />
<br />
== Command line (cURL) ==<br />
<br />
You can also send commands and see results using [http://curl.haxx.se/ cURL] or some other command-line HTTP-fetching utility; for example:<br />
<br />
<source lang="bash"><br />
curl --user user --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' <br />
-H 'content-type: text/plain;' http://127.0.0.1:8332/<br />
</source><br />
<br />
You will be prompted for your rpcpassword, and then will see something like:<br />
<br />
<source lang="javascript"><br />
{"result":{"balance":0.000000000000000,"blocks":59952,"connections":48,"proxy":"","generate":false,<br />
"genproclimit":-1,"difficulty":16.61907875185736,"error":null,"id":"curltest"}<br />
</source><br />
<br />
== Clojure ==<br />
<br />
[https://github.com/aviad/clj-btc clj-btc] is a Clojure wrapper for the bitcoin API.<br />
<br />
<source lang="clojure"><br />
user=> (require '[clj-btc.core :as btc])<br />
nil<br />
user=> (btc/getinfo)<br />
{"timeoffset" 0, "protocolversion" 70001, "blocks" 111908, "errors" "",<br />
"testnet" true, "proxy" "", "connections" 4, "version" 80500,<br />
"keypoololdest" 1380388750, "paytxfee" 0E-8M,<br />
"difficulty" 4642.44443532M, "keypoolsize" 101, "balance" 0E-8M,<br />
"walletversion" 60000}<br />
</source><br />
<br />
== See Also==<br />
<br />
* [[Original_Bitcoin_client/API_Calls_list|API calls list]]<br />
* [[Running Bitcoin]]<br />
* [[Lazy API]]<br />
* [[PHP developer intro]]<br />
* [[Raw_Transactions|Raw Transactions API]]<br />
* [http://blockchain.info/api/json_rpc_api Web Based JSON RPC interface.]<br />
<br />
[[Category:Technical]]<br />
[[Category:Developer]]<br />
[[zh-cn:API_reference_(JSON-RPC)]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Promotional_graphics&diff=37516Promotional graphics2013-05-04T19:35:53Z<p>Osmosis: /* Logo with text */</p>
<hr />
<div>Bitcoin-related graphics used for promoting bitcoin either for online use, retail display or other promotional purpose. For graphics in languages other than English, see [[Promotional graphics (non-English)]].<br />
<br />
==Orange style==<br />
===Logo alone===<br />
[[{{ns:file}}:BC Logo .png]]<br />
<br />
[http://weusecoins.jp/remote/en.bitcoin.it/promotional_graphics SVG and higher resolutions]<br />
<br />
===Logo with text===<br />
[[{{ns:file}}:BC Logotype.png]]<br />
<br />
[[{{ns:file}}:BC Logotype Reverse.png]]<br />
<br />
http://media.tumblr.com/tumblr_lmupioyU7M1qznjpp.png<br />
<br />
==="We love Bitcoin" Graphics===<br />
[[{{ns:file}}:Lv BCorg 128px.png]]<br />
[[{{ns:file}}:WeLv BC 48px.png]]<br />
[[{{ns:file}}:WeLv BC 128px.png]]<br />
[[{{ns:file}}:WeLv BC Badge 128px.png]]<br />
===Bitcoin Accepted Here Buttons===<br />
====Normal size====<br />
[[{{ns:file}}:BC_Rnd_64px.png]]<br />
[[{{ns:file}}:BC 64px.png]]<br />
[[{{ns:file}}:BC nBG 64px.png]]<br />
[[{{ns:file}}:BC RnBG 64px.png]]<br />
====High resolution====<br />
[[{{ns:file}}:bitcoin_accepted_here_printable.png|x200px]]<br />
<br />
==Euro style==<br />
[[{{ns:file}}:Bitcoin euro.png]]<br />
<br />
==Gold style==<br />
[[{{ns:file}}:Bitcoin.png]]<br />
<br />
==Ƀ: Another Bitcoin Identity==<br />
* [[{{ns:file}}:CircleBitcoin.png]] <br />
* [[{{ns:file}}:Pennant.png]]<br />
* [[{{ns:file}}:RibbonDonateBitcoin.png]]<br />
* [[{{ns:file}}:GoldenAcceptedHereBitcoin.png]]<br />
<br />
<br />Ƀ graphic elements are available in SVG format on the dedicated [http://www.ecogex.com/bitcoin/ project page].<br />
<br />
==External Links==<br />
<br />
* [https://bitcointalk.org/index.php?topic=64.msg7415#msg7415 New icon/logo] (SVG of the gold bitcoin / logo)<br />
* [https://bitcointalk.org/index.php?topic=4331.0 Bigger "B" versions of Bitcoin logotypes]<br />
* [https://bitcointalk.org/index.php?topic=9562.20 Ƀ Another Bitcoin identity]<br />
* [https://bitcointalk.org/index.php?topic=1631.0 More Bitcoin logos, buttons, and also some other graphics]<br />
* [https://bitcointalk.org/index.php?topic=45.msg479#msg479 Make your "we accept Bitcoin" logo]<br />
* [http://img340.imageshack.us/img340/7210/onwhitem.jpg Bitcoin Decentralized P2P Currency logo]<br />
* [http://agora.io/wp-content/uploads/2011/03/BitcoinFreeMoney250x100.png Liberty starts with free money logo]<br />
* [https://bitcointalk.org/index.php?topic=6412.0 Made a Bitcoin icon, PDF included]<br />
* [https://bitcointalk.org/index.php?topic=6455.0 In cryptography we trust (yet another Bitcoin icon)]<br />
* [http://bitbash.blogspot.com/2011/04/bitcoin-icons.html Bitcoin icons] from Bitbash<br />
* [http://lts.cr/d8d Bitcoin Graphics] zip<br />
* [http://www.promotionalcodes.org.uk/26970/what-is-bitcoin/ What is Bitcoin? (Infographic)] <br />
* [http://carbonism.deviantart.com/gallery carbonism's deviantART gallery]<br />
* [http://handsomecode.tumblr.com/post/6565610892/designing-a-better-bitcoin-identity Handsome Code Better Bitcoin]<br />
* [https://bitcointalk.org/index.php?topic=32273.0 Public Domain Bitcoin Icons/Graphics for you!]<br />
* [http://imgur.com/o5hHQ Stack of bitcoins]<br />
* [https://bitcointalk.org/?topic=1756.0 Bitcoin Graphics in Vector Format (Illustrator)]<br />
<br />
==See Also==<br />
<br />
* [[Bitcoin symbol]]<br />
<br />
[[Category:Marketing]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Talk:Block_chain&diff=37499Talk:Block chain2013-05-03T18:45:25Z<p>Osmosis: </p>
<hr />
<div>''"More serious forks have occurred after fixing bugs that required backward-incompatible changes."'' Any more infos on this? What kind of forks respective bugs were this?<br />
<br />
Describing the main orphan chains and their reason would also be useful. --[[User:Http|Http]] ([[User talk:Http|talk]]) 15:33, 1 April 2013 (GMT)<br />
<br />
<br />
It would be nice if we could start off with an explanation for a layman instead of getting super technical right away. -osmosis</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Talk:Genesis_block&diff=37498Talk:Genesis block2013-05-03T17:13:31Z<p>Osmosis: Created page with "'though this reward can't be spent due to a quirk in the way that the genesis block is expressed in the code (this may have been intentional).' Can anyone explain more about ..."</p>
<hr />
<div>'though this reward can't be spent due to a quirk in the way that the genesis block is expressed in the code (this may have been intentional).'<br />
<br />
Can anyone explain more about what the quirk was exactly?</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Category:History&diff=37281Category:History2013-04-23T22:49:47Z<p>Osmosis: </p>
<hr />
<div>== Important milestones of the Bitcoin project ==<br />
=== 2008 ===<br />
{| style="text-align: left"<br />
|-<br />
! width="8em" | August 18<br />
|| Domain name "bitcoin.org" registered<ref>[https://bitcointalk.org/index.php?topic=103369.msg1135218#msg1135218 According to theymos], Satoshi registered bitcoin.org via https://www.anonymousspeech.com/ which allows to anonymously register domains.</ref>.<br />
|-<br />
! October 31<br />
|| [http://article.gmane.org/gmane.comp.encryption.general/12588/ Bitcoin design paper] published<br />
|-<br />
! November 09<br />
|| Bitcoin project registered at SourceForge.net<br />
|}<br />
<br />
=== 2009 ===<br />
{| style="text-align: left"<br />
|-<br />
! width="8em" | January 3<br />
|| [http://www.BlockExplorer.com/b/0 Genesis block] established at 18:15:05 GMT<br />
|-<br />
! January 11<br />
|| Bitcoin v0.1 released and announced on the [http://www.mail-archive.com/cryptography@metzdowd.com/msg10152.html cryptography mailing list]<br />
|-<br />
! January 12<br />
|| First Bitcoin transaction, [http://www.BlockExplorer.com/b/170 in block 170] - from [[Satoshi]] to Hal Finney<ref>[http://bitcointalk.org/index.php?topic=91806.msg1012234#msg1012234 Earliest Block With A Spend]</ref>.<br />
|-<br />
! October 5<br />
|| Exchange rates [http://newlibertystandard.wetpaint.com/page/2009+Exchange+Rate published] by New Liberty Standard. $1 = 1,309.03 BTC (and [[User:theymos|theymos]] thought NLS was overcharging<ref>[http://bitcointalk.org/index.php?topic=104287.msg1143955#msg1143955 Historical Price Data for 2009]</ref>)<br />
|-<br />
! October 9<br />
|| #bitcoin-dev channel registered on freenode IRC.<br />
|-<br />
! December 16<br />
|| Bitcoin v0.2 released<br />
|-<br />
! December 30<br />
|| First difficulty increase at 06:11:04 GMT<br />
|}<br />
<br />
=== 2010 ===<br />
{| style="text-align: left"<br />
|-<br />
! width="8em" | February 6<br />
|| [[Bitcoin Market]] established<br />
|-<br />
! May 21<br />
|| laszlo first to buy pizza with Bitcoins agreeing upon paying 10,000 BTC for ~$25 worth of pizza courtesy of jercos<ref>[https://bitcointalk.org/index.php?topic=137.msg1195#msg1195 bitcointalk post] where laszlo confirmed having bought pizza</ref><br />
|-<br />
! July 7<br />
|| Bitcoin v0.3 released<br />
|-<br />
! July 11<br />
|| Bitcoin v0.3 release mentioned on slashdot<ref>[http://news.slashdot.org/story/10/07/11/1747245/Bitcoin-Releases-Version-03 slashdot] metiones Bitcoin</ref>, bringing a large influx of new bitcoin users.<br />
|-<br />
! July 12<br />
|| Beginning of a 10x increase in exchange value over a 5 day period, from about $0.008/BTC to $0.08/BTC<br />
|-<br />
! July 17<br />
|| [[MtGox]] established<br />
|-<br />
! July 18<br />
|| ArtForz generated his first block after establishing his personal OpenCL GPU hash farm<br />
|-<br />
! August 15<br />
|| Bug in the bitcoin code allows a bad transaction into block 74638. Users quickly adopt fixed code and the "good" block chain overtook the bad one at a block height of 74691, 53 blocks later ([[Incidents#Value_overflow]]).<br />
|-<br />
! September 14<br />
|| jgarzik [https://bitcointalk.org/index.php?topic=133.msg12921#msg12921 offered] 10,000 BTC (valued at ~$600-650) to puddinpop to open source their windows-based CUDA client<br />
|-<br />
! September 14<br />
|| Block [http://blockexplorer.com/b/79764 79,764] is first to be mined using split allocation of the generation reward.<br />
|-<br />
! September 18<br />
|| puddinpop [https://bitcointalk.org/index.php?topic=133.msg13135#msg13135 released] source to their windows-based CUDA client under MIT license<br />
|-<br />
! September 29<br />
|| kermit [https://bitcointalk.org/index.php?topic=1306.0 discovered] a microtransactions exploit which precipitated the Bitcoin v0.3.13 release<br />
|-<br />
! October 01<br />
|| First public OpenCL miner released<br />
|-<br />
! October 04<br />
|| Original Bitcoin History wiki page (this page) established (ooh so meta) on Bitcoin.org's wiki.<br />
|-<br />
! October 07<br />
|| Exchange rate started climbing up from $0.06/BTC after several flat months.<br />
|-<br />
! October 16<br />
|| First recorded escrowed bitcoin trade conducted, between nanotube and Diablo-D3, escrowed by theymos.<br />
|-<br />
! October 17<br />
|| [[Bitcoin_OTC|#bitcoin-otc]] trading channel established on freenode IRC.<br />
|-<br />
! October 28<br />
|| First bitcoin short sale transaction initiated, with a loan of 100 BTC by nanotube to [[User:Kiba|kiba]], facilitated by the [[Bitcoin-otc|#bitcoin-otc]] market.<br />
|-<br />
! November 6<br />
|| The [https://bitcointalk.org/index.php?topic=1672 Bitcoin economy passed US $1 million]. The MtGox price touched USD $0.50/BTC.<br />
|-<br />
! December 7<br />
|| Bitcoind was compiled for the Nokia N900 mobile computer by doublec. The following day, ribuck sent him 0.42 BTC in the first portable-to-portable Bitcoin transaction.<br />
|-<br />
! December 9<br />
|| The generation difficulty passed 10,000.<br />
|-<br />
|<br />
|| First bitcoin call option contract sold, from nanotube to [[User:Sgornick|sgornick]], via the [[Bitcoin-otc|#bitcoin-otc]] market.<br />
|-<br />
! December 16<br />
|| [http://mining.bitcoin.cz/ Bitcoin Pooled Mining], operated by slush, found its first block<br />
|}<br />
<br />
=== 2011 ===<br />
{| style="text-align: left"<br />
|-<br />
! width="8em" | January 2<br />
|| [[Tonal Bitcoin]] units standardized.<br />
|-<br />
! January 8<br />
|| [[History of Bitcoin]] page (this page) created after replicating from original Bitcoin History page on Bitcoin.org.<br />
|-<br />
|<br />
|| Bitcoin Pooled Mining reached a total of 10,000 Mhash/s<br />
|-<br />
! January 27<br />
|| Largest numeric value ever traded for bitcoins thus far occurred on this date. Three currency bills from Zimbabwe, known as Zimdollars, were traded on [[Bitcoin-otc|#bitcoin-otc]] at the rate of 4 BTC for each of the one-hundred trillion dollar ($100,000,000,000,000) Zimbabwe notes<ref>Serial numbers for Zimdollars sold: AA1669317, AA1669318 and AA1669319</ref><br />
|-<br />
! January 28<br />
|| Block 105000 was generated. This means that 5.25 million bitcoins have been generated, which is just over one-quarter of the eventual total of nearly 21 million.<br />
|-<br />
! February 9<br />
|| Bitcoin reached parity with the US dollar, touching $1 per BTC at [[MtGox]].<br />
|-<br />
! February 10<br />
|| Bitcoin.org website struggles to handle [https://bitcointalk.org/index.php?topic=3444.0 traffic] resulting from mentions on Slashdot<ref>[http://news.slashdot.org/story/11/02/10/189246/Online-Only-Currency-BitCoin-Reaches-Dollar-Parity Online-Only Currency BitCoin Reaches Dollar Parity]</ref>, Hacker News and Twitter following the news that parity had been reached.<br />
|-<br />
! February 14<br />
|| A vehicle was, for the first time, offered in exchange for a certain number of bitcoins<ref>[https://bitcointalk.org/index.php?topic=3485.0 Car for Sale - Australia]</ref>.<br />
|-<br />
! March 6<br />
|| Total Bitcoin network computation speed for a short time reached a new high of almost 900Ghash/sec, dropping to 500Ghash/sec soon after. Some speculate that this was due to some supercomputer or bot-net that joined the network ([http://bitcoin.atspace.com/mysteryminer.html mystery miner]).<br />
|-<br />
! March 18<br />
|| BTC/USD exchange rate reaches a 6-week low point at almost $0.70/BTC, after what appeared to be a short burst of, possibly automated, BTC sales at progressively lower prices. BTC price had been declining since the February 9 high.<br />
|-<br />
! March 25<br />
|| Difficulty decreased nearly 10%. A decrease has only occurred once before, and this decrease of nearly 10% was the largest.<br />
|-<br />
! March 27<br />
|| The first market for exchanging bitcoins to and from the British Pound Sterling BTC/GBP, [[Britcoin]], opens.<br />
|-<br />
! March 31<br />
|| The first market for exchanging bitcoins to and from Brazilian Reals, [[Bitcoin Brazil]], opens.<br />
|-<br />
! April 5<br />
|| The first market for exchanging bitcoins to and from the Polish złoty, [[BitMarket.eu]], opens.<br />
|-<br />
! April 12<br />
|| First bitcoin put option contract sold via the [[Bitcoin-otc|#bitcoin-otc]] market.<br />
|-<br />
! April 16<br />
|| TIME does [http://techland.time.com/2011/04/16/online-cash-bitcoin-could-challenge-governments/ an article on Bitcoin].<br />
|-<br />
! April 23<br />
|| BTC/USD exchange rate reaches and passes parity with the Euro (EUR) on [[MtGox]] exchange.<br />
|-<br />
|<br />
|| BTC/USD exchange rate reaches and passes parity with the British Sterling Pound (GBP) on [[MtGox]] exchange.<br />
|-<br />
|<br />
|| Value of the Bitcoin money stock at current exchange rate passes $10 million USD threshold.<br />
|-<br />
! April 27<br />
|| [[VirWoX]] opens first market to trade bitcoins against a virtual currency on BTC/SL (Second Life Lindens) exchange.<br />
|-<br />
! April 30<br />
|| The generation difficulty passed 100,000.<br />
|-<br />
! June 2<br />
|| The exchange rate at [[MtGox]] touched 10 USD per BTC.<br />
|-<br />
! June 3<br />
|| [[Tonal Bitcoin]] reached parity with the US cent, touching 1¢ per TBC at [[Bitcoin Market]].<br />
|-<br />
! June 8<br />
|| The [[MtGox]] exchange rate peaked at 31.91 USD, at a "market capitalization" of about $206 M [http://bitcoin.stackexchange.com/questions/2047/market-capitalization-over-time].<br />
|-<br />
! June 12<br />
|| The [[MtGox]] exchange rate briefly dropped to near 10 USD four days after the peak, in its largest percentage price retreat to date.<br />
|-<br />
! June 13<br />
|| Forum user allinvain claimed to have had [http://forum.bitcoin.org/index.php?topic=16457.0 25,000 BTC stolen] from his Bitcoin wallet (approx. USD equivalent $375,000).<br />
|-<br />
! June 19<br />
|| The MtGox database was compromised and the user table was leaked, containing details of 60,000 usernames, email addresses and password hashes, some of which were based on a highly vulnerable hashing algorithm.<br />
|-<br />
! June 19<br />
|| Someone was able to access an admin account at MtGox and issue sell orders for hundreds of thousands of fake bitcoins, forcing the MtGox price down from $17.51 per bitcoin to $0.01. MtGox announced that these trades would be reversed. Trading was halted at MtGox for 7 days (and also briefly at TradeHill and Britcoin while their security was reviewed).<br />
|-<br />
! June 19<br />
|| Some of the users on the leaked MtGox database had used the same username at MyBitcoin and had their passwords hacked. About 600 of them had their balance [http://forum.bitcoin.org/index.php?topic=22221.msg279396#msg279396 stolen from their MyBitcoin accounts]. One user lost over 2000 BTC.<br />
|-<br />
! June 20<br />
|| The EFF announced that it was no longer accepting Bitcoin donations due to legal uncertainties.<br />
|-<br />
! June 24<br />
|| The generation difficulty passed 1,000,000 with Block [http://blockexplorer.com/b/133056 133056].<br />
|-<br />
! July 19<br />
|| "Let it go on record that at 4:05pm CET [19 July 2011], my manager Tadek was the first person in the world to receive [testnet] Bitcoins via NFC ;)" - Mike Hearn<br />
|-<br />
! July 22<br />
|| [[BitCoins Mobile]], the first Bitcoin application for iPad was released by [http://www.intervex.net Intervex Digital].<br />
|-<br />
! July 30<br />
|| [http://pastebin.com/raw.php?i=BUB3dygQ Tribute to Len Sassaman] included in the blockchain<ref>[http://bitcointalk.org/index.php?topic=33618.msg420597#msg420597 A Tribute to Len "rabbi" Sassama]</ref>. <br />
|-<br />
! August 20<br />
|| First Bitcoin Conference and World Expo held, in NYC.<ref>[http://bitcoinme.com/index.php/conference/ New York Conference 2011]</ref><br />
|-<br />
! August 23<br />
|| [[P2Pool]], the first P2P decentralized pool, mines its first Bitcoin mainnet block (Block [http://blockexplorer.com/b/142312 142,312]).<br />
|-<br />
! August 30<br />
|| Difficulty adjustment at block [http://blockexplorer.com/b/143136 143,136] marks the first back-to-back drop.<br />
|-<br />
! November 15<br />
|| First CVE (CVE-2011-4447) assigned to a Bitcoin client exploit.<br />
|-<br />
! November 25<br />
|| First European Bitcoin Conference in Prague, Czech Rep.<ref>[http://bitgroups.org/ Prague Conference 2011]</ref><br />
|-<br />
! December 12<br />
|| Largest amount of fees, to-date, in a single transaction, and most fees in a single block. A [http://blockexplorer.com/tx/1d7749c65c90c32f5e2c036217a2574f3f4403da39174626b246eefa620b58d9 transaction] paid 171 BTC in fees in [http://blockexplorer.com/b/157235 block 157235]<ref>[http://bitcointalk.org/index.php?topic=88423.msg973509#msg973509 Largest fee ever?]</ref>.<br />
|}<br />
<br />
=== 2012 ===<br />
{| style="text-align: left"<br />
|-<br />
! width="8em" | March 1<br />
|| Largest theft of bitcoins to-date occurred (near 50K BTC) after security breach at web host Linode.<br />
|-<br />
! width="8em" | April 1<br />
|| Pay-to-script-hash ([[P2SH]]) as defined through [[BIP 0016]] goes live.<br />
|-<br />
! May 08<br />
|| A single service, [[SatoshiDICE]] becomes responsible for over half the transaction volume on the Bitcoin blockchain.<br />
|-<br />
! June 3<br />
|| Largest block (most transactions), to-date (June 3), is [http://BlockExplorer.com/b/181919 block 181919] with 1322 transactions<ref>[http://bitcointalk.org/index.php?topic=85353.msg939859#msg939859 Largest block to date]</ref>.<br />
|-<br />
! July 22<br />
|| One millionth topic reply was posted on the unofficial [[Bitcoin Forum]] <ref>[https://bitcointalk.org/index.php?topic=94608.0 Topic about one millionth forum post]</ref>.<br />
|-<br />
! September 15-16<br />
|| Bitcoin Conference in London <ref>[http://bitcoin2012.com/ London Conference 2012]</ref>.<br />
|-<br />
! September 27<br />
|| Formation of the [[Bitcoin Foundation]].<br />
|-<br />
! November 28<br />
|| Halving day. [http://blockexplorer.com/b/210000 Block 210,000] is the first with a block reward subsidy of only 25 BTC.<br />
|-<br />
! December 6<br />
|| First Bitcoin exchange [https://bitcointalk.org/index.php?topic=129461.0 licensed "as a bank" in europe] (actually a PSP which is like a bank, without debt-money issuing).<br />
|}<br />
<br />
=== 2013 ===<br />
{| style="text-align: left"<br />
|-<br />
! width="8em" | February 19<br />
|| Bitcoin Client v0.8 released featuring improved download speed and [https://en.wikipedia.org/wiki/Bloom_filter Bloom Filtering]<br />
|-<br />
! February 28<br />
|| The [[MtGox]] exchange rate broke the June 8 2011 peak of 31.91 USD. The first all time high since 601 days<br />
|-<br />
! March 12<br />
|| A previously undiscovered protocol rule results in a [http://bitcoin.org/chainfork.html hard fork of the 0.8.0 reference client].<br />
|-<br />
! March 28<br />
|| Total Bitcoin value passes $1 billion. <ref>http://spectrum.ieee.org/computing/networks/bitcoin-hits-1billion</ref><br />
|-<br />
! April 1<br />
|| Bitcoin price breaks 100 USD on [[MtGox]] and other major exchanges.<br />
|-<br />
|}<br />
<br />
==See Also==<br />
<br />
* [[Bitcoin Firsts]]<br />
* [[Press]]<br />
<br />
==References==<br />
<references /></div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Help:Introduction&diff=31796Help:Introduction2012-10-15T02:35:14Z<p>Osmosis: /* See Also */</p>
<hr />
<div>The purpose of this page is to provide a general overview of the Bitcoin system and economy.<br />
<br />
==Basic Concepts==<br />
<br />
===Currency===<br />
<br />
Alice wants to buy the [http://www.grasshillalpacas.com/alpacaproductsforbitcoinoffer.html Alpaca socks] Bob has for sale. In return, she must provide something of equal value to Bob. The most efficient way to do this is by using a medium of exchange that Bob accepts which would be classified as currency. Currency makes trade easier by eliminating the need for [http://en.wikipedia.org/wiki/Coincidence_of_wants coincidence of wants] required in other systems of trade such as barter. Currency adoption and acceptance can be global, national, or in some cases local or community-based.<br />
<br />
===Banks===<br />
<br />
Alice need not provide currency to Bob in-person. She may instead transfer this value by first giving her dollar bills to a bank who promises to store and protect Alice's dollar bills. The bank gives Alice a written promise (called a "bank statement") that entitles her to withdraw the same number of dollar bills that she deposited. Since the money is still Alice's, she is entitled to do with it whatever she pleases, and the bank (like most banks), for a small fee, will do Alice the service of "giving" the dollar bills to Bob instead of her. This is done by Alice's bank by giving the dollar bills to Bob's bank and informing them that the money is for Bob, who will then see the amount the next time he checks his balance or receives his bank statement.<br />
<br />
Since banks have many customers, and bank employees require money for doing the job of talking to people and signing documents, banks in recent times have been using machines such as ATMs and web servers that do the job of interacting with customers instead of paid bank employees. The job of these machines is to learn what each customer wants to do with their money and, to the extent that it is possible, act on what the customer wants (for example, ATMs can hand out cash). Customers can always know how much money they have in their accounts, and they are confident that the numbers they see in their bank statements and on their computer screens accurately reflect the number of dollars that they can get from the bank on demand. They can be so sure of this that they can accept those numbers in the same way they accept paper dollars (this is similar to the way people started accepting paper dollars when they had been accepting gold or silver).<br />
<br />
Such a system has several disadvantages:<br />
* It is costly. EFTs in Europe can cost 25 euros. Credit transactions can cost several percent of the transaction.<br />
* It is slow. Checking and low cost wire services take days to complete.<br />
* In most cases, it cannot be anonymous.<br />
* Accounts can be frozen. <br />
* Banks and other payment processors like PayPal, Visa, and Mastercard may refuse to process payments for legal entities. <br />
<br />
<br />
Bitcoin is a system of owning and voluntarily transferring amounts of so-called ''bitcoins'', in a manner similar to an on-line banking, but pseudonymously and without reliance on a central authority to maintain account balances. If bitcoins are valuable, it is because they are useful and limited in supply.<br />
<br />
==Bitcoin Basics==<br />
<br />
===Creation of coins===<br />
The creation of coins must be limited for the currency to have any value. <br />
<br />
New coins are slowly [[Mining|mined]] into existence by following a mutually agreed-upon set of rules. A user [[Mining|mining]] bitcoins is running a program that searches tirelessly for a solution to a very difficult math problem whose difficulty is precisely known. The difficulty is automatically adjusted regularly so that the number of solutions found globally, by everyone, is constant: an average of 6 per hour. When a solution is found, the user may tell everyone of the existence of this newly found solution, along with other information, packaged together in what is called a "[[Block|block]]". <br />
<br />
Blocks contain 50 bitcoins at present. This amount, known as the block reward, is an incentive for people to perform the computation work required for block generation. Roughly every 4 years, the number of bitcoins that can be "mined" in a block reduces by 50%. Any block that is created by a malicious user that does not follow this rule (or any other rules) will be rejected by everyone else. The result is that no more than 21 million bitcoins will ever exist. <br />
<br />
Because the block reward will decrease over the long term, miners will some day instead pay for their hardware and electricity costs by collecting [[Transaction_fee|transaction fees]]. The sender of money may voluntarily pay a small transaction fee which will be kept by whoever finds the next block. Paying this fee will encourage miners to include the transaction in a block more quickly.<br />
<br />
===Sending payments===<br />
To guarantee that a third-party, Eve, cannot spend other people's bitcoins by creating transactions in their names Bitcoin uses [[Wikipedia:Public-key_cryptography|public key cryptography]] to make and verify digital signatures. In this system, each person, such as Alice or Bob, has one or more addresses each with an associated pair of public and private keys that they may hold in a [[Wallet|wallet]]. Only the user with the private key can sign a transaction to give some of their bitcoins to somebody else, but anyone can validate the signature using the user’s public key.<br />
<br />
Suppose Alice wants to send a bitcoin to Bob.<br />
* Bob sends his address (from which the public key can be derived) to Alice.<br />
* Alice adds Bob’s public key and the amount of bitcoins to transfer to a message: a 'transaction' message.<br />
* Alice signs the transaction with her private key.<br />
* Alice broadcasts the transaction on the Bitcoin network for all to see.<br />
<br />
(Only the first two steps require human action. The rest is done by the Bitcoin client software.)<br />
<br />
Looking at this transaction from the outside, anyone who knows that these addresses belong to Alice and Bob can see that Alice has agreed to transfer the amount to Bob, because nobody else has Alice's private key. Alice would be foolish to give her private key to other people, as this would allow them to sign transactions in her name, removing funds from her control.<br />
<br />
Later on, when Bob wishes to transfer the same bitcoins to Charley, he will do the same thing:<br />
* Charlie sends Bob his address.<br />
* Bob adds Charlie's public key and the amount of bitcoins to transfer to a message: a 'transaction' message.<br />
* Bob signs the transaction with his private key.<br />
* Bob broadcasts the transaction on the Bitcoin network for all to see. <br />
<br />
Only Bob can do this because only he has the private key that can create a valid signature for the transaction. <br />
<br />
Eve cannot change who the coins belong to by replacing Bob’s public key with her public key because Alice signed the transfer to Bob using her private key, declaring that the coins which belonged to her now belong to Bob, and Alice's private key is kept secret from Eve. So if Charlie accepts that the original coin was in the hands of Alice he will also accept the fact that this coin was later passed to Bob and now Bob is passing this same coin to him.<br />
<br />
===Preventing [[double-spending]]===<br />
The process described above does not prevent Alice from using the same bitcoins in more than one transaction. The following process does. This is the primary innovation behind Bitcoin.<br />
<br />
* Details about the [[Transactions|transaction]] are [[Network|sent and forwarded]] to all or as many other computers as possible.<br />
* A constantly growing chain of [[Blocks|blocks]] that contains a record of all transactions is collectively maintained by all computers (each has a full copy).<br />
* To be accepted in the chain, transaction blocks must be valid and must include [[proof of work]] (one block generated by the network every 10 minutes).<br />
* Blocks are chained in a way so that, if any one is modified, all following blocks will have to be recomputed.<br />
* When multiple valid continuations to this chain appear, only the longest such branch is accepted and it is then extended further.<br />
<br />
When Bob sees that his transaction has been included in a block, which has been made part of the single longest and fastest-growing block chain (extended with significant computational effort), he can be confident that the transaction by Alice has been accepted by the computers in the network and is permanently recorded, preventing Alice from creating a second transaction with the same coin. In order for Alice to thwart this system and double-spend her coins, she would need to muster more computing power than all other Bitcoin users combined.<br />
<br />
===Anonymity===<br />
When it comes to the Bitcoin network itself, there are no "accounts" to set up and no e-mail addresses, user-names or passwords are required to hold or spend bitcoins. Each balance is simply associated with an address and its public-private key pair. The money "belongs" to anyone who has the private key and can sign transactions with it. Moreover, those keys do not have to be registered anywhere in advance, as they are only used when required for a transaction. Transacting parties do not need to know each other's identity in the same way that a store owner does not know a customer's name who pays with cash.<br />
<br />
A [[Address|Bitcoin address]] mathematically corresponds to a public key and looks like this:<br />
<br />
:1PC9aZC4hNX2rmmrt7uHTfYAS3hRbph4UN<br />
<br />
Each person can have many such addresses, each with its own balance, which makes it very difficult to know which person owns what amount. In order to protect his [[Anonymity|privacy]], Bob can generate a new public-private key pair for each individual receiving transaction and the Bitcoin software encourages this behavior by default. Continuing the example from above, when Charlie receives the bitcoins from Bob, Charlie will not be able to identify who owned the bitcoins before Bob without further information.<br />
<br />
===Capitalization / Nomenclature===<br />
Since Bitcoin is both a currency and a protocol, capitalization of Bitcoin can be confusing. Generally accepted pracitice is to use Bitcoin (singular, with upper case letter b) to describe the protocol, network, and software, and bitcoin(s) (singular or plural, with lower case letter b) to describe actual bitcoins, as generated by computers. For example, you may have some bitcoins but when you run the program you are using Bitcoin.<br />
<br />
==Where to see and explore==<br />
You can directly explore the system in action by visiting [http://blockchain.info/ Blockchain.info] or [http://blockexplorer.com/ Bitcoin Block Explorer].<br />
The site shows you the latest blocks in the block chain. The [[Block_chain|block chain]] contains the agreed history of all transactions that took place in the system.<br />
Note how many blocks were generated in the last hour, which on average will be 6. Also notice the number of transactions and the total amount transferred in the last hour (last time I checked it was about 64 and 15K).<br />
This should give you an indication of how active the system is.<br />
<br />
Next, navigate to one of these blocks.<br />
The block's [[hash|hash]] begins with a run of zeros. This is what made creating the block so difficult; a hash that begins with many zeros is much more difficult to find than a hash with few or no zeros. The computer that generated this block had to try many ''Nonce'' values (also listed on the block's page) until it found one that generated this run of zeros.<br />
Next, see the line titled ''Previous block''. Each block contains the hash of the block that came before it. This is what forms the chain of blocks.<br />
Now take a look at all the transactions the block contains. The first transaction is the income earned by the computer that generated this block. It includes a fixed amount of coins created out of "thin air" and possibly a fee collected from other transactions in the same block.<br />
<br />
Drill down into any of the transactions and you will see how it is made up of one or more amounts coming in and out.<br />
Having more than one incoming and outgoing amount in a transaction enables the system to join and break amounts in any possible way, allowing for any fractional amount needed. Each incoming amount is a past transaction (which you can also view) from someone's address, and each outgoing amount is addressed to someone and will be part of a future transaction (which you can also navigate down into if it has already taken place.)<br />
<br />
Finally you can follow any of the [[Address|addresses]] links and see what public information is available for them.<br />
<br />
To get an impression of the amount of activity on the Bitcoin network, you might like to visit the monitoring websites [[Bitcoin Monitor]] and [[Bitcoin Watch]]. The first shows a real-time visualization of events on the Bitcoin network, and the second lists general statistics on the amount and size of recent transactions.<br />
<br />
===How many people use Bitcoin?===<br />
<br />
This is quite a difficult question to answer accurately. One approach is to count how many bitcoin clients connected to the network in the last 24 hours. We can do this because some clients transmit their addresses to the other members of the network periodically. In September 2011 this method suggested that there were about 60,000 users.<br />
<br />
==See Also==<br />
<br />
* [http://www.youtube.com/watch?v=Um63OQz3bjo What is Bitcoin?] video introduction<br />
* Installing Bitcoin [[getting started]] <br />
* [[How bitcoin works]]<br />
* [[Using Bitcoin]]<br />
* A gentle introduction to Bitcoin - [[BitcoinMe]]<br />
* [http://coinlab.com/2011/12/bitcoin-primer Bitcoin Primer] from CoinLab<br />
* Another introduction, ''The Rebooting Of Money'' podcast is found at [[Bitcoin Money]]<br />
* A beginner's step-by-step guide to using Bitcoin, use of alternative wallets, and generally keeping your money and computer secure - [http://BitcoinIntro.com BitcoinIntro.com]<br />
* [http://howtobitcoin.info howtobitcoin.info] Directory of bitcoin links for beginners<br />
<br />
[[zh-cn:简介]]<br />
<br />
[[de:Einführung]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Buying_Bitcoins_(the_newbie_version)&diff=28965Buying Bitcoins (the newbie version)2012-07-22T17:09:46Z<p>Osmosis: </p>
<hr />
<div>This page aims to be the best resource for new users to understand how to buy Bitcoins.<br />
The existing [[Buying bitcoins]] page is too complex, and not noob-friendly.<br />
<br />
== Intro ==<br />
[http://bitcoin.stackexchange.com/questions/2293/how-can-i-buy-bitcoin-via-a-credit-card-or-paypal You can't reliably buy Bitcoins using PayPal or credit cards], because it is risky for the seller, and therefore few sellers will offer this. There are several ways, depending on your location. Many sellers online will trade bitcoins for moneypak codes. See http://www.moneypak.com/<br />
<br />
=== Finding a direct seller ===<br />
If you can find another person that is willing to sell them to you, you can transfer him money via whatever method (including PayPal), and he'll send you the Bitcoins. One place to look for people willing to sell is [[Bitcoin OTC]]. Some good websites for people to connect locally for bitcoin trade are http://localbitcoins.com/ and https://www.bitcoinary.com/<br />
<br />
Many Bitcoin users will accept cash in the mail for small amounts of Bitcoin.<br />
<br />
=== Physical locations ===<br />
Depending on your country, you might be able to [https://bitcointalk.org/index.php?topic=83209.0;all simply walk into a store and buy them in a retail setting (Cash/credit card)].<br />
<br />
=== Exchanges / Bitinstant ===<br />
You can buy Bitcoins via [[Buying_bitcoins#Major_Exchanges|an Exchange]] or [[BitInstant]].<br />
<br />
Here is a video tutorial explaining BitInstant: http://vimeo.com/44849463<br />
<br />
== Links ==<br />
* http://bitcoin.stackexchange.com/questions/91/how-do-you-obtain-bitcoins<br />
* http://bitcoin.stackexchange.com/questions/4194/whats-the-best-way-to-buy-bitcoin-noob-friendly<br />
* [[Buying bitcoins]]<br />
* http://www.reddit.com/r/Bitcoin/comments/nzg4o/the_canonical_newbie_guide_to_bitcoin/c3d5tmc<br />
<br />
[[Category:Introduction]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Buying_Bitcoins_(the_newbie_version)&diff=28964Buying Bitcoins (the newbie version)2012-07-22T17:08:46Z<p>Osmosis: </p>
<hr />
<div>This page aims to be the best resource for new users to understand how to buy Bitcoins.<br />
The existing [[Buying bitcoins]] page is too complex, and not noob-friendly.<br />
<br />
== Intro ==<br />
[http://bitcoin.stackexchange.com/questions/2293/how-can-i-buy-bitcoin-via-a-credit-card-or-paypal You can't reliably buy Bitcoins using PayPal or credit cards], because it is risky for the seller, and therefore few sellers will offer this. There are several ways, depending on your location.<br />
<br />
=== Finding a direct seller ===<br />
If you can find another person that is willing to sell them to you, you can transfer him money via whatever method (including PayPal), and he'll send you the Bitcoins. One place to look for people willing to sell is [[Bitcoin OTC]]. Some good websites for people to connect locally for bitcoin trade are http://localbitcoins.com/ and https://www.bitcoinary.com/<br />
<br />
Many Bitcoin users will accept cash in the mail for small amounts of Bitcoin.<br />
<br />
=== Physical locations ===<br />
Depending on your country, you might be able to [https://bitcointalk.org/index.php?topic=83209.0;all simply walk into a store and buy them in a retail setting (Cash/credit card)].<br />
<br />
=== Exchanges / Bitinstant ===<br />
You can buy Bitcoins via [[Buying_bitcoins#Major_Exchanges|an Exchange]] or [[BitInstant]].<br />
<br />
Here is a video tutorial explaining BitInstant: http://vimeo.com/44849463<br />
<br />
== Links ==<br />
* http://bitcoin.stackexchange.com/questions/91/how-do-you-obtain-bitcoins<br />
* http://bitcoin.stackexchange.com/questions/4194/whats-the-best-way-to-buy-bitcoin-noob-friendly<br />
* [[Buying bitcoins]]<br />
* http://www.reddit.com/r/Bitcoin/comments/nzg4o/the_canonical_newbie_guide_to_bitcoin/c3d5tmc<br />
<br />
[[Category:Introduction]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Fallback_Nodes&diff=28058Fallback Nodes2012-06-23T02:21:10Z<p>Osmosis: /* IPv4 Nodes */</p>
<hr />
<div>This is a list of nodes which are considered reliable. <del>Nodes from this list which are down for more than 24 hours will be automatically removed and status of each node is displayed and updated every hour by [[User:WikiBot|WikiBot]] </del>.<br />
'''Wikibot is currently malfunctioning and is incorrectly marking nodes running version 0.6 as being down'''.<br />
<br />
== How to use this list ==<br />
<br />
=== Connect to nodes ===<br />
<br />
You can connect to these nodes with the ''-addnode=ip'' switch instead of the usual node harvesting process (through IRC or via the embedded nodelist). You can connect to more than one node by using ''-addnode=ip'' more than once. It is usually a good idea to connect to more than one of these nodes.<br />
<br />
==== Nodes without a fixed ip ====<br />
<br />
If the node IP is not fixed (see "Fixed" column), you will have to resolve the node's name (first column) each time the IP changes. Some nodes may have their ip change once a day, some others once a month, and some others may stay on the same IP for years. Still, as long as the IP is not fixed, there is no guarantee it will stay the same.<br />
<br />
In order to enable hostname lookups for the ''-addnode'' and ''-connect'' parameters, you must additionally provide the ''-dns'' parameter. Example:<br />
bitcoind -dns -addnode=bitcoin.es<br />
<br />
Versions prior to 0.3.22 do not support hostnames to the ''-addnode'' parameter, so you must do the resolving part for it. For example on linux:<br />
bitcoind -addnode=$(dig +short bitcoin.es)<br />
<br />
=== IP Transactions ===<br />
<br />
You can also send [[IP Transactions]] to these nodes. If you include your bitcoin address in the "message" field, you may have your coins back.<br />
<br />
=== Tor network ===<br />
<br />
To use tor .onion addresses ([[Fallback_Nodes#Tor_nodes|listed below]]), you will need to map virtual ips via the ''torrc'' file:<br />
<br />
mapaddress 192.0.2.2 vso3r6cmjoomhhgg.onion<br />
mapaddress 192.0.2.3 sjdntqu5roj4q6lo.onion<br />
<br />
And then put these IPs in your bitcoin.conf (or run bitcoin with -connect).<br />
<br />
connect=192.0.2.2<br />
connect=192.0.2.3<br />
<br />
You can use any arbitrary IP addresses with MapAddress, though some of the common non-routable ranges (10.*, 192.168.*) will not work due to a Bitcoin bug (reference?). 192.0.2.1-192.0.2.255 is the recommended range because it is both non-routable and compatible with Bitcoin.<br />
<br />
If you would like to use these nodes in addition to the hard-coded node list in the client, you can substitute "connect" with "addnode". However, if you want to keep all your Bitcoin communication strictly within the Tor network, it is recommended that you use "connect."<br />
<br />
Additional suggested settings for hidden node operators:<br />
<br />
noirc=1<br />
upnp=0<br />
listen=1<br />
<br />
== Nodes list ==<br />
<br />
=== IPv4 Nodes ===<br />
'''Wikibot is currently malfunctioning and is incorrectly marking nodes running 0.6 as being down'''.<br />
{|class="wikitable sortable"<br />
! Hostname !! Owner !! IP !! Fixed !! Status !! Last Seen (GMT) !! Accepts IP transactions<br />
|-<br />
<!-- BEGIN NODELIST --><br />
| btc.turboadmin.com || osmosis || 98.143.152.14 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || No<br />
|-<br />
| 79.160.221.140 || K-Norway || 79.160.221.140 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| netzbasis.de || unknown3 || 81.169.129.25 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| bauhaus.csail.mit.edu || imsaguy || 128.30.96.44 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| jun.dashjr.org || Luke-Jr || 173.242.112.53 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || <br />
|-<br />
| 178.32.7.171 || temporary-april-2012 || 178.32.7.171 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| cheaperinbitcoins.com || Xenland/Shane || 184.154.36.82 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| django.webflows.fr || unknown2 || 188.165.213.169 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| 204.9.55.71 || toasty || 204.9.55.71 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| progressbar.sk || Progressbar hackerspace || 91.210.181.21 || {{Table Value No}} || {{Fallback Nodes/Node Down}} || || Yes<br />
|-<br />
| btcnode.novit.ro || ovidiusoft - novit.ro || 93.187.142.114 || {{Table Value No}} || {{Fallback Nodes/Node Down}} || || Yes<br />
<!-- END NODELIST --><br />
|}<br />
<br />
There is a list of nodes which have been seen on the network recently at http://blockchain.info/connected-nodes<br />
<br />
=== Tor nodes ===<br />
<br />
{|class="wikitable sortable"<br />
! Hostname !! Owner !! Status !! Last Seen (GMT) !! Accepts IP transactions<br />
|-<br />
| btc4ulpftizx5b72.onion || TorNode || up || 2012-06-22 || Yes<br />
|-<br />
| 7hxvg2lvr2ashzli.onion || Tuxavant || up || 2012-05-19 || ?<br />
|-<br />
| siqdznszjf4e6v5j.onion || Tuxavant || up || 2012-05-19 || ?<br />
|-<br />
| fpt6orohw2nuf2kn.onion || Tril || up || 2012-05-19 || No<br />
|-<br />
| vso3r6cmjoomhhgg.onion || echelon || up || 2012-05-19 || Yes<br />
|-<br />
| sjdntqu5roj4q6lo.onion || torservers || up || 2012-05-19 || ?<br />
|-<br />
| bitcoin2bkgm3fke.onion || ? || down || 2012-05-19 || Yes<br />
|-<br />
| ijzt2eeizty3p5xe.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| j43z65b6r2usg3vk.onion || Dybbuk || ? || 2011-02-11 || Yes<br />
|-<br />
| pvuif6nonbhj3o3r.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| c5qvugpewwyyy5oz.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| bitcoinbudtoeks7.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| iy6ni3wkqazp4ytu.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| h4kklwodpcmo6cbq.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| vv6kcfscuntybrzm.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| nlnsivjku4x4lu5n.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| xqzfakpeuvrobvpj.onion || ? || ? || 2010-11-13 || No<br />
|-<br />
| 4lmduyac3svgrrav.onion || ? || ? || 2011-02-11 || No<br />
|-<br />
| usasx4urod3yj4az.onion || ? || ? || 2011-02-11 || No<br />
|-<br />
| sh4ep6zb6vnoa2h5.onion || Gmaxwell || ? || 2011-10-29 || No<br />
|-<br />
| e3tn727fywnioxrc.onion || ? || ? || 2011-11-01 || No<br />
|-<br />
| p2hwc26zdsrqxiix.onion || redemerald || up || 2012-05-25 || No<br />
|-<br />
| bxfna6fhddpzduck.onion || ? || ? || ? || ?<br />
|-<br />
| kjy2eqzk4zwi5zd3.onion || sipa || up || 2012-05-21 || No<br />
|-<br />
| mutqcuh7hwxmhx3k.onion || Xirafe || up || 2012-05-21 || ?<br />
|}<br />
<br />
== Adding a node ==<br />
<br />
Before adding yourself as a fallback node, you should be sure your node will stay online for a long time. If a node is offline for more than 24 hours it will be removed from the list.<br />
<br />
To add a node in this list, you just need the ip/hostname and your name, the other fields will be filled automatically. Insert the following lines before the <tt>END NODELIST</tt> line:<br />
<br />
<nowiki>|-<br />
| ip || your name</nowiki><br />
<br />
==See Also==<br />
<br />
* [[Network|Bitcoin Network]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Python_Bitcoinclient&diff=27513Python Bitcoinclient2012-06-06T22:59:45Z<p>Osmosis: added electrum links</p>
<hr />
<div>A Python client for bitcoind’s JSON-RPC interface.<br />
<br />
This is free software licensed unter the terms of the GNU General Public License version 3 or later (GPLv3+).<br />
<br />
This client does not require any external dependencies, it uses the httplib and json modules from the Python standard library.<br />
<br />
==See Also==<br />
<br />
* [[Original Bitcoin client]]<br />
* [[Spesmilo]]<br />
* [[Electrum]]<br />
<br />
==External Links==<br />
<br />
* [https://gitorious.org/bitcoinclient Bitcoinclient] project page at gitorious<br />
* [http://ecdsa.org/electrum/ Electrum]<br />
* [https://gitorious.org/electrum Electrum code on gitorius]<br />
<br />
[[Category:User Interfaces]]<br />
[[Category:Open Source]][[Category:GPLv3+]]<br />
[[Category:Frontends]]<br />
[[Category:Python]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=MtGox/API&diff=22425MtGox/API2012-01-18T10:09:04Z<p>Osmosis: Undo revision 22424 by Osmosis (talk)</p>
<hr />
<div>The [[MtGox]] API provides methods to access information from the market, place orders, and more.<br />
<br />
Two APIs are currently available: the HTTP API (available by posting to mtgox.com/code/*) and the websocket API.<br />
<br />
==Number Formats==<br />
<br />
In the "old API", currency- and amount-values (price, volume,...) were given as '''float'''. These values are likely being deprecated and replaced by fields of the same name with "_int" as suffix. These are '''fixed-decimal''', so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.<br />
<br />
In order to convert the '''int''' to a '''decimal''' you can...<br />
<br />
{| class="wikitable"<br />
|-<br />
! kind of field !! ...divide by !! ...multiply by<br />
|-<br />
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001<br />
|-<br />
| USD (price) || 1E5 (100,000) || 0.00001<br />
|-<br />
| JPY (price) || 1E3 (1,000) || 0.001<br />
|}<br />
<br />
Implementation advice: it's probably best to use '''int''' or '''Decimal''' (if your language/db offers such a type) in your clients. Using '''float''' will likely lead to nasty rounding problems.<br />
<br />
== Currency Symbols ==<br />
List of the currency symbols available with the API:<br />
<br />
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB<br />
<br />
== HTTP API ==<br />
This API is available in <nowiki>https://mtgox.com/api/*</nowiki>, and provides various informations. It also supports making an order, a withdraw, a deposit, etc. There is also a [https://rubygems.org/gems/mtgox Ruby gem] and [[Finance::MtGox|Perl module]] for interacting with the HTTP API.<br />
<br />
=== Authentication ===<br />
<br />
<br />
Authentication is performed by signing each request using HMAC-SHA512. The request must contain an extra value "nonce" which must be an always incrementing numeric value. A reference implementation is provided here:<br />
<source lang="php"><br />
<?php<br />
<br />
function mtgox_query($path, array $req = array()) {<br />
// API settings<br />
$key = '';<br />
$secret = '';<br />
<br />
// generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems<br />
$mt = explode(' ', microtime());<br />
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);<br />
<br />
// generate the POST data string<br />
$post_data = http_build_query($req, '', '&');<br />
<br />
// generate the extra headers<br />
$headers = array(<br />
'Rest-Key: '.$key,<br />
'Rest-Sign: '.base64_encode(hash_hmac('sha512', $post_data, base64_decode($secret), true)),<br />
);<br />
<br />
// our curl handle (initialize if required)<br />
static $ch = null;<br />
if (is_null($ch)) {<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');<br />
}<br />
curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/'.$path);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);<br />
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br />
<br />
// run the query<br />
$res = curl_exec($ch);<br />
if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));<br />
$dec = json_decode($res, true);<br />
if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists');<br />
return $dec;<br />
}<br />
<br />
// example 1: get infos about the account, plus the list of rights we have access to<br />
var_dump(mtgox_query('0/info.php'));<br />
<br />
// old api (get funds)<br />
var_dump(mtgox_query('0/getFunds.php'));<br />
<br />
// trade example<br />
// var_dump(mtgox_query('0/buyBTC.php', array('amount' => 1, 'price' => 15)));<br />
</source><br />
<br />
Python version here: https://bitcointalk.org/index.php?topic=49789.msg592388#msg592388<br />
<br />
=== Cache ===<br />
<br />
All of the API methods below have cached results, ticker, depth . . . have a 10 seconds cache .<br />
No need to poll more often, you wont have more results, you could just be blocked by the prolexic anti ddos features.<br />
<br />
=== Methods API version 0===<br />
<br />
==== 0/data/getTrades.php ====<br />
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.<br />
<br />
Parameters:<br />
* since: Passing a tid in "since" allows retrieving all trades since that trade. The passed id is may not exist. Ie. to get all trades from the very beginning one would just call https://mtgox.com/code/data/getTrades.php?since=0 . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since.<br />
<br />
* data is returned in standard json format like :<br />
<source lang="php"><br />
[<br />
{"date":1279408157,<br />
"price":"0.04951",<br />
"amount":"20",<br />
"price_int":"4951",<br />
"amount_int":"2000000000",<br />
"tid":"1",<br />
"price_currency":"USD",<br />
"item":"BTC",<br />
"trade_type":""<br />
"primary":"Y"<br />
},<br />
{"date":1279424586,"price":"0.05941","amount":"50.01","price_int":"5941","amount_int":"5001000000","tid":"2","price_currency":"USD","item":"BTC","trade_type":""}]<br />
</source><br />
<br />
==== 0/getDepth.php ====<br />
Get the current Market depth<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=AUD<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=USD<br />
<br />
==== 0/getFunds.php ====<br />
Get your current balance<br />
<br />
https://mtgox.com/api/0/getFunds.php<br />
<br />
getfunds is now deprecated since multi currency, please use info.php<br />
<br />
==== 0/buyBTC.php ====<br />
Place an order to Buy BTC<br />
<br />
https://mtgox.com/api/0/buyBTC.php<br />
<br />
POST data: amount=#&price=#&Currency=PLN<br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/sellBTC.php ====<br />
Place an order to Sell BTC<br />
<br />
https://mtgox.com/api/0/sellBTC.php<br />
<br />
POST data: &amount=#&price=#&Currency=PLN <br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/getOrders.php ====<br />
Fetch a list of your open Orders<br />
<br />
https://mtgox.com/api/0/getOrders.php<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
status: 1 for active, 2 for not enough funds<br />
<br />
==== 0/cancelOrder.php ====<br />
Cancel an order<br />
<br />
https://mtgox.com/api/0/cancelOrder.php<br />
<br />
POST data: oid=#&type=#<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
==== 0/redeemCode.php ====<br />
Used to redeem a mtgox coupon code<br />
<br />
https://mtgox.com/api/0/redeemCode.php<br />
<br />
* call with a post parameter "code" containing the code to redeem<br />
<br />
* it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status<br />
<br />
==== 0/withdraw.php ====<br />
withdraw / Send BTC<br />
<br />
https://mtgox.com/api/0/withdraw.php<br />
<br />
POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#<br />
<br />
* pass btca parameter to withdraw to a btc adress<br />
<br />
* pass group1 for a coupon : BTC2CODE or USD2CODE<br />
<br />
* pass group1=DWUSD&dwaccount=XXX-XXX-XXXX (no btca=xxxxxxx) for a dwolla withdraw<br />
<br />
* pass green=1 to use the new greenaddress feature ( see [[GreenAddress]] )<br />
* return code and status if successful<br />
<br />
To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )<br />
<br />
==== 0/btcAddress.php ====<br />
get a bitcoin deposit adress for your account <br />
<br />
https://mtgox.com/api/0/btcAddress.php<br />
<br />
* pass POST data "description" to add a description that will appear in your history when this BTC address receive a deposit<br />
<br />
* returns a bitcoin deposit address<br />
<br />
==== 0/history_[CUR].csv ====<br />
<br />
Allows downloading your activity history for a given currency (BTC or USD for now).<br />
<br />
https://mtgox.com/api/0/history_BTC.csv<br />
<br />
https://mtgox.com/api/0/history_USD.csv<br />
<br />
encoding is utf-8<br />
<br />
==== 0/info.php ====<br />
<br />
https://mtgox.com/api/0/info.php<br />
<br />
returns info about your account, funds, fees, API privileges, withdraw limits . . . <br />
<br />
==== 0/ticker ====<br />
<br />
http://mtgox.com/api/0/data/ticker.php<br />
<br />
returns the current ticker :<br />
<br />
<source lang="php"><br />
{"ticker":<br />
{<br />
"high":5.70653,<br />
"low":5.4145,<br />
"avg":5.561388723,<br />
"vwap":5.610932845,<br />
"vol":55698,<br />
"last":5.56915,<br />
"buy":5.51326,<br />
"sell":5.5672<br />
}<br />
}<br />
</source><br />
<br />
the time frame for high, low, vol, avg, vwap . . . is sliding 24 hours<br />
<br />
what is vwap ? <br />
<br />
please see http://en.wikipedia.org/wiki/VWAP<br />
<br />
=== API version 0 examples ===<br />
<br />
==== all api shell type CLI ====<br />
<br />
python : http://www.goxsh.info/<br />
<br />
perl : http://pastebin.com/vEpgw5nW<br />
<br />
==== other ====<br />
<br />
https : http://stackoverflow.com/questions/7046370/https-request-with-boost-asio-and-openssl<br />
<br />
https://github.com/sje397/mtgox-plasmoid<br />
<br />
module perl : http://search.cpan.org/~mndrix/Finance-MtGox-0.02/<br />
<br />
==== gather data ====<br />
<br />
https://github.com/Lexiks/MyBitBoard<br />
<br />
==== gettrade ====<br />
<br />
bash : https://bitcointalk.org/index.php?topic=39402.0<br />
<br />
perl : http://pastebin.com/raw.php?i=pmhMXZJu<br />
<br />
==== ticker ====<br />
<br />
http://pastebin.com/pd0ZR4WY<br />
<br />
=== Methods API version 1===<br />
<br />
==== Multi Currency Ticker ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/ticker<br />
https://mtgox.com/api/1/BTCEUR/public/ticker<br />
<br />
returns the current ticker for the selected currency :<br />
<br />
<source lang="php"><br />
{<br />
"result":"success",<br />
"return":<br />
{<br />
"high": {"value":"5.70653","value_int":"570653","display":"$5.70653","currency":"USD"},<br />
"low": {"value":"5.4145","value_int":"541450","display":"$5.41450","currency":"USD"},<br />
"avg": {"value":"5.561119626","value_int":"556112","display":"$5.56112","currency":"USD"},<br />
"vwap": {"value":"5.610480461","value_int":"561048","display":"$5.61048","currency":"USD"},<br />
"vol":<br />
{<br />
"value":"55829.58960346",<br />
"value_int":"5582958960346",<br />
"display":"55,829.58960346\u00a0BTC",<br />
"currency":"BTC"<br />
},<br />
"last_local":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last_orig":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"buy":{"value":"5.53587","value_int":"553587","display":"$5.53587","currency":"USD"},<br />
"sell":{"value":"5.56031","value_int":"556031","display":"$5.56031","currency":"USD"}<br />
}<br />
</source><br />
<br />
note : last_local include only the last trade in the selected currency, last_orig include data of the original last trade ( currency,price in currency . . . ),last can be a conversion of the last trde in another currency<br />
<br />
==== Multi Currency depth ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/depth?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/depth?raw<br />
<br />
==== Multi currency trades ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/trades?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/trades?raw<br />
<br />
to get only the trades since a given trade id, you can add the parameter since=<trade_id><br />
<br />
https://mtgox.com/api/1/BTCUSD/public/trades?since=0<br />
<br />
https://mtgox.com/api/1/BTCEUR/public/trades?since=1316312781670700<br />
<br />
For multi currency,also returns the primary value,"Y" or "N", the primary currency is always the buyers currency<br />
<br />
A trade can appear in more than one currency, to ignore duplicates, use only the trades having primary =Y<br />
<br />
example of returned data : <br />
<source lang="php"><br />
{"date":1316312781,<br />
"price":"3.5599",<br />
"amount":"3.6900096",<br />
"price_int":"355990",<br />
"amount_int":"369000960",<br />
"tid":"1316312781670700",<br />
"price_currency":"EUR",<br />
"item":"BTC",<br />
"trade_type":"bid",<br />
"primary":"Y",<br />
"properties":"limit,mixed_currency"<br />
}<br />
</source><br />
<br />
==== Cancelled Trades ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/cancelledtrades<br />
<br />
returns a list of all the cancelled trades this last month, list of trade ids in json format .<br />
<br />
==== Full Depth ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/fulldepth<br />
<br />
returns full depth<br />
<br />
==== Private info ====<br />
<br />
https://mtgox.com/api/1/generic/private/info<br />
<br />
returns information about your account, funds, fees, API privileges, withdraw limits . . .<br />
<br />
==== Your open orders ====<br />
<br />
https://mtgox.com/api/1/generic/private/orders<br />
<br />
returns information about your current open orders<br />
<br />
==== Submit an order ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/private/order/add<br />
<br />
parameters: <br />
* type (bid|ask)<br />
* amount_int <amount as int><br />
* price_int <price as int> (can be omitted to place market order)<br />
<br />
submits an order and returns info about success or error<br />
<br />
==== Currency information ====<br />
<br />
https://mtgox.com/api/1/generic/public/currency<br />
<br />
pass parameter ?currency=<currency_symbol><br />
<br />
returns information about a currency ( number of decimals . . . )<br />
<br />
==== HOTP key ====<br />
<br />
https://mtgox.com/api/1/generic/public/hotp_gen<br />
<br />
used to generate a new HOTP key ( useful for developpers )<br />
<br />
== Streaming API ==<br />
Real time streaming data may be obtained over the streaming API, implemented in [http://socket.io/ Socket.io]<ref>Socket.io forum announcement by MagicalTux: https://bitcointalk.org/index.php?topic=14412.msg613271#msg613271</ref>. The original WebSocket API<ref>Original WebSocket thread: https://bitcointalk.org/index.php?topic=5855.msg86219</ref> is deprecated as of 11-Nov-2011.<br />
<br />
===Connecting===<br />
The following JavaScript code establishes a connection in the browser:<br />
<source lang="javascript"><br />
<script src="https://socketio.mtgox.com/socket.io/socket.io.js"></script><br />
<script><br />
var conn = io.connect('https://socketio.mtgox.com/mtgox');<br />
conn.on('message', function(data) {<br />
// Handle incoming data object.<br />
});<br />
</script><br />
</source><br />
<br />
The session ID expires after 30 seconds<br />
<br />
===Handling Events===<br />
Socket.io exposes a simple interface for handling events. Handling <tt>message</tt> events is shown above, but there are other events that may be handled:<br />
<source lang="javascript"><br />
conn.on('connect', onConnect);<br />
conn.on('disconnect', onDisconnect);<br />
conn.on('error', onError);<br />
conn.on('message', onMessage);<br />
</source><br />
<br />
===Incoming Data===<br />
Data arrives as a full object instead of as JSON text, eliminating the need to parse the data in the JavaScript handler. Messages that come across the socket to trigger the <tt>message</tt> event will contain the following minimum components:<br />
<source lang="javascript"><br />
{<br />
"op":<OPERATION_TYPE><br />
}<br />
</source><br />
<br />
The <tt>OPERATION_TYPE</tt> field may take these values:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! OPERATION_TYPE !! Description<br />
|-<br />
| subscribe || Notification that the user is subscribed to a channel<br />
|-<br />
| unsubscribe || Messages will no longer arrive over the channel<br />
|-<br />
| remark || A server message, usually a warning<br />
|-<br />
| private || The operation for depth, trade, and ticker messages<br />
|}<br />
<br />
===op:subscribe and op:unsubscribe===<br />
The subscribe and unsubscribe message data are very simple, containing the channel and the operation.<br />
<source lang="javascript"><br />
{<br />
"channel":<CHANNEL_ID>,<br />
"op":"subscribe" OR "unsubscribe"<br />
}<br />
</source><br />
<br />
Some of the channels are:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Channel ID !! Description<br />
|-<br />
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || Trades<br />
|-<br />
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || Ticker<br />
|-<br />
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || Depth<br />
|}<br />
<br />
===op:remark===<br />
The remark operation contains message and success fields.<br />
<source lang="javascript"><br />
{<br />
"op":"remark",<br />
"message":<MESSAGE FROM THE SERVER>,<br />
"success":<boolean><br />
}<br />
</source><br />
<br />
===op:private===<br />
The payloads of the <tt>op:private</tt> messages contain the real time market information. Each message follows this form:<br />
<br />
<source lang="javascript"><br />
{<br />
"channel":<CHANNEL_ID>,<br />
"op":"private",<br />
"private":<MESSAGE_TYPE>,<br />
<MESSAGE_TYPE>:<DATA_PAYLOAD><br />
}<br />
</source><br />
<br />
The <tt>MESSAGE_TYPE</tt> field may take the values:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! MESSAGE_TYPE !! Description<br />
|-<br />
| ticker || Ticker messages<br />
|-<br />
| trade || Trades, as they occur<br />
|-<br />
| depth || Orders placed or removed<br />
|}<br />
<br />
====Ticker====<br />
Ticker messages contain the current inside Bid and Ask as well as daily highs, lows, and volume. The fields contained in the ticker match those defined in the version 1.0 API above. All fields contain <tt>currency</tt>, <tt>display</tt>, <tt>value</tt>, and <tt>value_int</tt> entries.<br />
<source lang="javascript"><br />
{<br />
"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"ticker",<br />
"ticker":{<br />
"avg":{<br />
"currency":"USD",<br />
"display":"$2.26847",<br />
"value":"2.26847",<br />
"value_int":"226847"<br />
},<br />
"buy":{...},<br />
"high":{...},<br />
"last":{..},<br />
"last_local":{...},<br />
"last_orig":{...},<br />
"low":{...},<br />
"sell":{...},<br />
"vol":{<br />
"currency":"BTC",<br />
"display":"118,696.02104208",<br />
"value":"118696.02104208",<br />
"value_int":"11869602104208"<br />
},<br />
"vwap":{...}<br />
}<br />
}<br />
</source><br />
<br />
====Trade====<br />
<source lang="javascript">{<br />
"channel":"dbf1dee9-4f2e-4a08-8cb7-748919a71b21",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"trade",<br />
"trade":{<br />
"amount":2.71,<br />
"amount_int":"271000000",<br />
"date":1310279340,<br />
"item":"BTC",<br />
"price":14.43,<br />
"price_currency":"USD",<br />
"price_int":"1443000",<br />
"primary":"Y",<br />
"properties":"limit, mixed_currency",<br />
"tid":"1310279340877902",<br />
"trade_type":"bid",<br />
"type":"trade"<br />
}<br />
}<br />
</source><br />
<br />
'''trade''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| amount || the traded amount in item (BTC), float, deprecated<br />
|-<br />
| amount_int || the traded amount * 1E8<br />
|-<br />
| date || unix timestamp of trade<br />
|-<br />
| item || What was this trade about<br />
|-<br />
| price || price per unit, float, deprecated<br />
|-<br />
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)<br />
|-<br />
| price_currency || currency in which trade was completed<br />
|-<br />
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)<br />
|-<br />
| trade_type || Did this trade result from the execution of a bid or a ask?<br />
|-<br />
|}<br />
<br />
====Depth====<br />
<br />
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.<br />
<br />
<source lang="javascript">{<br />
"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",<br />
"depth":{<br />
"currency":"USD",<br />
"item":"BTC",<br />
"now":"1323644358437819",<br />
"price":"14.43",<br />
"price_int":"1443000",<br />
"total_volume_int":"849766000",<br />
"type":1,<br />
"type_str":"ask",<br />
"volume":"-2.71",<br />
"volume_int":"-271000000"<br />
},<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"depth"<br />
}</source><br />
<br />
'''depth''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| currency || the currency affected<br />
|-<br />
| item || the item (BTC)<br />
|-<br />
| price || price as a float, deprecated<br />
|-<br />
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)<br />
|-<br />
| type || 1=ask, 2=bid. deprecated, use type_str<br />
|-<br />
| type_str || type of order at this depth, either "ask" or "bid"<br />
|-<br />
| volume || the volume change as float, deprecated<br />
|-<br />
| volume_int || volume change * 1E8<br />
<br />
|}<br />
<br />
===Possible outgoing commands===<br />
'''unsubscribe''' Stop receiving messages from a channel (parameter "channel")<br />
<br />
=== examples ===<br />
<br />
==== ticker ====<br />
javascript, using hookio : <br />
<br />
http://www.youtube.com/watch?v=KD5ljtNK72U<br />
<br />
http://github.com/hookio<br />
<br />
http://github.com/cronopio/hook.io-mtgox<br />
<br />
Another node.js project, using plain websockets (largely based on cronopio's work) :<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
==== arbitrage ====<br />
https://github.com/goteppo/ArBit<br />
<br />
==== websocket ====<br />
https://github.com/cronopio/hook.io-ws<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
== References ==<br />
<references></references></div>Osmosishttps://tests.bitcoin.it/w/index.php?title=MtGox/API&diff=22424MtGox/API2012-01-18T10:06:02Z<p>Osmosis: added info about parameters for api/1, same as api/0</p>
<hr />
<div>The [[MtGox]] API provides methods to access information from the market, place orders, and more.<br />
<br />
Two APIs are currently available: the HTTP API (available by posting to mtgox.com/code/*) and the websocket API.<br />
<br />
==Number Formats==<br />
<br />
In the "old API", currency- and amount-values (price, volume,...) were given as '''float'''. These values are likely being deprecated and replaced by fields of the same name with "_int" as suffix. These are '''fixed-decimal''', so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.<br />
<br />
In order to convert the '''int''' to a '''decimal''' you can...<br />
<br />
{| class="wikitable"<br />
|-<br />
! kind of field !! ...divide by !! ...multiply by<br />
|-<br />
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001<br />
|-<br />
| USD (price) || 1E5 (100,000) || 0.00001<br />
|-<br />
| JPY (price) || 1E3 (1,000) || 0.001<br />
|}<br />
<br />
Implementation advice: it's probably best to use '''int''' or '''Decimal''' (if your language/db offers such a type) in your clients. Using '''float''' will likely lead to nasty rounding problems.<br />
<br />
== Currency Symbols ==<br />
List of the currency symbols available with the API:<br />
<br />
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB<br />
<br />
== HTTP API ==<br />
This API is available in <nowiki>https://mtgox.com/api/*</nowiki>, and provides various informations. It also supports making an order, a withdraw, a deposit, etc. There is also a [https://rubygems.org/gems/mtgox Ruby gem] and [[Finance::MtGox|Perl module]] for interacting with the HTTP API.<br />
<br />
=== Authentication ===<br />
<br />
<br />
Authentication is performed by signing each request using HMAC-SHA512. The request must contain an extra value "nonce" which must be an always incrementing numeric value. A reference implementation is provided here:<br />
<source lang="php"><br />
<?php<br />
<br />
function mtgox_query($path, array $req = array()) {<br />
// API settings<br />
$key = '';<br />
$secret = '';<br />
<br />
// generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems<br />
$mt = explode(' ', microtime());<br />
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);<br />
<br />
// generate the POST data string<br />
$post_data = http_build_query($req, '', '&');<br />
<br />
// generate the extra headers<br />
$headers = array(<br />
'Rest-Key: '.$key,<br />
'Rest-Sign: '.base64_encode(hash_hmac('sha512', $post_data, base64_decode($secret), true)),<br />
);<br />
<br />
// our curl handle (initialize if required)<br />
static $ch = null;<br />
if (is_null($ch)) {<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');<br />
}<br />
curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/'.$path);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);<br />
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br />
<br />
// run the query<br />
$res = curl_exec($ch);<br />
if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));<br />
$dec = json_decode($res, true);<br />
if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists');<br />
return $dec;<br />
}<br />
<br />
// example 1: get infos about the account, plus the list of rights we have access to<br />
var_dump(mtgox_query('0/info.php'));<br />
<br />
// old api (get funds)<br />
var_dump(mtgox_query('0/getFunds.php'));<br />
<br />
// trade example<br />
// var_dump(mtgox_query('0/buyBTC.php', array('amount' => 1, 'price' => 15)));<br />
</source><br />
<br />
Python version here: https://bitcointalk.org/index.php?topic=49789.msg592388#msg592388<br />
<br />
=== Cache ===<br />
<br />
All of the API methods below have cached results, ticker, depth . . . have a 10 seconds cache .<br />
No need to poll more often, you wont have more results, you could just be blocked by the prolexic anti ddos features.<br />
<br />
=== Methods API version 0===<br />
<br />
==== 0/data/getTrades.php ====<br />
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.<br />
<br />
Parameters:<br />
* since: Passing a tid in "since" allows retrieving all trades since that trade. The passed id is may not exist. Ie. to get all trades from the very beginning one would just call https://mtgox.com/code/data/getTrades.php?since=0 . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since.<br />
<br />
* data is returned in standard json format like :<br />
<source lang="php"><br />
[<br />
{"date":1279408157,<br />
"price":"0.04951",<br />
"amount":"20",<br />
"price_int":"4951",<br />
"amount_int":"2000000000",<br />
"tid":"1",<br />
"price_currency":"USD",<br />
"item":"BTC",<br />
"trade_type":""<br />
"primary":"Y"<br />
},<br />
{"date":1279424586,"price":"0.05941","amount":"50.01","price_int":"5941","amount_int":"5001000000","tid":"2","price_currency":"USD","item":"BTC","trade_type":""}]<br />
</source><br />
<br />
==== 0/getDepth.php ====<br />
Get the current Market depth<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=AUD<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=USD<br />
<br />
==== 0/getFunds.php ====<br />
Get your current balance<br />
<br />
https://mtgox.com/api/0/getFunds.php<br />
<br />
getfunds is now deprecated since multi currency, please use info.php<br />
<br />
==== 0/buyBTC.php ====<br />
Place an order to Buy BTC<br />
<br />
https://mtgox.com/api/0/buyBTC.php<br />
<br />
POST data: amount=#&price=#&Currency=PLN<br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/sellBTC.php ====<br />
Place an order to Sell BTC<br />
<br />
https://mtgox.com/api/0/sellBTC.php<br />
<br />
POST data: &amount=#&price=#&Currency=PLN <br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/getOrders.php ====<br />
Fetch a list of your open Orders<br />
<br />
https://mtgox.com/api/0/getOrders.php<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
status: 1 for active, 2 for not enough funds<br />
<br />
==== 0/cancelOrder.php ====<br />
Cancel an order<br />
<br />
https://mtgox.com/api/0/cancelOrder.php<br />
<br />
POST data: oid=#&type=#<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
==== 0/redeemCode.php ====<br />
Used to redeem a mtgox coupon code<br />
<br />
https://mtgox.com/api/0/redeemCode.php<br />
<br />
* call with a post parameter "code" containing the code to redeem<br />
<br />
* it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status<br />
<br />
==== 0/withdraw.php ====<br />
withdraw / Send BTC<br />
<br />
https://mtgox.com/api/0/withdraw.php<br />
<br />
POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#<br />
<br />
* pass btca parameter to withdraw to a btc adress<br />
<br />
* pass group1 for a coupon : BTC2CODE or USD2CODE<br />
<br />
* pass group1=DWUSD&dwaccount=XXX-XXX-XXXX (no btca=xxxxxxx) for a dwolla withdraw<br />
<br />
* pass green=1 to use the new greenaddress feature ( see [[GreenAddress]] )<br />
* return code and status if successful<br />
<br />
To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )<br />
<br />
==== 0/btcAddress.php ====<br />
get a bitcoin deposit adress for your account <br />
<br />
https://mtgox.com/api/0/btcAddress.php<br />
<br />
* pass POST data "description" to add a description that will appear in your history when this BTC address receive a deposit<br />
<br />
* returns a bitcoin deposit address<br />
<br />
==== 0/history_[CUR].csv ====<br />
<br />
Allows downloading your activity history for a given currency (BTC or USD for now).<br />
<br />
https://mtgox.com/api/0/history_BTC.csv<br />
<br />
https://mtgox.com/api/0/history_USD.csv<br />
<br />
encoding is utf-8<br />
<br />
==== 0/info.php ====<br />
<br />
https://mtgox.com/api/0/info.php<br />
<br />
returns info about your account, funds, fees, API privileges, withdraw limits . . . <br />
<br />
==== 0/ticker ====<br />
<br />
http://mtgox.com/api/0/data/ticker.php<br />
<br />
returns the current ticker :<br />
<br />
<source lang="php"><br />
{"ticker":<br />
{<br />
"high":5.70653,<br />
"low":5.4145,<br />
"avg":5.561388723,<br />
"vwap":5.610932845,<br />
"vol":55698,<br />
"last":5.56915,<br />
"buy":5.51326,<br />
"sell":5.5672<br />
}<br />
}<br />
</source><br />
<br />
the time frame for high, low, vol, avg, vwap . . . is sliding 24 hours<br />
<br />
what is vwap ? <br />
<br />
please see http://en.wikipedia.org/wiki/VWAP<br />
<br />
=== API version 0 examples ===<br />
<br />
==== all api shell type CLI ====<br />
<br />
python : http://www.goxsh.info/<br />
<br />
perl : http://pastebin.com/vEpgw5nW<br />
<br />
==== other ====<br />
<br />
https : http://stackoverflow.com/questions/7046370/https-request-with-boost-asio-and-openssl<br />
<br />
https://github.com/sje397/mtgox-plasmoid<br />
<br />
module perl : http://search.cpan.org/~mndrix/Finance-MtGox-0.02/<br />
<br />
==== gather data ====<br />
<br />
https://github.com/Lexiks/MyBitBoard<br />
<br />
==== gettrade ====<br />
<br />
bash : https://bitcointalk.org/index.php?topic=39402.0<br />
<br />
perl : http://pastebin.com/raw.php?i=pmhMXZJu<br />
<br />
==== ticker ====<br />
<br />
http://pastebin.com/pd0ZR4WY<br />
<br />
=== Methods API version 1===<br />
<br />
==== Multi Currency Ticker ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/ticker<br />
https://mtgox.com/api/1/BTCEUR/public/ticker<br />
<br />
returns the current ticker for the selected currency :<br />
<br />
<source lang="php"><br />
{<br />
"result":"success",<br />
"return":<br />
{<br />
"high": {"value":"5.70653","value_int":"570653","display":"$5.70653","currency":"USD"},<br />
"low": {"value":"5.4145","value_int":"541450","display":"$5.41450","currency":"USD"},<br />
"avg": {"value":"5.561119626","value_int":"556112","display":"$5.56112","currency":"USD"},<br />
"vwap": {"value":"5.610480461","value_int":"561048","display":"$5.61048","currency":"USD"},<br />
"vol":<br />
{<br />
"value":"55829.58960346",<br />
"value_int":"5582958960346",<br />
"display":"55,829.58960346\u00a0BTC",<br />
"currency":"BTC"<br />
},<br />
"last_local":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last_orig":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"buy":{"value":"5.53587","value_int":"553587","display":"$5.53587","currency":"USD"},<br />
"sell":{"value":"5.56031","value_int":"556031","display":"$5.56031","currency":"USD"}<br />
}<br />
</source><br />
<br />
note : last_local include only the last trade in the selected currency, last_orig include data of the original last trade ( currency,price in currency . . . ),last can be a conversion of the last trde in another currency<br />
<br />
==== Multi Currency depth ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/depth?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/depth?raw<br />
<br />
==== Multi currency trades ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/trades?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/trades?raw<br />
<br />
to get only the trades since a given trade id, you can add the parameter since=<trade_id><br />
<br />
https://mtgox.com/api/1/BTCUSD/public/trades?since=0<br />
<br />
https://mtgox.com/api/1/BTCEUR/public/trades?since=1316312781670700<br />
<br />
For multi currency,also returns the primary value,"Y" or "N", the primary currency is always the buyers currency<br />
<br />
A trade can appear in more than one currency, to ignore duplicates, use only the trades having primary =Y<br />
<br />
example of returned data : <br />
<source lang="php"><br />
{"date":1316312781,<br />
"price":"3.5599",<br />
"amount":"3.6900096",<br />
"price_int":"355990",<br />
"amount_int":"369000960",<br />
"tid":"1316312781670700",<br />
"price_currency":"EUR",<br />
"item":"BTC",<br />
"trade_type":"bid",<br />
"primary":"Y",<br />
"properties":"limit,mixed_currency"<br />
}<br />
</source><br />
<br />
==== Cancelled Trades ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/cancelledtrades<br />
<br />
returns a list of all the cancelled trades this last month, list of trade ids in json format .<br />
<br />
==== Full Depth ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/fulldepth<br />
<br />
returns full depth<br />
<br />
==== Private info ====<br />
<br />
https://mtgox.com/api/1/generic/private/info<br />
<br />
returns information about your account, funds, fees, API privileges, withdraw limits . . .<br />
<br />
==== Your open orders ====<br />
<br />
https://mtgox.com/api/1/generic/private/orders<br />
<br />
returns information about your current open orders<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
status: 1 for active, 2 for not enough funds<br />
<br />
==== Submit an order ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/private/order/add<br />
<br />
parameters: <br />
* type (bid|ask)<br />
* amount_int <amount as int><br />
* price_int <price as int> (can be omitted to place market order)<br />
<br />
submits an order and returns info about success or error<br />
<br />
==== Currency information ====<br />
<br />
https://mtgox.com/api/1/generic/public/currency<br />
<br />
pass parameter ?currency=<currency_symbol><br />
<br />
returns information about a currency ( number of decimals . . . )<br />
<br />
==== HOTP key ====<br />
<br />
https://mtgox.com/api/1/generic/public/hotp_gen<br />
<br />
used to generate a new HOTP key ( useful for developpers )<br />
<br />
== Streaming API ==<br />
Real time streaming data may be obtained over the streaming API, implemented in [http://socket.io/ Socket.io]<ref>Socket.io forum announcement by MagicalTux: https://bitcointalk.org/index.php?topic=14412.msg613271#msg613271</ref>. The original WebSocket API<ref>Original WebSocket thread: https://bitcointalk.org/index.php?topic=5855.msg86219</ref> is deprecated as of 11-Nov-2011.<br />
<br />
===Connecting===<br />
The following JavaScript code establishes a connection in the browser:<br />
<source lang="javascript"><br />
<script src="https://socketio.mtgox.com/socket.io/socket.io.js"></script><br />
<script><br />
var conn = io.connect('https://socketio.mtgox.com/mtgox');<br />
conn.on('message', function(data) {<br />
// Handle incoming data object.<br />
});<br />
</script><br />
</source><br />
<br />
The session ID expires after 30 seconds<br />
<br />
===Handling Events===<br />
Socket.io exposes a simple interface for handling events. Handling <tt>message</tt> events is shown above, but there are other events that may be handled:<br />
<source lang="javascript"><br />
conn.on('connect', onConnect);<br />
conn.on('disconnect', onDisconnect);<br />
conn.on('error', onError);<br />
conn.on('message', onMessage);<br />
</source><br />
<br />
===Incoming Data===<br />
Data arrives as a full object instead of as JSON text, eliminating the need to parse the data in the JavaScript handler. Messages that come across the socket to trigger the <tt>message</tt> event will contain the following minimum components:<br />
<source lang="javascript"><br />
{<br />
"op":<OPERATION_TYPE><br />
}<br />
</source><br />
<br />
The <tt>OPERATION_TYPE</tt> field may take these values:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! OPERATION_TYPE !! Description<br />
|-<br />
| subscribe || Notification that the user is subscribed to a channel<br />
|-<br />
| unsubscribe || Messages will no longer arrive over the channel<br />
|-<br />
| remark || A server message, usually a warning<br />
|-<br />
| private || The operation for depth, trade, and ticker messages<br />
|}<br />
<br />
===op:subscribe and op:unsubscribe===<br />
The subscribe and unsubscribe message data are very simple, containing the channel and the operation.<br />
<source lang="javascript"><br />
{<br />
"channel":<CHANNEL_ID>,<br />
"op":"subscribe" OR "unsubscribe"<br />
}<br />
</source><br />
<br />
Some of the channels are:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Channel ID !! Description<br />
|-<br />
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || Trades<br />
|-<br />
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || Ticker<br />
|-<br />
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || Depth<br />
|}<br />
<br />
===op:remark===<br />
The remark operation contains message and success fields.<br />
<source lang="javascript"><br />
{<br />
"op":"remark",<br />
"message":<MESSAGE FROM THE SERVER>,<br />
"success":<boolean><br />
}<br />
</source><br />
<br />
===op:private===<br />
The payloads of the <tt>op:private</tt> messages contain the real time market information. Each message follows this form:<br />
<br />
<source lang="javascript"><br />
{<br />
"channel":<CHANNEL_ID>,<br />
"op":"private",<br />
"private":<MESSAGE_TYPE>,<br />
<MESSAGE_TYPE>:<DATA_PAYLOAD><br />
}<br />
</source><br />
<br />
The <tt>MESSAGE_TYPE</tt> field may take the values:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! MESSAGE_TYPE !! Description<br />
|-<br />
| ticker || Ticker messages<br />
|-<br />
| trade || Trades, as they occur<br />
|-<br />
| depth || Orders placed or removed<br />
|}<br />
<br />
====Ticker====<br />
Ticker messages contain the current inside Bid and Ask as well as daily highs, lows, and volume. The fields contained in the ticker match those defined in the version 1.0 API above. All fields contain <tt>currency</tt>, <tt>display</tt>, <tt>value</tt>, and <tt>value_int</tt> entries.<br />
<source lang="javascript"><br />
{<br />
"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"ticker",<br />
"ticker":{<br />
"avg":{<br />
"currency":"USD",<br />
"display":"$2.26847",<br />
"value":"2.26847",<br />
"value_int":"226847"<br />
},<br />
"buy":{...},<br />
"high":{...},<br />
"last":{..},<br />
"last_local":{...},<br />
"last_orig":{...},<br />
"low":{...},<br />
"sell":{...},<br />
"vol":{<br />
"currency":"BTC",<br />
"display":"118,696.02104208",<br />
"value":"118696.02104208",<br />
"value_int":"11869602104208"<br />
},<br />
"vwap":{...}<br />
}<br />
}<br />
</source><br />
<br />
====Trade====<br />
<source lang="javascript">{<br />
"channel":"dbf1dee9-4f2e-4a08-8cb7-748919a71b21",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"trade",<br />
"trade":{<br />
"amount":2.71,<br />
"amount_int":"271000000",<br />
"date":1310279340,<br />
"item":"BTC",<br />
"price":14.43,<br />
"price_currency":"USD",<br />
"price_int":"1443000",<br />
"primary":"Y",<br />
"properties":"limit, mixed_currency",<br />
"tid":"1310279340877902",<br />
"trade_type":"bid",<br />
"type":"trade"<br />
}<br />
}<br />
</source><br />
<br />
'''trade''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| amount || the traded amount in item (BTC), float, deprecated<br />
|-<br />
| amount_int || the traded amount * 1E8<br />
|-<br />
| date || unix timestamp of trade<br />
|-<br />
| item || What was this trade about<br />
|-<br />
| price || price per unit, float, deprecated<br />
|-<br />
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)<br />
|-<br />
| price_currency || currency in which trade was completed<br />
|-<br />
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)<br />
|-<br />
| trade_type || Did this trade result from the execution of a bid or a ask?<br />
|-<br />
|}<br />
<br />
====Depth====<br />
<br />
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.<br />
<br />
<source lang="javascript">{<br />
"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",<br />
"depth":{<br />
"currency":"USD",<br />
"item":"BTC",<br />
"now":"1323644358437819",<br />
"price":"14.43",<br />
"price_int":"1443000",<br />
"total_volume_int":"849766000",<br />
"type":1,<br />
"type_str":"ask",<br />
"volume":"-2.71",<br />
"volume_int":"-271000000"<br />
},<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"depth"<br />
}</source><br />
<br />
'''depth''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| currency || the currency affected<br />
|-<br />
| item || the item (BTC)<br />
|-<br />
| price || price as a float, deprecated<br />
|-<br />
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)<br />
|-<br />
| type || 1=ask, 2=bid. deprecated, use type_str<br />
|-<br />
| type_str || type of order at this depth, either "ask" or "bid"<br />
|-<br />
| volume || the volume change as float, deprecated<br />
|-<br />
| volume_int || volume change * 1E8<br />
<br />
|}<br />
<br />
===Possible outgoing commands===<br />
'''unsubscribe''' Stop receiving messages from a channel (parameter "channel")<br />
<br />
=== examples ===<br />
<br />
==== ticker ====<br />
javascript, using hookio : <br />
<br />
http://www.youtube.com/watch?v=KD5ljtNK72U<br />
<br />
http://github.com/hookio<br />
<br />
http://github.com/cronopio/hook.io-mtgox<br />
<br />
Another node.js project, using plain websockets (largely based on cronopio's work) :<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
==== arbitrage ====<br />
https://github.com/goteppo/ArBit<br />
<br />
==== websocket ====<br />
https://github.com/cronopio/hook.io-ws<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
== References ==<br />
<references></references></div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Original_Bitcoin_client/API_calls_list&diff=22055Original Bitcoin client/API calls list2012-01-12T08:27:54Z<p>Osmosis: /* See Also */</p>
<hr />
<div>Bitcoin API call list (as of version 0.4.0)<br />
<br />
== Common operations ==<br />
<br />
=== Listing my bitcoin addresses ===<br />
<br />
Listing the bitcoin [[address|addresses]] in your wallet is easily done via ''listreceivedbyaddress''. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true.<br />
<br />
[[accounts explained|Accounts]] are used to organize addresses.<br />
<br />
== Full list ==<br />
<br />
Required arguments are denoted inside &lt; and &gt; Optional arguments are inside [ and ].<br />
<br />
{|class="wikitable"<br />
! Command !! Parameters !! Description !! Requires unlocked wallet? (v0.4.0+)<br />
|-<br />
| backupwallet || <destination> || Safely copies wallet.dat to destination, which can be a directory or a path with filename. || N<br />
|-<br />
| encryptwallet || <passphrase> || Encrypts the wallet with <passphrase>. || N<br />
|-<br />
| getaccount || <bitcoinaddress> || Returns the account associated with the given address. || N<br />
|-<br />
| getaccountaddress || <account> || Returns the current bitcoin address for receiving payments to this account. || N<br />
|-<br />
| getaddressesbyaccount || <account> || Returns the list of addresses for the given account. || N<br />
|-<br />
| getbalance || [account] [minconf=1] || If [account] is not specified, returns the server's total available balance.<br/>If [account] is specified, returns the balance in the account. || N<br />
|-<br />
| getblockbycount || height || Dumps the block existing at specified height. '''Note: this is not available in the official release'''<br />
|-<br />
| getblockcount || || Returns the number of blocks in the longest block chain. || N<br />
|-<br />
| getblocknumber || || Returns the block number of the latest block in the longest block chain. || N<br />
|-<br />
| getconnectioncount || || Returns the number of connections to other nodes. || N<br />
|-<br />
| getdifficulty || || Returns the proof-of-work difficulty as a multiple of the minimum difficulty. || N<br />
|-<br />
| getgenerate || || Returns true or false whether bitcoind is currently generating hashes || N<br />
|-<br />
| gethashespersec || || Returns a recent hashes per second performance measurement while generating. || N<br />
|-<br />
| getinfo || || Returns an object containing various state info. || N<br />
|-<br />
| getnewaddress || [account] || Returns a new bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account]. || N<br />
|-<br />
| getreceivedbyaccount || [account] [minconf=1] || Returns the total amount received by addresses with [account] in transactions with at least [minconf] confirmations. If [account] not provided return will include all transactions to all accounts. (version 0.3.24-beta) || N<br />
|-<br />
| getreceivedbyaddress || <bitcoinaddress> [minconf=1] || Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations. While some might consider this obvious, value reported by this only considers *receiving* transactions. It does not check payments that have been made *from* this address. In other words, this is not "getaddressbalance". || N<br />
|-<br />
| gettransaction || <txid> || Returns an object about the given transaction containing:<br />
* "amount" : total amount of the transaction<br />
* "confirmations" : number of confirmations of the transaction<br />
* "txid" : the transaction ID<br />
* "time" : time the transaction occurred<br />
* "details" - An array of objects containing:<br />
** "account"<br />
** "address"<br />
** "category"<br />
** "amount"<br />
|| N<br />
|-<br />
| [[getwork]] || [data] || If [data] is not specified, returns formatted hash data to work on:<br />
* "midstate" : precomputed hash state after hashing the first half of the data<br />
* "data" : block data<br />
* "hash1" : formatted hash buffer for second hash<br />
* "target" : little endian hash target<br />
If [data] is specified, tries to solve the block and returns true if it was successful. <br />
|| N<br />
|-<br />
| help || [command] || List commands, or get help for a command. || N<br />
|-<br />
| keypoolrefill || || Fills the keypool, requires wallet passphrase to be set. || Y<br />
|-<br />
| listaccounts || [minconf=1] || Returns Object that has account names as keys, account balances as values. || N<br />
|-<br />
| listreceivedbyaccount || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "account" : the account of the receiving addresses<br />
* "amount" : total amount received by addresses with this account<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
|| N<br />
|-<br />
| listreceivedbyaddress || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "address" : receiving address<br />
* "account" : the account of the receiving address<br />
* "amount" : total amount received by the address<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
To get a list of accounts on the system, execute bitcoind listreceivedbyaddress 0 true<br />
|| N<br />
|-<br />
| listtransactions || [account] [count=10] [from=0] || Returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] not provided will return recent transaction from all accounts.<br />
|| N<br />
|-<br />
| move || <fromaccount> <toaccount> <amount> [minconf=1] [comment] || Move from one account in your wallet to another || N<br />
|-<br />
| sendfrom || <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places. Will send the given amount to the given address, ensuring the account has a valid balance using [minconf] confirmations. Returns the transaction ID if successful (not in JSON object). || Y<br />
|-<br />
| sendmany || <fromaccount> {address:amount,...} [minconf=1] [comment] || amounts are double-precision floating point numbers || Y<br />
|-<br />
| sendtoaddress || <bitcoinaddress> <amount> [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places. Returns the transaction ID <txid> if successful. || Y<br />
|-<br />
| setaccount || <bitcoinaddress> <account> || Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account. || N<br />
|-<br />
| setgenerate || <generate> [genproclimit] || <generate> is true or false to turn generation on or off.<br/>Generation is limited to [genproclimit] processors, -1 is unlimited. || N<br />
|-<br />
| settxfee || <amount> || <amount> is a real and is rounded to the nearest 0.00000001 || N<br />
|-<br />
| stop || || Stop bitcoin server. || N<br />
|-<br />
| validateaddress || <bitcoinaddress> || Return information about <bitcoinaddress>. || N<br />
|-<br />
| walletlock || || Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked. || N<br />
|-<br />
| walletpassphrase || <passphrase> <timeout> || Stores the wallet decryption key in memory for <timeout> seconds. || N<br />
|-<br />
| walletpassphrasechange || <oldpassphrase> <newpassphrase> || Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>. || N<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
* [[Original Bitcoin client]]<br />
* [[API reference (JSON-RPC)]]<br />
* [[Lazy_API]]<br />
* [[Elis-API]] - A more detailed version of this page - for developers!<br />
* [http://code.gogulski.com/bitcoin-php/class_bitcoin_client.html PHP BitcoinClient Class Reference]<br />
<br />
[[Category:Technical]]<br />
[[Category:Developer]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Original_Bitcoin_client/API_calls_list&diff=22054Original Bitcoin client/API calls list2012-01-12T08:26:51Z<p>Osmosis: a related API link</p>
<hr />
<div>Bitcoin API call list (as of version 0.4.0)<br />
<br />
== Common operations ==<br />
<br />
=== Listing my bitcoin addresses ===<br />
<br />
Listing the bitcoin [[address|addresses]] in your wallet is easily done via ''listreceivedbyaddress''. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true.<br />
<br />
[[accounts explained|Accounts]] are used to organize addresses.<br />
<br />
== Full list ==<br />
<br />
Required arguments are denoted inside &lt; and &gt; Optional arguments are inside [ and ].<br />
<br />
{|class="wikitable"<br />
! Command !! Parameters !! Description !! Requires unlocked wallet? (v0.4.0+)<br />
|-<br />
| backupwallet || <destination> || Safely copies wallet.dat to destination, which can be a directory or a path with filename. || N<br />
|-<br />
| encryptwallet || <passphrase> || Encrypts the wallet with <passphrase>. || N<br />
|-<br />
| getaccount || <bitcoinaddress> || Returns the account associated with the given address. || N<br />
|-<br />
| getaccountaddress || <account> || Returns the current bitcoin address for receiving payments to this account. || N<br />
|-<br />
| getaddressesbyaccount || <account> || Returns the list of addresses for the given account. || N<br />
|-<br />
| getbalance || [account] [minconf=1] || If [account] is not specified, returns the server's total available balance.<br/>If [account] is specified, returns the balance in the account. || N<br />
|-<br />
| getblockbycount || height || Dumps the block existing at specified height. '''Note: this is not available in the official release'''<br />
|-<br />
| getblockcount || || Returns the number of blocks in the longest block chain. || N<br />
|-<br />
| getblocknumber || || Returns the block number of the latest block in the longest block chain. || N<br />
|-<br />
| getconnectioncount || || Returns the number of connections to other nodes. || N<br />
|-<br />
| getdifficulty || || Returns the proof-of-work difficulty as a multiple of the minimum difficulty. || N<br />
|-<br />
| getgenerate || || Returns true or false whether bitcoind is currently generating hashes || N<br />
|-<br />
| gethashespersec || || Returns a recent hashes per second performance measurement while generating. || N<br />
|-<br />
| getinfo || || Returns an object containing various state info. || N<br />
|-<br />
| getnewaddress || [account] || Returns a new bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account]. || N<br />
|-<br />
| getreceivedbyaccount || [account] [minconf=1] || Returns the total amount received by addresses with [account] in transactions with at least [minconf] confirmations. If [account] not provided return will include all transactions to all accounts. (version 0.3.24-beta) || N<br />
|-<br />
| getreceivedbyaddress || <bitcoinaddress> [minconf=1] || Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations. While some might consider this obvious, value reported by this only considers *receiving* transactions. It does not check payments that have been made *from* this address. In other words, this is not "getaddressbalance". || N<br />
|-<br />
| gettransaction || <txid> || Returns an object about the given transaction containing:<br />
* "amount" : total amount of the transaction<br />
* "confirmations" : number of confirmations of the transaction<br />
* "txid" : the transaction ID<br />
* "time" : time the transaction occurred<br />
* "details" - An array of objects containing:<br />
** "account"<br />
** "address"<br />
** "category"<br />
** "amount"<br />
|| N<br />
|-<br />
| [[getwork]] || [data] || If [data] is not specified, returns formatted hash data to work on:<br />
* "midstate" : precomputed hash state after hashing the first half of the data<br />
* "data" : block data<br />
* "hash1" : formatted hash buffer for second hash<br />
* "target" : little endian hash target<br />
If [data] is specified, tries to solve the block and returns true if it was successful. <br />
|| N<br />
|-<br />
| help || [command] || List commands, or get help for a command. || N<br />
|-<br />
| keypoolrefill || || Fills the keypool, requires wallet passphrase to be set. || Y<br />
|-<br />
| listaccounts || [minconf=1] || Returns Object that has account names as keys, account balances as values. || N<br />
|-<br />
| listreceivedbyaccount || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "account" : the account of the receiving addresses<br />
* "amount" : total amount received by addresses with this account<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
|| N<br />
|-<br />
| listreceivedbyaddress || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "address" : receiving address<br />
* "account" : the account of the receiving address<br />
* "amount" : total amount received by the address<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
To get a list of accounts on the system, execute bitcoind listreceivedbyaddress 0 true<br />
|| N<br />
|-<br />
| listtransactions || [account] [count=10] [from=0] || Returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] not provided will return recent transaction from all accounts.<br />
|| N<br />
|-<br />
| move || <fromaccount> <toaccount> <amount> [minconf=1] [comment] || Move from one account in your wallet to another || N<br />
|-<br />
| sendfrom || <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places. Will send the given amount to the given address, ensuring the account has a valid balance using [minconf] confirmations. Returns the transaction ID if successful (not in JSON object). || Y<br />
|-<br />
| sendmany || <fromaccount> {address:amount,...} [minconf=1] [comment] || amounts are double-precision floating point numbers || Y<br />
|-<br />
| sendtoaddress || <bitcoinaddress> <amount> [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places. Returns the transaction ID <txid> if successful. || Y<br />
|-<br />
| setaccount || <bitcoinaddress> <account> || Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account. || N<br />
|-<br />
| setgenerate || <generate> [genproclimit] || <generate> is true or false to turn generation on or off.<br/>Generation is limited to [genproclimit] processors, -1 is unlimited. || N<br />
|-<br />
| settxfee || <amount> || <amount> is a real and is rounded to the nearest 0.00000001 || N<br />
|-<br />
| stop || || Stop bitcoin server. || N<br />
|-<br />
| validateaddress || <bitcoinaddress> || Return information about <bitcoinaddress>. || N<br />
|-<br />
| walletlock || || Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked. || N<br />
|-<br />
| walletpassphrase || <passphrase> <timeout> || Stores the wallet decryption key in memory for <timeout> seconds. || N<br />
|-<br />
| walletpassphrasechange || <oldpassphrase> <newpassphrase> || Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>. || N<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
* [[Original Bitcoin client]]<br />
* [[API reference (JSON-RPC)]]<br />
* [[Lazy_API]]<br />
* [[Elis-API]] - A more detailed version of this page - for developers!<br />
* [[http://code.gogulski.com/bitcoin-php/class_bitcoin_client.html]]<br />
<br />
[[Category:Technical]]<br />
[[Category:Developer]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=MtGox/API&diff=22007MtGox/API2012-01-11T02:38:58Z<p>Osmosis: /* 0/history_[CUR].csv */</p>
<hr />
<div>The [[MtGox]] API provides methods to access information from the market, place orders, and more.<br />
<br />
Two APIs are currently available: the HTTP API (available by posting to mtgox.com/code/*) and the websocket API.<br />
<br />
==Number Formats==<br />
<br />
In the "old API", currency- and amount-values (price, volume,...) were given as '''float'''. These values are likely being deprecated and replaced by fields of the same name with "_int" as suffix. These are '''fixed-decimal''', so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.<br />
<br />
In order to convert the '''int''' to a '''decimal''' you can...<br />
<br />
{| class="wikitable"<br />
|-<br />
! kind of field !! ...divide by !! ...multiply by<br />
|-<br />
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001<br />
|-<br />
| USD (price) || 1E5 (100,000) || 0.00001<br />
|-<br />
| JPY (price) || 1E3 (1,000) || 0.001<br />
|}<br />
<br />
Implementation advice: it's probably best to use '''int''' or '''Decimal''' (if your language/db offers such a type) in your clients. Using '''float''' will likely lead to nasty rounding problems.<br />
<br />
== Currency Symbols ==<br />
List of the currency symbols available with the API:<br />
<br />
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB<br />
<br />
== HTTP API ==<br />
This API is available in <nowiki>https://mtgox.com/api/*</nowiki>, and provides various informations. It also supports making an order, a withdraw, a deposit, etc. There is also a [https://rubygems.org/gems/mtgox Ruby gem] and [[Finance::MtGox|Perl module]] for interacting with the HTTP API.<br />
<br />
=== Authentication ===<br />
<br />
<br />
Authentication is performed by signing each request using HMAC-SHA512. The request must contain an extra value "nonce" which must be an always incrementing numeric value. A reference implementation is provided here:<br />
<source lang="php"><br />
<?php<br />
<br />
function mtgox_query($path, array $req = array()) {<br />
// API settings<br />
$key = '';<br />
$secret = '';<br />
<br />
// generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems<br />
$mt = explode(' ', microtime());<br />
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);<br />
<br />
// generate the POST data string<br />
$post_data = http_build_query($req, '', '&');<br />
<br />
// generate the extra headers<br />
$headers = array(<br />
'Rest-Key: '.$key,<br />
'Rest-Sign: '.base64_encode(hash_hmac('sha512', $post_data, base64_decode($secret), true)),<br />
);<br />
<br />
// our curl handle (initialize if required)<br />
static $ch = null;<br />
if (is_null($ch)) {<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');<br />
}<br />
curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/'.$path);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);<br />
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br />
<br />
// run the query<br />
$res = curl_exec($ch);<br />
if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));<br />
$dec = json_decode($res, true);<br />
if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists');<br />
return $dec;<br />
}<br />
<br />
// example 1: get infos about the account, plus the list of rights we have access to<br />
var_dump(mtgox_query('0/info.php'));<br />
<br />
// old api (get funds)<br />
var_dump(mtgox_query('0/getFunds.php'));<br />
<br />
// trade example<br />
// var_dump(mtgox_query('0/buyBTC.php', array('amount' => 1, 'price' => 15)));<br />
</source><br />
<br />
Python version here: https://bitcointalk.org/index.php?topic=49789.msg592388#msg592388<br />
<br />
=== Cache ===<br />
<br />
All of the API methods below have cached results, ticker, depth . . . have a 10 seconds cache .<br />
No need to poll more often, you wont have more results, you could just be blocked by the prolexic anti ddos features.<br />
<br />
=== Methods API version 0===<br />
<br />
==== 0/data/getTrades.php ====<br />
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.<br />
<br />
Parameters:<br />
* since: Passing a tid in "since" allows retrieving all trades since that trade. The passed id is may not exist. Ie. to get all trades from the very beginning one would just call https://mtgox.com/code/data/getTrades.php?since=0 . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since.<br />
<br />
* data is returned in standard json format like :<br />
<source lang="php"><br />
[<br />
{"date":1279408157,<br />
"price":"0.04951",<br />
"amount":"20",<br />
"price_int":"4951",<br />
"amount_int":"2000000000",<br />
"tid":"1",<br />
"price_currency":"USD",<br />
"item":"BTC",<br />
"trade_type":""<br />
"primary":"Y"<br />
},<br />
{"date":1279424586,"price":"0.05941","amount":"50.01","price_int":"5941","amount_int":"5001000000","tid":"2","price_currency":"USD","item":"BTC","trade_type":""}]<br />
</source><br />
<br />
==== 0/getDepth.php ====<br />
Get the current Market depth<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=AUD<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=USD<br />
<br />
==== 0/getFunds.php ====<br />
Get your current balance<br />
<br />
https://mtgox.com/api/0/getFunds.php<br />
<br />
getfunds is now deprecated since multi currency, please use info.php<br />
<br />
==== 0/buyBTC.php ====<br />
Place an order to Buy BTC<br />
<br />
https://mtgox.com/api/0/buyBTC.php<br />
<br />
POST data: amount=#&price=#&Currency=PLN<br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/sellBTC.php ====<br />
Place an order to Sell BTC<br />
<br />
https://mtgox.com/api/0/sellBTC.php<br />
<br />
POST data: &amount=#&price=#&Currency=PLN <br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/getOrders.php ====<br />
Fetch a list of your open Orders<br />
<br />
https://mtgox.com/api/0/getOrders.php<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
status: 1 for active, 2 for not enough funds<br />
<br />
==== 0/cancelOrder.php ====<br />
Cancel an order<br />
<br />
https://mtgox.com/api/0/cancelOrder.php<br />
<br />
POST data: oid=#&type=#<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
==== 0/redeemCode.php ====<br />
Used to redeem a mtgox coupon code<br />
<br />
https://mtgox.com/api/0/redeemCode.php<br />
<br />
* call with a post parameter "code" containing the code to redeem<br />
<br />
* it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status<br />
<br />
==== 0/withdraw.php ====<br />
withdraw / Send BTC<br />
<br />
https://mtgox.com/api/0/withdraw.php<br />
<br />
POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#<br />
<br />
* pass btca parameter to withdraw to a btc adress<br />
<br />
* pass group1 for a coupon : BTC2CODE or USD2CODE<br />
<br />
* pass group1=DWUSD&dwaccount=XXX-XXX-XXXX (no btca=xxxxxxx) for a dwolla withdraw<br />
<br />
* pass green=1 to use the new greenaddress feature ( see [[GreenAddress]] )<br />
* return code and status if successful<br />
<br />
To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )<br />
<br />
==== 0/btcAddress.php ====<br />
get a bitcoin deposit adress for your account <br />
<br />
https://mtgox.com/api/0/btcAddress.php<br />
<br />
* pass POST data "description" to add a description that will appear in your history when this BTC address receive a deposit<br />
<br />
* returns a bitcoin deposit address<br />
<br />
==== 0/history_[CUR].csv ====<br />
<br />
Allows downloading your activity history for a given currency (BTC or USD for now).<br />
<br />
https://mtgox.com/api/0/history_BTC.csv<br />
<br />
https://mtgox.com/api/0/history_USD.csv<br />
<br />
encoding is utf-8<br />
<br />
==== 0/info.php ====<br />
<br />
https://mtgox.com/api/0/info.php<br />
<br />
returns info about your account, funds, fees, API privileges, withdraw limits . . . <br />
<br />
==== 0/ticker ====<br />
<br />
http://mtgox.com/api/0/data/ticker.php<br />
<br />
returns the current ticker :<br />
<br />
<source lang="php"><br />
{"ticker":<br />
{<br />
"high":5.70653,<br />
"low":5.4145,<br />
"avg":5.561388723,<br />
"vwap":5.610932845,<br />
"vol":55698,<br />
"last":5.56915,<br />
"buy":5.51326,<br />
"sell":5.5672<br />
}<br />
}<br />
</source><br />
<br />
the time frame for high, low, vol, avg, vwap . . . is sliding 24 hours<br />
<br />
what is vwap ? <br />
<br />
please see http://en.wikipedia.org/wiki/VWAP<br />
<br />
=== API version 0 examples ===<br />
<br />
==== all api shell type CLI ====<br />
<br />
python : http://www.goxsh.info/<br />
<br />
perl : http://pastebin.com/vEpgw5nW<br />
<br />
==== other ====<br />
<br />
https : http://stackoverflow.com/questions/7046370/https-request-with-boost-asio-and-openssl<br />
<br />
https://github.com/sje397/mtgox-plasmoid<br />
<br />
module perl : http://search.cpan.org/~mndrix/Finance-MtGox-0.02/<br />
<br />
==== gather data ====<br />
<br />
https://github.com/Lexiks/MyBitBoard<br />
<br />
==== gettrade ====<br />
<br />
bash : https://bitcointalk.org/index.php?topic=39402.0<br />
<br />
perl : http://pastebin.com/raw.php?i=pmhMXZJu<br />
<br />
==== ticker ====<br />
<br />
http://pastebin.com/pd0ZR4WY<br />
<br />
=== Methods API version 1===<br />
<br />
==== Multi Currency Ticker ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/ticker<br />
https://mtgox.com/api/1/BTCEUR/public/ticker<br />
<br />
returns the current ticker for the selected currency :<br />
<br />
<source lang="php"><br />
{<br />
"result":"success",<br />
"return":<br />
{<br />
"high": {"value":"5.70653","value_int":"570653","display":"$5.70653","currency":"USD"},<br />
"low": {"value":"5.4145","value_int":"541450","display":"$5.41450","currency":"USD"},<br />
"avg": {"value":"5.561119626","value_int":"556112","display":"$5.56112","currency":"USD"},<br />
"vwap": {"value":"5.610480461","value_int":"561048","display":"$5.61048","currency":"USD"},<br />
"vol":<br />
{<br />
"value":"55829.58960346",<br />
"value_int":"5582958960346",<br />
"display":"55,829.58960346\u00a0BTC",<br />
"currency":"BTC"<br />
},<br />
"last_local":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last_orig":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"buy":{"value":"5.53587","value_int":"553587","display":"$5.53587","currency":"USD"},<br />
"sell":{"value":"5.56031","value_int":"556031","display":"$5.56031","currency":"USD"}<br />
}<br />
</source><br />
<br />
note : last_local include only the last trade in the selected currency, last_orig include data of the original last trade ( currency,price in currency . . . ),last can be a conversion of the last trde in another currency<br />
<br />
==== Multi Currency depth ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/depth?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/depth?raw<br />
<br />
==== Multi currency trades ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/trades?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/trades?raw<br />
<br />
to get only the trades since a given trade id, you can add the parameter since=<trade_id><br />
<br />
https://mtgox.com/api/1/BTCUSD/public/trades?since=0<br />
<br />
https://mtgox.com/api/1/BTCEUR/public/trades?since=1316312781670700<br />
<br />
For multi currency,also returns the primary value,"Y" or "N", the primary currency is always the buyers currency<br />
<br />
A trade can appear in more than one currency, to ignore duplicates, use only the trades having primary =Y<br />
<br />
example of returned data : <br />
<source lang="php"><br />
{"date":1316312781,<br />
"price":"3.5599",<br />
"amount":"3.6900096",<br />
"price_int":"355990",<br />
"amount_int":"369000960",<br />
"tid":"1316312781670700",<br />
"price_currency":"EUR",<br />
"item":"BTC",<br />
"trade_type":"bid",<br />
"primary":"Y",<br />
"properties":"limit,mixed_currency"<br />
}<br />
</source><br />
<br />
==== Cancelled Trades ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/cancelledtrades<br />
<br />
returns a list of all the cancelled trades this last month, list of trade ids in json format .<br />
<br />
==== Full Depth ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/fulldepth<br />
<br />
returns full depth<br />
<br />
==== Private info ====<br />
<br />
https://mtgox.com/api/1/generic/private/info<br />
<br />
returns information about your account, funds, fees, API privileges, withdraw limits . . .<br />
<br />
==== Your open orders ====<br />
<br />
https://mtgox.com/api/1/generic/private/orders<br />
<br />
returns information about your current open orders<br />
<br />
==== Submit an order ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/private/order/add<br />
<br />
parameters: <br />
* type (bid|ask)<br />
* amount_int <amount as int><br />
* price_int <price as int> (can be omitted to place market order)<br />
<br />
submits an order and returns info about success or error<br />
<br />
==== Currency information ====<br />
<br />
https://mtgox.com/api/1/generic/public/currency<br />
<br />
pass parameter ?currency=<currency_symbol><br />
<br />
returns information about a currency ( number of decimals . . . )<br />
<br />
==== HOTP key ====<br />
<br />
https://mtgox.com/api/1/generic/public/hotp_gen<br />
<br />
used to generate a new HOTP key ( useful for developpers )<br />
<br />
== Streaming API ==<br />
Real time streaming data may be obtained over the streaming API, implemented in [http://socket.io/ Socket.io]<ref>Socket.io forum announcement by MagicalTux: https://bitcointalk.org/index.php?topic=14412.msg613271#msg613271</ref>. The original WebSocket API<ref>Original WebSocket thread: https://bitcointalk.org/index.php?topic=5855.msg86219</ref> is deprecated as of 11-Nov-2011.<br />
<br />
===Connecting===<br />
The following JavaScript code establishes a connection in the browser:<br />
<source lang="javascript"><br />
<script src="https://socketio.mtgox.com/socket.io/socket.io.js"></script><br />
<script><br />
var conn = io.connect('https://socketio.mtgox.com/mtgox');<br />
conn.on('message', function(data) {<br />
// Handle incoming data object.<br />
});<br />
</script><br />
</source><br />
<br />
The session ID expires after 30 seconds<br />
<br />
===Handling Events===<br />
Socket.io exposes a simple interface for handling events. Handling <tt>message</tt> events is shown above, but there are other events that may be handled:<br />
<source lang="javascript"><br />
conn.on('connect', onConnect);<br />
conn.on('disconnect', onDisconnect);<br />
conn.on('error', onError);<br />
conn.on('message', onMessage);<br />
</source><br />
<br />
===Incoming Data===<br />
Data arrives as a full object instead of as JSON text, eliminating the need to parse the data in the JavaScript handler. Messages that come across the socket to trigger the <tt>message</tt> event will contain the following minimum components:<br />
<source lang="javascript"><br />
{<br />
"op":<OPERATION_TYPE><br />
}<br />
</source><br />
<br />
The <tt>OPERATION_TYPE</tt> field may take these values:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! OPERATION_TYPE !! Description<br />
|-<br />
| subscribe || Notification that the user is subscribed to a channel<br />
|-<br />
| unsubscribe || Messages will no longer arrive over the channel<br />
|-<br />
| remark || A server message, usually a warning<br />
|-<br />
| private || The operation for depth, trade, and ticker messages<br />
|}<br />
<br />
===op:subscribe and op:unsubscribe===<br />
The subscribe and unsubscribe message data are very simple, containing the channel and the operation.<br />
<source lang="javascript"><br />
{<br />
"channel":<CHANNEL_ID>,<br />
"op":"subscribe" OR "unsubscribe"<br />
}<br />
</source><br />
<br />
Some of the channels are:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Channel ID !! Description<br />
|-<br />
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || Trades<br />
|-<br />
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || Ticker<br />
|-<br />
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || Depth<br />
|}<br />
<br />
===op:remark===<br />
The remark operation contains message and success fields.<br />
<source lang="javascript"><br />
{<br />
"op":"remark",<br />
"message":<MESSAGE FROM THE SERVER>,<br />
"success":<boolean><br />
}<br />
</source><br />
<br />
===op:private===<br />
The payloads of the <tt>op:private</tt> messages contain the real time market information. Each message follows this form:<br />
<br />
<source lang="javascript"><br />
{<br />
"channel":<CHANNEL_ID>,<br />
"op":"private",<br />
"private":<MESSAGE_TYPE>,<br />
<MESSAGE_TYPE>:<DATA_PAYLOAD><br />
}<br />
</source><br />
<br />
The <tt>MESSAGE_TYPE</tt> field may take the values:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! MESSAGE_TYPE !! Description<br />
|-<br />
| ticker || Ticker messages<br />
|-<br />
| trade || Trades, as they occur<br />
|-<br />
| depth || Orders placed or removed<br />
|}<br />
<br />
====Ticker====<br />
Ticker messages contain the current inside Bid and Ask as well as daily highs, lows, and volume. The fields contained in the ticker match those defined in the version 1.0 API above. All fields contain <tt>currency</tt>, <tt>display</tt>, <tt>value</tt>, and <tt>value_int</tt> entries.<br />
<source lang="javascript"><br />
{<br />
"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"ticker",<br />
"ticker":{<br />
"avg":{<br />
"currency":"USD",<br />
"display":"$2.26847",<br />
"value":"2.26847",<br />
"value_int":"226847"<br />
},<br />
"buy":{...},<br />
"high":{...},<br />
"last":{..},<br />
"last_local":{...},<br />
"last_orig":{...},<br />
"low":{...},<br />
"sell":{...},<br />
"vol":{<br />
"currency":"BTC",<br />
"display":"118,696.02104208",<br />
"value":"118696.02104208",<br />
"value_int":"11869602104208"<br />
},<br />
"vwap":{...}<br />
}<br />
}<br />
</source><br />
<br />
====Trade====<br />
<source lang="javascript">{<br />
"channel":"dbf1dee9-4f2e-4a08-8cb7-748919a71b21",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"trade",<br />
"trade":{<br />
"amount":2.71,<br />
"amount_int":"271000000",<br />
"date":1310279340,<br />
"item":"BTC",<br />
"price":14.43,<br />
"price_currency":"USD",<br />
"price_int":"1443000",<br />
"primary":"Y",<br />
"properties":"limit, mixed_currency",<br />
"tid":"1310279340877902",<br />
"trade_type":"bid",<br />
"type":"trade"<br />
}<br />
}<br />
</source><br />
<br />
'''trade''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| amount || the traded amount in item (BTC), float, deprecated<br />
|-<br />
| amount_int || the traded amount * 1E8<br />
|-<br />
| date || unix timestamp of trade<br />
|-<br />
| item || What was this trade about<br />
|-<br />
| price || price per unit, float, deprecated<br />
|-<br />
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)<br />
|-<br />
| price_currency || currency in which trade was completed<br />
|-<br />
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)<br />
|-<br />
| trade_type || Did this trade result from the execution of a bid or a ask?<br />
|-<br />
|}<br />
<br />
====Depth====<br />
<br />
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.<br />
<br />
<source lang="javascript">{<br />
"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",<br />
"depth":{<br />
"currency":"USD",<br />
"item":"BTC",<br />
"now":"1323644358437819",<br />
"price":"14.43",<br />
"price_int":"1443000",<br />
"total_volume_int":"849766000",<br />
"type":1,<br />
"type_str":"ask",<br />
"volume":"-2.71",<br />
"volume_int":"-271000000"<br />
},<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"depth"<br />
}</source><br />
<br />
'''depth''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| currency || the currency affected<br />
|-<br />
| item || the item (BTC)<br />
|-<br />
| price || price as a float, deprecated<br />
|-<br />
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)<br />
|-<br />
| type || 1=ask, 2=bid. deprecated, use type_str<br />
|-<br />
| type_str || type of order at this depth, either "ask" or "bid"<br />
|-<br />
| volume || the volume change as float, deprecated<br />
|-<br />
| volume_int || volume change * 1E8<br />
<br />
|}<br />
<br />
===Possible outgoing commands===<br />
'''unsubscribe''' Stop receiving messages from a channel (parameter "channel")<br />
<br />
=== examples ===<br />
<br />
==== ticker ====<br />
javascript, using hookio : <br />
<br />
http://www.youtube.com/watch?v=KD5ljtNK72U<br />
<br />
http://github.com/hookio<br />
<br />
http://github.com/cronopio/hook.io-mtgox<br />
<br />
Another node.js project, using plain websockets (largely based on cronopio's work) :<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
==== arbitrage ====<br />
https://github.com/goteppo/ArBit<br />
<br />
==== websocket ====<br />
https://github.com/cronopio/hook.io-ws<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
== References ==<br />
<references></references></div>Osmosishttps://tests.bitcoin.it/w/index.php?title=MtGox/API&diff=18558MtGox/API2011-10-26T05:38:03Z<p>Osmosis: /* Authentication */</p>
<hr />
<div>The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.<br />
<br />
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.<br />
<br />
==Number Formats==<br />
<br />
In the "old API", currency- and amount-values (price, volume,...) were given as '''float'''. These values are likely being deprecated and replaced by fields of the same name with "_int" as suffix. These are '''fixed-decimal''', so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.<br />
<br />
In order to convert the '''int''' to a '''decimal''' you can...<br />
<br />
{| class="wikitable"<br />
|-<br />
! kind of field !! ...divide by !! ...multiply by<br />
|-<br />
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001<br />
|-<br />
| USD (price) || 1E5 (100,000) || 0.00001<br />
|-<br />
| JPY (price) || 1E3 (1,000) || 0.001<br />
|}<br />
<br />
Implementation advice: it's probably best to use '''int''' or '''Decimal''' (if your language/db offers such a type) in your clients. Using '''float''' will likely lead to nasty rounding problems.<br />
<br />
== currency symbols ==<br />
List of the Currency symbols you can use with the API :<br />
<br />
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB<br />
<br />
== HTTP API ==<br />
This API is available in <nowiki>https://mtgox.com/api/*</nowiki>, and provides various informations. It also supports making an order, a withdraw, a deposit, etc. There is also a [https://rubygems.org/gems/mtgox Ruby gem] and [[Finance::MtGox|Perl module]] for interacting with the HTTP API.<br />
<br />
=== Authentication ===<br />
<br />
<br />
'''Authentication information may be compromised. See [https://en.bitcoin.it/wiki/Talk:MtGox/API Discussion]''' Delete when verified...<br />
<br />
<br />
Authentication is performed by signing each request using HMAC-SHA512. The request must contain an extra value "nonce" which must be an always incrementing numeric value. In addition to the "nonce" value, your POST data must also include your username and password values, named "name" and "pass" respectively. A reference implementation is provided here:<br />
<source lang="php"><br />
<?php<br />
<br />
function mtgox_query($path, array $req = array()) {<br />
// API settings<br />
$key = '';<br />
$secret = '';<br />
<br />
// generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems<br />
$mt = explode(' ', microtime());<br />
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);<br />
<br />
// generate the POST data string<br />
$post_data = http_build_query($req, '', '&');<br />
<br />
// generate the extra headers<br />
$headers = array(<br />
'Rest-Key: '.$key,<br />
'Rest-Sign: '.base64_encode(hash_hmac('sha512', $post_data, base64_decode($secret), true)),<br />
);<br />
<br />
// our curl handle (initialize if required)<br />
static $ch = null;<br />
if (is_null($ch)) {<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');<br />
}<br />
curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/'.$path);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);<br />
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br />
<br />
// run the query<br />
$res = curl_exec($ch);<br />
if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));<br />
$dec = json_decode($res, true);<br />
if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists');<br />
return $dec;<br />
}<br />
<br />
// example 1: get infos about the account, plus the list of rights we have access to<br />
var_dump(mtgox_query('0/info.php'));<br />
<br />
// old api (get funds)<br />
var_dump(mtgox_query('0/getFunds.php'));<br />
<br />
// trade example<br />
// var_dump(mtgox_query('0/buyBTC.php', array('amount' => 1, 'price' => 15)));<br />
</source><br />
<br />
Python version here: https://bitcointalk.org/index.php?topic=49789.msg592388#msg592388<br />
<br />
=== Cache ===<br />
<br />
All of the API methods below have cached results, ticker, depth . . . have a 10 seconds cache .<br />
No need to poll more often, you wont have more results, you could just be blocked by the prolexic anti ddos features.<br />
<br />
=== Methods API version 0===<br />
<br />
==== 0/data/getTrades.php ====<br />
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.<br />
<br />
Parameters:<br />
* since: Passing a tid in "since" allows retrieving all trades since that trade. The passed id is may not exist. Ie. to get all trades from the very beginning one would just call https://mtgox.com/code/data/getTrades.php?since=0 . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since.<br />
<br />
* data is returned in standard json format like :<br />
<source lang="php"><br />
[<br />
{"date":1279408157,<br />
"price":"0.04951",<br />
"amount":"20",<br />
"price_int":"4951",<br />
"amount_int":"2000000000",<br />
"tid":"1",<br />
"price_currency":"USD",<br />
"item":"BTC",<br />
"trade_type":""<br />
"primary":"Y"<br />
},<br />
{"date":1279424586,"price":"0.05941","amount":"50.01","price_int":"5941","amount_int":"5001000000","tid":"2","price_currency":"USD","item":"BTC","trade_type":""}]<br />
</source><br />
<br />
==== 0/getDepth.php ====<br />
Get the current Market depth<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=AUD<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=USD<br />
<br />
==== 0/getFunds.php ====<br />
Get your current balance<br />
<br />
https://mtgox.com/api/0/getFunds.php<br />
<br />
getfunds is now deprecated since multi currency, please use info.php<br />
<br />
==== 0/buyBTC.php ====<br />
Place an order to Buy BTC<br />
<br />
https://mtgox.com/api/0/buyBTC.php<br />
<br />
POST data: amount=#&price=#&Currency=PLN<br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/sellBTC.php ====<br />
Place an order to Sell BTC<br />
<br />
https://mtgox.com/api/0/sellBTC.php<br />
<br />
POST data: &amount=#&price=#&Currency=PLN <br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/getOrders.php ====<br />
Fetch a list of your open Orders<br />
<br />
https://mtgox.com/api/0/getOrders.php<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
status: 1 for active, 2 for not enough funds<br />
<br />
==== 0/cancelOrder.php ====<br />
Cancel an order<br />
<br />
https://mtgox.com/api/0/cancelOrder.php<br />
<br />
POST data: oid=#&type=#<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
==== 0/redeemCode.php ====<br />
Used to redeem a mtgox coupon code<br />
<br />
https://mtgox.com/api/0/redeemCode.php<br />
<br />
* call with a post parameter "code" containing the code to redeem<br />
<br />
* it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status<br />
<br />
==== 0/withdraw.php ====<br />
withdraw / Send BTC<br />
<br />
https://mtgox.com/api/0/withdraw.php<br />
<br />
POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#<br />
<br />
* pass btca parameter to withdraw to a btc adress<br />
<br />
* pass group1 for a coupon : BTC2CODE or USD2CODE<br />
<br />
* pass group1=DWUSD for a dwolla withdraw<br />
<br />
* pass green=1 to use the new greenaddress feature ( see [[GreenAddress]] )<br />
* return code and status if successful<br />
<br />
To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )<br />
<br />
==== 0/btcAddress.php ====<br />
get a bitcoin deposit adress for your account <br />
<br />
https://mtgox.com/api/0/btcAddress.php<br />
<br />
* pass POST data "description" to add a description that will appear in your history when this BTC address receive a deposit<br />
<br />
* returns a bitcoin deposit address<br />
<br />
==== 0/history_[CUR].csv ====<br />
<br />
Allows downloading your activity history for a given currency (BTC or USD for now).<br />
<br />
https://mtgox.com/api/0/history_BTC.csv<br />
<br />
https://mtgox.com/api/0/history_USD.csv<br />
<br />
==== 0/info.php ====<br />
<br />
https://mtgox.com/api/0/info.php<br />
<br />
returns info about your account, funds, fees, API privileges . . . <br />
<br />
==== 0/ticker ====<br />
<br />
http://mtgox.com/api/0/data/ticker.php<br />
<br />
returns the current ticker :<br />
<br />
<source lang="php"><br />
{"ticker":<br />
{<br />
"high":5.70653,<br />
"low":5.4145,<br />
"avg":5.561388723,<br />
"vwap":5.610932845,<br />
"vol":55698,<br />
"last":5.56915,<br />
"buy":5.51326,<br />
"sell":5.5672<br />
}<br />
}<br />
</source><br />
<br />
what is vwap ? <br />
<br />
please see http://en.wikipedia.org/wiki/VWAP<br />
<br />
=== API version 0 examples ===<br />
<br />
==== all api shell type CLI ====<br />
<br />
python : http://www.goxsh.info/<br />
<br />
perl : http://pastebin.com/vEpgw5nW<br />
<br />
==== other ====<br />
<br />
https : http://stackoverflow.com/questions/7046370/https-request-with-boost-asio-and-openssl<br />
<br />
https://github.com/sje397/mtgox-plasmoid<br />
<br />
module perl : http://search.cpan.org/~mndrix/Finance-MtGox-0.02/<br />
<br />
==== gather data ====<br />
<br />
https://github.com/Lexiks/MyBitBoard<br />
<br />
==== gettrade ====<br />
<br />
bash : https://bitcointalk.org/index.php?topic=39402.0<br />
<br />
perl : http://pastebin.com/raw.php?i=pmhMXZJu<br />
<br />
==== ticker ====<br />
<br />
http://pastebin.com/pd0ZR4WY<br />
<br />
=== Methods API version 1===<br />
<br />
==== Multi Currency Ticker ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/ticker<br />
https://mtgox.com/api/1/BTCEUR/public/ticker<br />
<br />
returns the current ticker for the selected currency :<br />
<br />
<source lang="php"><br />
{<br />
"result":"success",<br />
"return":<br />
{<br />
"high": {"value":"5.70653","value_int":"570653","display":"$5.70653","currency":"USD"},<br />
"low": {"value":"5.4145","value_int":"541450","display":"$5.41450","currency":"USD"},<br />
"avg": {"value":"5.561119626","value_int":"556112","display":"$5.56112","currency":"USD"},<br />
"vwap": {"value":"5.610480461","value_int":"561048","display":"$5.61048","currency":"USD"},<br />
"vol":<br />
{<br />
"value":"55829.58960346",<br />
"value_int":"5582958960346",<br />
"display":"55,829.58960346\u00a0BTC",<br />
"currency":"BTC"<br />
},<br />
"last_local":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last_orig":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"buy":{"value":"5.53587","value_int":"553587","display":"$5.53587","currency":"USD"},<br />
"sell":{"value":"5.56031","value_int":"556031","display":"$5.56031","currency":"USD"}<br />
}<br />
</source><br />
<br />
note : last_local include only the last trade in the selected currency, last_orig include data of the original last trade ( currency,price in currency . . . ),last can be a conversion of the last trde in another currency<br />
<br />
==== Multi Currency depth ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/depth?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/depth?raw<br />
<br />
==== Multi currency trades ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/trades?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/trades?raw<br />
<br />
to get only the trades since a given trade id, you can add the parameter since=<trade_id><br />
<br />
https://mtgox.com/api/1/BTCUSD/public/trades?since=0<br />
<br />
https://mtgox.com/api/1/BTCEUR/public/trades?since=1316312781670700<br />
<br />
For multi currency,also returns the primary value,"Y" or "N", the primary currency is always the buyers currency<br />
<br />
A trade can appear in more than one currency, to ignore duplicates, use only the trades having primary =Y<br />
<br />
example of returned data : <br />
<source lang="php"><br />
{"date":1316312781,<br />
"price":"3.5599",<br />
"amount":"3.6900096",<br />
"price_int":"355990",<br />
"amount_int":"369000960",<br />
"tid":"1316312781670700",<br />
"price_currency":"EUR",<br />
"item":"BTC",<br />
"trade_type":"bid",<br />
"primary":"Y",<br />
"properties":"limit,mixed_currency"<br />
}<br />
</source><br />
<br />
==== Cancelled Trades ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/cancelledtrades<br />
<br />
returns a list of all the cancelled trades this last month, list of trade ids in json format .<br />
<br />
==== Full Depth ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/fulldepth<br />
<br />
returns full depth<br />
<br />
== Websocket API ==<br />
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0<br />
<br />
===Connecting===<br />
<br />
You can connect via: ws://websocket.mtgox.com/mtgox<br />
<br />
The WebSocket protocol version used is that described in [http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00 draft-ietf-hybi-thewebsocketprotocol-00] (aka draft-00).<br />
<br />
===Channels===<br />
<br />
The websocket will subscribe you to some channels automatically:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Channel ID !! Description<br />
|-<br />
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)<br />
|-<br />
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)<br />
|-<br />
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)<br />
|}<br />
<br />
Additionally each user has a "own" channel which streams informations about orders (new order, deleted order, etc) and trades only the user's trades).<br />
<br />
Each message is a JSON-encoded object, with at least "op" element. The "op" element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).<br />
<br />
===Possible outgoing commands===<br />
<br />
'''unsubscribe''' Stop receiving messages from a channel (parameter "channel")<br />
<br />
===Incoming Data===<br />
<br />
====Ticker====<br />
<source lang="javascript"><br />
{<br />
"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"ticker",<br />
"ticker":{<br />
"buy":0.9515,<br />
"high":1,<br />
"low":0.91,<br />
"sell":0.9697,<br />
"vol":34349<br />
}<br />
}<br />
</source><br />
<br />
'''ticker''' contains the following:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| buy || highest bid as float<br />
|-<br />
| sell || lowest ask as float<br />
|-<br />
| high || maximum rate since last close as float<br />
|-<br />
| low || minimum rate since last close as float<br />
|-<br />
| vol || traded volume since last close<br />
|}<br />
<br />
====Trade====<br />
<br />
<source lang="javascript">{<br />
"channel":"dbf1dee9-4f2e-4a08-8cb7-748919a71b21",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"trade",<br />
"trade":{<br />
"amount":2.71,<br />
"amount_int":"271000000",<br />
"date":1310279340,<br />
"item":"BTC",<br />
"price":14.43,<br />
"price_currency":"USD",<br />
"price_int":"1443000",<br />
"tid":"1310279340877902",<br />
"trade_type":"bid",<br />
"type":"trade"<br />
}<br />
}<br />
</source><br />
<br />
'''trade''' contains the following:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| amount || the traded amount in item (BTC), float, deprecated<br />
|-<br />
| amount_int || the traded amount * 1E8<br />
|-<br />
| date || unix timestamp of trade<br />
|-<br />
| item || What was this trade about<br />
|-<br />
| price || price per unit, float, deprecated<br />
|-<br />
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)<br />
|-<br />
| price_currency || currency in which trade was completed<br />
|-<br />
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)<br />
|-<br />
| trade_type || Did this trade result from the execution of a bid or a ask?<br />
|-<br />
|}<br />
<br />
====Depth====<br />
<br />
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.<br />
<br />
<source lang="javascript">{<br />
"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",<br />
"depth":{<br />
"currency":"USD",<br />
"item":"BTC",<br />
"price":"14.43",<br />
"price_int":"1443000",<br />
"type":1,<br />
"type_str":"ask",<br />
"volume":"-2.71",<br />
"volume_int":"-271000000"<br />
},<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"depth"<br />
}</source><br />
<br />
'''depth''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| currency || the currency affected<br />
|-<br />
| item || the item (BTC)<br />
|-<br />
| price || price as a float, deprecated<br />
|-<br />
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)<br />
|-<br />
| type || 1=ask, 2=bid. deprecated, use type_str<br />
|-<br />
| type_str || type of order at this depth, either "ask" or "bid"<br />
|-<br />
| volume || the volume change as float, deprecated<br />
|-<br />
| volume_int || volume change * 1E8<br />
<br />
|}<br />
<br />
=== examples ===<br />
<br />
==== ticker ====<br />
javascript, using hookio : <br />
<br />
http://www.youtube.com/watch?v=KD5ljtNK72U<br />
<br />
http://github.com/hookio<br />
<br />
http://github.com/cronopio/hook.io-mtgox<br />
<br />
<br />
<br />
Another node.js project, using plain websockets (largely based on cronopio's work) :<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
==== arbitrage ====<br />
https://github.com/goteppo/ArBit<br />
<br />
==== websocket ====<br />
https://github.com/cronopio/hook.io-ws<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=MtGox/API&diff=18405MtGox/API2011-10-23T04:34:37Z<p>Osmosis: </p>
<hr />
<div>The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.<br />
<br />
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.<br />
<br />
==Number Formats==<br />
<br />
In the "old API", currency- and amount-values (price, volume,...) were given as '''float'''. These values are likely being deprecated and replaced by fields of the same name with "_int" as suffix. These are '''fixed-decimal''', so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.<br />
<br />
In order to convert the '''int''' to a '''decimal''' you can...<br />
<br />
{| class="wikitable"<br />
|-<br />
! kind of field !! ...divide by !! ...multiply by<br />
|-<br />
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001<br />
|-<br />
| USD (price) || 1E5 (100,000) || 0.00001<br />
|-<br />
| JPY (price) || 1E3 (1,000) || 0.001<br />
|}<br />
<br />
Implementation advice: it's probably best to use '''int''' or '''Decimal''' (if your language/db offers such a type) in your clients. Using '''float''' will likely lead to nasty rounding problems.<br />
<br />
== currency symbols ==<br />
List of the Currency symbols you can use with the API :<br />
<br />
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB<br />
<br />
== HTTP API ==<br />
This API is available in <nowiki>https://mtgox.com/api/*</nowiki>, and provides various informations. It also supports making an order, a withdraw, a deposit, etc. There is also a [https://rubygems.org/gems/mtgox Ruby gem] and [[Finance::MtGox|Perl module]] for interacting with the HTTP API.<br />
<br />
=== Authentication ===<br />
<br />
<br />
'''Authentication information may be compromised. See [https://en.bitcoin.it/wiki/Talk:MtGox/API Discussion]''' Delete when verified...<br />
<br />
<br />
Authentication is performed by signing each request using HMAC-SHA512. The request must contain an extra value "nonce" which must be an always incrementing numeric value. In addition to the "nonce" value, your POST data must also include your username and password values, named "name" and "pass" respectively. A reference implementation is provided here:<br />
<source lang="php"><br />
<?php<br />
<br />
function mtgox_query($path, array $req = array()) {<br />
// API settings<br />
$key = '';<br />
$secret = '';<br />
<br />
// generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems<br />
$mt = explode(' ', microtime());<br />
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);<br />
<br />
// generate the POST data string<br />
$post_data = http_build_query($req, '', '&');<br />
<br />
// generate the extra headers<br />
$headers = array(<br />
'Rest-Key: '.$key,<br />
'Rest-Sign: '.base64_encode(hash_hmac('sha512', $post_data, base64_decode($secret), true)),<br />
);<br />
<br />
// our curl handle (initialize if required)<br />
static $ch = null;<br />
if (is_null($ch)) {<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');<br />
}<br />
curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/'.$path);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);<br />
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br />
<br />
// run the query<br />
$res = curl_exec($ch);<br />
if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch));<br />
$dec = json_decode($res, true);<br />
if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists');<br />
return $dec;<br />
}<br />
<br />
// example 1: get infos about the account, plus the list of rights we have access to<br />
var_dump(mtgox_query('0/info.php'));<br />
<br />
// old api (get funds)<br />
var_dump(mtgox_query('0/getFunds.php'));<br />
<br />
// trade example<br />
// var_dump(mtgox_query('0/buyBTC.php', array('amount' => 1, 'price' => 15)));<br />
</source><br />
<br />
=== Cache ===<br />
<br />
All of the API methods below have cached results, ticker, depth . . . have a 10 seconds cache .<br />
No need to poll more often, you wont have more results, you could just be blocked by the prolexic anti ddos features.<br />
<br />
=== Methods API version 0===<br />
<br />
==== 0/data/getTrades.php ====<br />
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.<br />
<br />
Parameters:<br />
* since: Passing a tid in "since" allows retrieving all trades since that trade. The passed id is may not exist. Ie. to get all trades from the very beginning one would just call https://mtgox.com/code/data/getTrades.php?since=0 . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since.<br />
<br />
* data is returned in standard json format like :<br />
<source lang="php"><br />
[<br />
{"date":1279408157,<br />
"price":"0.04951",<br />
"amount":"20",<br />
"price_int":"4951",<br />
"amount_int":"2000000000",<br />
"tid":"1",<br />
"price_currency":"USD",<br />
"item":"BTC",<br />
"trade_type":""<br />
"primary":"Y"<br />
},<br />
{"date":1279424586,"price":"0.05941","amount":"50.01","price_int":"5941","amount_int":"5001000000","tid":"2","price_currency":"USD","item":"BTC","trade_type":""}]<br />
</source><br />
<br />
==== 0/getDepth.php ====<br />
Get the current Market depth<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=AUD<br />
<br />
https://mtgox.com/api/0/data/getDepth.php?Currency=USD<br />
<br />
==== 0/getFunds.php ====<br />
Get your current balance<br />
<br />
https://mtgox.com/api/0/getFunds.php<br />
<br />
getfunds is now deprecated since multi currency, please use info.php<br />
<br />
==== 0/buyBTC.php ====<br />
Place an order to Buy BTC<br />
<br />
https://mtgox.com/api/0/buyBTC.php<br />
<br />
POST data: amount=#&price=#&Currency=PLN<br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/sellBTC.php ====<br />
Place an order to Sell BTC<br />
<br />
https://mtgox.com/api/0/sellBTC.php<br />
<br />
POST data: &amount=#&price=#&Currency=PLN <br />
<br />
returns a list of your open orders<br />
<br />
you can omit the price to do a market order<br />
<br />
==== 0/getOrders.php ====<br />
Fetch a list of your open Orders<br />
<br />
https://mtgox.com/api/0/getOrders.php<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
status: 1 for active, 2 for not enough funds<br />
<br />
==== 0/cancelOrder.php ====<br />
Cancel an order<br />
<br />
https://mtgox.com/api/0/cancelOrder.php<br />
<br />
POST data: oid=#&type=#<br />
<br />
oid: Order ID<br />
<br />
type: 1 for sell order or 2 for buy order<br />
<br />
==== 0/redeemCode.php ====<br />
Used to redeem a mtgox coupon code<br />
<br />
https://mtgox.com/api/0/redeemCode.php<br />
<br />
* call with a post parameter "code" containing the code to redeem<br />
<br />
* it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status<br />
<br />
==== 0/withdraw.php ====<br />
withdraw / Send BTC<br />
<br />
https://mtgox.com/api/0/withdraw.php<br />
<br />
POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#<br />
<br />
* pass btca parameter to withdraw to a btc adress<br />
<br />
* pass group1 for a coupon : BTC2CODE or USD2CODE<br />
<br />
* pass group1=DWUSD for a dwolla withdraw<br />
<br />
* pass green=1 to use the new greenaddress feature ( see [[GreenAddress]] )<br />
* return code and status if successful<br />
<br />
To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )<br />
<br />
==== 0/btcAddress.php ====<br />
get a bitcoin deposit adress for your account <br />
<br />
https://mtgox.com/api/0/btcAddress.php<br />
<br />
* pass POST data "description" to add a description that will appear in your history when this BTC address receive a deposit<br />
<br />
* returns a bitcoin deposit address<br />
<br />
==== 0/history_[CUR].csv ====<br />
<br />
Allows downloading your activity history for a given currency (BTC or USD for now).<br />
<br />
https://mtgox.com/api/0/history_BTC.csv<br />
<br />
https://mtgox.com/api/0/history_USD.csv<br />
<br />
==== 0/info.php ====<br />
<br />
https://mtgox.com/api/0/info.php<br />
<br />
returns info about your account, funds, fees, API privileges . . . <br />
<br />
==== 0/ticker ====<br />
<br />
http://mtgox.com/api/0/data/ticker.php<br />
<br />
returns the current ticker :<br />
<br />
<source lang="php"><br />
{"ticker":<br />
{<br />
"high":5.70653,<br />
"low":5.4145,<br />
"avg":5.561388723,<br />
"vwap":5.610932845,<br />
"vol":55698,<br />
"last":5.56915,<br />
"buy":5.51326,<br />
"sell":5.5672<br />
}<br />
}<br />
</source><br />
<br />
<br />
=== API version 0 examples ===<br />
<br />
==== all api shell type CLI ====<br />
<br />
python : http://www.goxsh.info/<br />
<br />
perl : http://pastebin.com/vEpgw5nW<br />
<br />
==== other ====<br />
<br />
https : http://stackoverflow.com/questions/7046370/https-request-with-boost-asio-and-openssl<br />
<br />
https://github.com/sje397/mtgox-plasmoid<br />
<br />
module perl : http://search.cpan.org/~mndrix/Finance-MtGox-0.02/<br />
<br />
==== gather data ====<br />
<br />
https://github.com/Lexiks/MyBitBoard<br />
<br />
==== gettrade ====<br />
<br />
bash : https://bitcointalk.org/index.php?topic=39402.0<br />
<br />
perl : http://pastebin.com/raw.php?i=pmhMXZJu<br />
<br />
==== ticker ====<br />
<br />
http://pastebin.com/pd0ZR4WY<br />
<br />
=== Methods API version 1===<br />
<br />
==== Multi Currency Ticker ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/ticker<br />
https://mtgox.com/api/1/BTCEUR/public/ticker<br />
<br />
returns the current ticker for the selected currency :<br />
<br />
<source lang="php"><br />
{<br />
"result":"success",<br />
"return":<br />
{<br />
"high": {"value":"5.70653","value_int":"570653","display":"$5.70653","currency":"USD"},<br />
"low": {"value":"5.4145","value_int":"541450","display":"$5.41450","currency":"USD"},<br />
"avg": {"value":"5.561119626","value_int":"556112","display":"$5.56112","currency":"USD"},<br />
"vwap": {"value":"5.610480461","value_int":"561048","display":"$5.61048","currency":"USD"},<br />
"vol":<br />
{<br />
"value":"55829.58960346",<br />
"value_int":"5582958960346",<br />
"display":"55,829.58960346\u00a0BTC",<br />
"currency":"BTC"<br />
},<br />
"last_local":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last_orig":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"last":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},<br />
"buy":{"value":"5.53587","value_int":"553587","display":"$5.53587","currency":"USD"},<br />
"sell":{"value":"5.56031","value_int":"556031","display":"$5.56031","currency":"USD"}<br />
}<br />
</source><br />
<br />
note : last_local include only the last trade in the selected currency, last_orig include data of the original last trade ( currency,price in currency . . . ),last can be a conversion of the last trde in another currency<br />
<br />
==== Multi Currency depth ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/depth?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/depth?raw<br />
<br />
==== Multi currency trades ====<br />
<br />
https://mtgox.com/api/1/BTCPLN/public/trades?raw<br />
<br />
https://mtgox.com/api/1/BTCAUD/public/trades?raw<br />
<br />
to get only the trades since a given trade id, you can add the parameter since=<trade_id><br />
<br />
https://mtgox.com/api/1/BTCUSD/public/trades?since=0<br />
<br />
https://mtgox.com/api/1/BTCEUR/public/trades?since=1316312781670700<br />
<br />
For multi currency,also returns the primary value,"Y" or "N", the primary currency is always the buyers currency<br />
<br />
A trade can appear in more than one currency, to ignore duplicates, use only the trades having primary =Y<br />
<br />
example of returned data : <br />
<source lang="php"><br />
{"date":1316312781,<br />
"price":"3.5599",<br />
"amount":"3.6900096",<br />
"price_int":"355990",<br />
"amount_int":"369000960",<br />
"tid":"1316312781670700",<br />
"price_currency":"EUR",<br />
"item":"BTC",<br />
"trade_type":"bid",<br />
"primary":"Y",<br />
"properties":"limit,mixed_currency"<br />
}<br />
</source><br />
<br />
==== Cancelled Trades ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/cancelledtrades<br />
<br />
returns a list of all the cancelled trades this last month, list of trade ids in json format .<br />
<br />
==== Full Depth ====<br />
<br />
https://mtgox.com/api/1/BTCUSD/public/fulldepth<br />
<br />
returns full depth<br />
<br />
== Websocket API ==<br />
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0<br />
<br />
===Connecting===<br />
<br />
You can connect via: ws://websocket.mtgox.com/mtgox<br />
<br />
The WebSocket protocol version used is that described in [http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00 draft-ietf-hybi-thewebsocketprotocol-00] (aka draft-00).<br />
<br />
===Channels===<br />
<br />
The websocket will subscribe you to some channels automatically:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Channel ID !! Description<br />
|-<br />
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)<br />
|-<br />
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)<br />
|-<br />
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)<br />
|}<br />
<br />
Additionally each user has a "own" channel which streams informations about orders (new order, deleted order, etc) and trades only the user's trades).<br />
<br />
Each message is a JSON-encoded object, with at least "op" element. The "op" element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).<br />
<br />
===Possible outgoing commands===<br />
<br />
'''unsubscribe''' Stop receiving messages from a channel (parameter "channel")<br />
<br />
===Incoming Data===<br />
<br />
====Ticker====<br />
<source lang="javascript"><br />
{<br />
"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"ticker",<br />
"ticker":{<br />
"buy":0.9515,<br />
"high":1,<br />
"low":0.91,<br />
"sell":0.9697,<br />
"vol":34349<br />
}<br />
}<br />
</source><br />
<br />
'''ticker''' contains the following:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| buy || highest bid as float<br />
|-<br />
| sell || lowest ask as float<br />
|-<br />
| high || maximum rate since last close as float<br />
|-<br />
| low || minimum rate since last close as float<br />
|-<br />
| vol || traded volume since last close<br />
|}<br />
<br />
====Trade====<br />
<br />
<source lang="javascript">{<br />
"channel":"dbf1dee9-4f2e-4a08-8cb7-748919a71b21",<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"trade",<br />
"trade":{<br />
"amount":2.71,<br />
"amount_int":"271000000",<br />
"date":1310279340,<br />
"item":"BTC",<br />
"price":14.43,<br />
"price_currency":"USD",<br />
"price_int":"1443000",<br />
"tid":"1310279340877902",<br />
"trade_type":"bid",<br />
"type":"trade"<br />
}<br />
}<br />
</source><br />
<br />
'''trade''' contains the following:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| amount || the traded amount in item (BTC), float, deprecated<br />
|-<br />
| amount_int || the traded amount * 1E8<br />
|-<br />
| date || unix timestamp of trade<br />
|-<br />
| item || What was this trade about<br />
|-<br />
| price || price per unit, float, deprecated<br />
|-<br />
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)<br />
|-<br />
| price_currency || currency in which trade was completed<br />
|-<br />
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)<br />
|-<br />
| trade_type || Did this trade result from the execution of a bid or a ask?<br />
|-<br />
|}<br />
<br />
====Depth====<br />
<br />
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.<br />
<br />
<source lang="javascript">{<br />
"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",<br />
"depth":{<br />
"currency":"USD",<br />
"item":"BTC",<br />
"price":"14.43",<br />
"price_int":"1443000",<br />
"type":1,<br />
"type_str":"ask",<br />
"volume":"-2.71",<br />
"volume_int":"-271000000"<br />
},<br />
"op":"private",<br />
"origin":"broadcast",<br />
"private":"depth"<br />
}</source><br />
<br />
'''depth''' contains the following:<br />
<br />
:{| class="wikitable"<br />
|-<br />
! Name !! Value<br />
|-<br />
| currency || the currency affected<br />
|-<br />
| item || the item (BTC)<br />
|-<br />
| price || price as a float, deprecated<br />
|-<br />
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)<br />
|-<br />
| type || 1=ask, 2=bid. deprecated, use type_str<br />
|-<br />
| type_str || type of order at this depth, either "ask" or "bid"<br />
|-<br />
| volume || the volume change as float, deprecated<br />
|-<br />
| volume_int || volume change * 1E8<br />
<br />
|}<br />
<br />
=== examples ===<br />
<br />
==== ticker ====<br />
javascript, using hookio : <br />
<br />
http://www.youtube.com/watch?v=KD5ljtNK72U<br />
<br />
http://github.com/hookio<br />
<br />
http://github.com/cronopio/hook.io-mtgox<br />
<br />
<br />
<br />
Another node.js project, using plain websockets (largely based on cronopio's work) :<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client<br />
<br />
==== arbitrage ====<br />
https://github.com/goteppo/ArBit<br />
<br />
==== websocket ====<br />
https://github.com/cronopio/hook.io-ws<br />
<br />
https://github.com/dlanod/node-mtgox-websocket-client</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Deflationary_spiral&diff=16239Deflationary spiral2011-09-07T00:01:40Z<p>Osmosis: </p>
<hr />
<div>'''Deflationary spiral''' is an economic argument that proposes that runaway deflation can eventually lead to the collapse of the currency given certain conditions and constraints. It is a common criticism made against the viability of [[Bitcoin]].<br />
The ‘deflationary spiral’ is a real condition that affects the fiat fractional reserve backing system. Bitcoin is not affected by this because it is fundamentally different from fiat currency. (See below for a dissenting argument on this topic.)<br />
<br />
Deflation is a decline in the general price level. Deflation occurs when the price of goods and services, relative to a specific measure, decline. It is not necessarily that the value of the goods and services themselves declined, but can be because the value of the currency itself increased. <br />
<br />
For example, let us consider an economy comprised entirely of beef and oranges where the medium of exchange is gold. Both beef and oranges can decay and are not consistent, and therefore cannot be used as a currency. In order to trade, people exchange gold for either beef or oranges. They see gold as a store of value that they can use to purchase beef or oranges in the future. What happens when the economy grows and we can produce more beef and more oranges? The price of both beef and oranges will decline. To the extent our productive capacity for both beef and oranges increased at the same pace, the exchange value between the two (the amount of beef for a given number of oranges) will likely stay the same; however, those who held gold as a store of value would now be able to purchase more beef and more oranges for a given amount of gold. <br />
<br />
A deflationary spiral occurs when the value of a currency, relative to the goods in an economy, increases continually as a result of hoarding. As the value of the currency relative to the goods in the economy increase, people have the incentive to hoard the currency, because by merely holding it, they hope to be able to purchase more goods for less money in the future. A lack of currency available in the market causes the price of goods to further decrease, resulting in more hoarding. <br />
<br />
In our economy of beef and oranges it is easy to see how this could occur. First, people see a significant gain in productivity on the horizon; we will be able to produce more beef and oranges for the same effort in the future. The supply of gold, however, is fixed. As a result, people desire to hold gold, because they will be able to purchase more beef and oranges with their gold in the future than they can now. This will lead to a decline in the price of beef and oranges as measured by gold (an increase in the value of gold). Limiting the amount of currency in the market available for exchange can also make transactions more difficult. In a complex system where we do not only have beef, oranges and gold, this can result in a deflationary spiral where no one wishes to spend their currency and the economy itself slows as a result of the limited number of transactions. Limited demand with fixed output results in a decline in prices, which further exacerbates the problem. <br />
<br />
Alternative explanation:<br />
A deflationary spiral occurs when the price of a traded article increases at some given rate, which causes people to hoard it. As people hoard the commodity, less and less of it is available thus causing the price to go up even more. In turn, even more people hoard the commodity. Thus a feedback loop or spiral of deflation occurs.<br /><br />
<br />
In practice, there is only a limited amount of 'value' that can be placed upon a good before it becomes too attractive to trade for other goods (thus ending the spiral). The only time that the 'Deflationary Spiral' can happen (to it's conclusion) is when people can foresee a time where they are forced to use that particular traded article. See below for a dissenting argument on this topic. <br />
<br />
==In The Fiat Fractional Reserve Banking System==<br />
The fiat money that we trade consists of the principal of the loans of other people. All this money must be someday 'repaid.' When people save (pay back their loans), the total monetary supply contracts. When people spend (take out loans), the total monetary supply is increasing.<br />
<br />
If you have people who are hoarding money, the principal still needs to be repaid. Hoarding will make it harder for other people in the economy to pay back their loans.<br />
<br />
Because people foresee a time where they need to pay back their loans (a future fixed expense), when the value of the money starts to increase (deflation), those with loans will endeavour to pay back the loans quicker. This causes the monetary supply to reduce, reducing the total amount of money available for repayment of loans, again making it harder for people to pay back what they owe.<br />
<br />
This Deflationary spiral diverts funds away from the legitimate economy, to the repayment of debt. Causing the economy to stagnate and stop.<br />
<br />
==Bitcoin==<br />
The key difference is that people don't foresee a fixed cost (unit amount) that they must pay with Bitcoin. If the value of the Bitcoins that they own increases, then any future cost will take a proportionally smaller amount of Bitcoins. There isn't any fixed incentive to holding Bitcoin other than speculation.<br />
<br />
If the economy that uses Bitcoin grows, the per-unit value of Bitcoin proportionally increases also.<br />
<br />
Everything is the opposite to the fiat fractional reserve banking system (because Bitcoin isn't a debt but an asset). Bitcoins '''only''' deflate in value when the Bitcoin Economy is '''growing'''.<br />
<br />
Because the Deflationary spiral is a real problem in the traditional monetary system, doesn't necessarily mean that it will also be a problem in the Bitcoin economy.<br />
<br />
<blockquote><br />
"Elaborate controls to make sure that currency is not produced in greater numbers is not something any other currency, like the dollar or the euro, has," says Russ Roberts, professor of economics at George Mason University. The consequence will likely be slow and steady deflation, as the growth in circulating bitcoins declines and their value rises.<br />
<br />
"That is considered very destructive in today's economies, mostly because when it occurs, it is unexpected," says Roberts. But he thinks that won't apply in an economy where deflation is expected. "In a Bitcoin world, everyone would anticipate that, and they know what they got paid would buy more then than it would now."<br />
</blockquote><br />
--MIT Technology Review: [http://www.technologyreview.com/computing/37619/page2/ What Bitcoin Is, and Why It Matters], May 25, 2011<br />
<br />
==Alternative Viewpoint==<br />
A deflationary spiral occurs when there is an incentive to hoard because of declining prices, which results in even less available currency on the market, further perpetuating declining prices. <br />
<br />
How could this occur in the Bitcoin market? First, we see massive deflation occurring in the market right now, as the value of a Bitcoin relative to other currencies, and as a result goods and services as well, increases. To the extent there is value in a Bitcoin because there will be a limited number of them in the future and they are one of the few untraceable mediums of exchange that cannot be subjected to expropriation (at the moment), it is easy to see why their value is currently increasing. Already, however, this is creating the incentive for hoarding. Given there is a known limit on the future amount of Bitcoins in existence, the market expects that the "price" of Bitcoins as measured in other currencies will increase.<br />
<br />
While this will not necessarily lead to a deflationary spiral, it will likely cause serious problems for Bitcoin which could ultimately trigger Bitcoin's demise, as outlined below. <br />
<br />
1. Currently, with knowledge that there will be a limited number of Bitcoins in the future, the price of Bitcoins is increasing rapidly. The result is limited price stability. Limited price stability has a negative impact on the acceptance of a currency. Vendors do not wish to speculate on the price of currency when selling goods or services.<br />
<br />
2. Once prices do stabilize in the future, there will always be the knowledge that the number of Bitcoins in the market is limited. As a result, to the extent the GDP of the Bitcoin economy increases (the total value of all Bitcoin transactions completed increases in "real" terms), there will continue to be price deflation. Price deflation rewards the holders of the existing currency and provides an incentive to hoard the currency. The value held by the existing holders of the currency, and the resulting reward that they receive for future deflation, can be eliminated by a competing system. As a result, to the extent there is an expectation for inflation because demand for the currency itself is greater than the supply of Bitcoins, a competing system will emerge. <br />
<br />
Fundamentally, the growth of Bitcoin will be limited because of the knowledge that there is a limited supply of coins. The fact that there is a limited supply of coins means that there is an expectation of deflation if the economy grows. The "cost" of that deflation, borne by new users, can be avoided if an alternative system is used. <br />
<br />
While this is not a traditional deflationary spiral, the constraint on the actual money supply can produce the same result, which is a limit on the value of goods and services transacted using Bitcoins.<br />
<br />
What can be done to deal with this issue?<br />
<br />
An alternative is technically possible through revised software. The supply of Bitcoins could grow in proportion to the total value of transactions undertaken using the system. This would lead to price stability and will eliminate the benefit that accrues to existing holders of the currency. Because those holding Bitcoins would likekly not choose to use the revised software as it devalues their holdings, it is doubtful this alternative would be adopted without causing a fork.<br />
<br />
==See Also==<br />
<br />
* [[Controlled inflation]]<br />
* [[Bitcoin Days Destroyed]]<br />
* [http://bitcoin.stackexchange.com/questions/408/does-hoarding-really-hurt-bitcoin Does hoarding really hurt bitcoin?] on stackexchange.com<br />
[[Category:Economics]]</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Software&diff=15853Software2011-09-01T04:11:06Z<p>Osmosis: </p>
<hr />
<div>List of Bitcoin-related software. See also [[:Category:Software|Category:Software]].<br />
<br />
==Bitcoin clients==<br />
===Bitcoin clients===<br />
*[[Original Bitcoin client|Bitcoin client]] - standard Bitcoin client, recommended for installation<br />
*[[bitcoind]] - GUI-less version of the standard Bitcoin client, providing [[API reference (JSON-RPC)|JSON-RPC]] interface (see also -server option of the standard client)<br />
<br />
===Frontends to bitcoind===<br />
*[[BitcoinApp]] - RPC client for iOS devices (iPhone, iPad, iPodTouch)<br />
*[[Bitcoiner]] - Java RPC client (Android)<br />
*[[Bitcoin-js-remote]] - JavaScript RPC client, support for QR codes<br />
*[[Bitcoin-qt]] - C++/Qt based tabbed UI for Bitcoin, Linux/MacOSX/Windows, full-featured<br />
*[[Python Bitcoinclient]] - Python RPC client<br />
*[[Spesmilo]] - Python/PySide RPC client<br />
*[[Bitcoin-python]] - Python API<br />
*[[Java Bitcoin Client]] - Java API<br />
*[[Wallet.Net]] - Windows (soon to be cross platform) Full Featured, secure RPC client<br />
*[[FastCat BRPC]] - Fast low memory footprint Windows client!<br />
Alternative, experimental implementations:<br />
*[[BitDroid]] - Java client<br />
*[[Bitdollar]] - C++/Qt client, unstable beta version<br />
*[[BitCoinJ]] - Java client by Google, early development stage<br />
*[[Freecoin]] - C++ client, supports alternative currencies like [[Beertoken]]<br />
*[[Pycoin]] - Python client<br />
*[[QBitcoin]] - C++/Qt client, unfinished<br />
*[[BCCAPI]] (Bitcoin Client API) - a java library designed for making secure light-weight bitcoin clients. <br />
<br />
===Frontends to eWallet===<br />
*[[BitPay]] - Android application<br />
<br />
==Bitcoin Trade Data==<br />
*[[Bitcoin Charts]] – Html website that has trading data for virtual all the bitcoin markets.<br />
*[[MtGox Live]] - Html website that shows a live fee of [[MtGox]] trade data in an innovative chart form. (Must Use Chrome)<br />
*[[BitcoinNotify]] - Realtime Bitcoin price alerts (via SMS, Jabber, e-mail or HTTP call) on major exchanges<br />
*[[Bitcoinity]] - Html Ajax website that shows a live feed of [[MtGox]], [[TradeHill]], and [[BitMarket]].<br />
*[[Bitcoin Sentiment Index]] - A financial index that collects and disseminates sentiment data about bitcoin.<br />
*[[Preev]] - Bitcoin converter with live exchange rates.<br />
<br />
==Bitcoin software==<br />
<br />
===Web interfaces for merchants===<br />
*[[MyBitcoin]] - Buy Now button to insert on websites<br />
*[[Bitcoin Evolution]] - Non wallet-based Buy Now button to insert into websites (handles sales tracking; client must be used for actual transaction)<br />
*[[Btceconomy]] - a JavaScript widget listing items for sale<br />
*[[Javascript Bitcoin Converter]] - currency conversion<br />
<br />
===Web apps (opensource)===<br />
*[[Bitcoin Central]] - currency exchange<br />
*[[Bitcoin Poker Room]] - poker site<br />
<br />
===Browser extensions===<br />
*[[Bitcoin Extension]] - check balance and send bitcoins (Chrome)<br />
*[[Bitcoin Ticker]] - monitoring price (Chrome)<br />
*[[Bitcoin Prices (extension)]] - monitoring price (Firefox)<br />
*[[Bitcoin Tool]] - recognizes Bitcoin addresses on websites (Firefox, Chrome, IE)<br />
<br />
===PC apps===<br />
*[[BTConvert]] - currency conversion<br />
*[[Sierra Chart MtGox Bridge]] - real-time charting<br />
*[[BTC Trader]] - live charting and tech-analysis<br />
*[[BitTicker]] - monitoring price (Mac OS X)<br />
*[[ToyTrader]] - a command line trading tool for [[MtGox]]<br />
*[[goxsh]] - a command-line frontend to the [[MtGox|Mt. Gox Bitcoin Exchange]] (Python)<br />
<br />
===Mobile apps===<br />
==== iPhone / iPad ====<br />
*[[Bitcoin Ticker (iPhone)]] - monitoring price w/push notifications<br />
*[[BitCoins Mobile]] - First iPad native app! Live market data, news feeds, mining pool statistics, full screen exchange price charts, bitcoin network statistical charts. (iPad only, iPhone/iPod Touch coming soon!)<br />
==== Android ====<br />
* Direct link to Android Market bitcoin apps. https://market.android.com/search?q=bitcoin<br />
*[[Bitcoin Wallet]] - This is the most functional android bitcoin wallet application. https://market.android.com/details?id=de.schildbach.wallet<br />
*[[Bitcoin Android]] - Does not appear to be being maitained anymore. https://market.android.com/details?id=com.bitcoinandroid<br />
*[[Bitpay]] - Is not related to the bit-pay.com online payment processor. Does not appear to be being maintained. https://market.android.com/details?id=com.bitcoin.bitpay<br />
<br />
*[[Bitcoin Alert]] - monitoring price (Android)<br />
*[[BitcoinX]] - monitoring price (Android)<br />
*[[BtcMobile]] - monitoring price and mining pool statistics (iPhone/iPad, Android)<br />
*[[Miner Status]] - monitoring miner status (Android)<br />
*[[SMS Bitcoins]] - transactions by SMS<br />
*[[Bitcoin Wallet Balance]] - view your balance in real time on your android phone<br />
<br />
<br />
<br />
===Other device apps===<br />
*[[Zen Cart Bitcoin Payment Module]] - a payment module that interacts with bitcoind for the Zen Cart eCommerce shopping chart<br />
<br />
===Operating systems===<br />
*[[LinuxCoin]] - a lightweight Debian-based OS, with the Bitcoin client and GPU mining software<br />
<br />
===Mining apps===<br />
*[[Poclbm]] - Python/OpenCL GPU miner ([[Poclbm-gui|GUI]])<br />
*[[Poclbm-mod]] - more efficient version of [[Poclbm]] ([[Poclbm-mod-gui|GUI]])<br />
*[[DiabloMiner]] - Java/OpenCL GPU miner ([[DiabloMiner.app|MAC OS X GUI]])<br />
*[[RPC Miner]] - remote RPC miner ([[RPCminer.app|MAC OS X GUI]])<br />
*[[Phoenix miner]] - miner<br />
*[[Cpu Miner]] - miner<br />
*[[Ufasoft miner]] - miner<br />
*[[Pyminer]] - Python miner, reference implementation<br />
*[[Remote miner]] - mining pool software<br />
*[[Open Source FGPA Bitcoin Miner]] - a miner that makes use of an FPGA Board<br />
<br />
===Mining Pool Servers (backend)===<br />
*[[Pushpoold]] - The original mining pool server<br />
*[[Poold]] - Python mining pool server<br />
*[[PoolServerJ]] - Java mining pool server<br />
<br />
===Utilities, libraries, and interfaces:===<br />
*[[Bitcointools]] - a set of Python tools accessing the transaction database and the wallet<br />
*[[Finance::MtGox]] - a Perl module which interfaces with the Mt. Gox API<br />
*[[BitcoinCrypto]] - a lightweight Bitcoin crypto library for Java/Android<br />
*[[Bitcoin Dissector]] - a wireshark dissector for the bitcoin protocol<br />
<br />
===Lists of software===<br />
*[[BitGit]] - list of Bitcoin-related opensource projects hosted at Git<br />
<br />
===Developer resources===<br />
*[[:Category:Developer|Category:Developer]]<br />
*[[:Category:Technical|Category:Technical]]<br />
*[[Original Bitcoin client/API calls list]]<br />
*[[API reference (JSON-RPC)]]<br />
<br />
===Other===<br />
*[[Namecoin]] - a distributed naming system based on Bitcoin technology<br />
*[[Bitcoin Consultancy]] - an organization providing open source software and Bitcoin-related consulting<br />
*[[Open Transactions]] - a financial crypto and digital cash software library, complementary to Bitcoin<br />
*[[Moneychanger]] - Java-based GUI for [[Open Transactions]]<br />
*[http://btcnames.org/ BTCnames] - a webbased aliasing service which allows to handle unlimited names for your BTC deposit hashes<br />
*[[Devcoin]] - the open source developer coin</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Fallback_Nodes&diff=14459Fallback Nodes2011-08-09T08:38:06Z<p>Osmosis: /* IPv4 Nodes */</p>
<hr />
<div>This is a list of nodes which are considered reliable. Nodes from this list which are down for more than 24 hours will be automatically removed and status of each node is displayed and updated every hour by [[User:WikiBot|WikiBot]].<br />
<br />
== How to use this list ==<br />
<br />
=== Connect to nodes ===<br />
<br />
You can connect to these nodes with the ''-addnode=ip'' switch instead of the usual node harvesting process (through IRC or via the embedded nodelist). You can connect to more than one node by using ''-addnode=ip'' more than once. It is usually a good idea to connect to more than one of these nodes.<br />
<br />
==== Nodes without a fixed ip ====<br />
<br />
If the node IP is not fixed (see "Fixed" column), you will have to resolve the node's name (first column) each time the IP changes. Some nodes may have their ip change once a day, some others once a month, and some others may stay on the same IP for years. Still, as long as the IP is not fixed, there is no guarantee it will stay the same.<br />
<br />
In order to enable hostname lookups for the ''-addnode'' and ''-connect'' parameters, you must additionally provide the ''-dns'' parameter. Example:<br />
bitcoind -dns -addnode=bitcoin.es<br />
<br />
Versions prior to 0.3.22 do not support hostnames to the ''-addnode'' parameter, so you must do the resolving part for it. For example on linux:<br />
bitcoind -addnode=$(dig +short bitcoin.es)<br />
<br />
=== IP Transactions ===<br />
<br />
You can also send [[IP Transactions]] to these nodes. If you include your bitcoin address in the "message" field, you may have your coins back.<br />
<br />
=== Tor network ===<br />
<br />
To use tor .onion addresses, you need to map virtual ips via the ''torrc'' file:<br />
<br />
mapaddress 192.0.2.2 ijzt2eeizty3p5xe.onion<br />
mapaddress 192.0.2.3 j43z65b6r2usg3vk.onion<br />
mapaddress 192.0.2.4 pvuif6nonbhj3o3r.onion<br />
<br />
Once you have configured and restarted tor, 192.0.2.2 will connect to ijzt2eeizty3p5xe.onion when accessed through the Tor proxy (and likewise for the other IPs/onions). You can then run Bitcoin with -addnode=192.0.2.2, or even send bitcoins to that IP address. You can use any arbitrary IP addresses with MapAddress, though some of the common non-routable ranges (10.*, 192.168.*) will not work due to a Bitcoin bug. 192.0.2.1-192.0.2.255 is the recommended range because it is both non-routable and compatible with Bitcoin.<br />
<br />
== Nodes list ==<br />
<br />
=== IPv4 Nodes ===<br />
<br />
{|class="wikitable sortable"<br />
! Hostname !! Owner !! IP !! Fixed !! Status !! Last Seen (GMT) !! Accepts IP transactions<br />
|-<br />
<!-- BEGIN NODELIST --><br />
| 204.9.55.71 || toasty || 204.9.55.71 || {{Table Value Yes}} || {{Fallback Nodes/Node Up|version=0.3.25}} || 2011-08-09 08:00:03 || ?<br />
|-<br />
| 50.23.217.19 || Senseless || 50.23.217.19 || {{Table Value Yes}} || {{Fallback Nodes/Node Up|version=0.3.24}} || 2011-08-09 08:00:03 || No<br />
|-<br />
| 66.158.72.2 || imsaguy || 66.158.72.2 || {{Table Value Yes}} || {{Fallback Nodes/Node Up|version=0.3.24}} || 2011-08-09 08:00:03 || ?<br />
|-<br />
| 93.186.32.118 || rfcpool.com || 93.186.32.118 || {{Table Value Yes}} || {{Fallback Nodes/Node Up|version=0.3.24}} || 2011-08-09 08:00:03 || ?<br />
|-<br />
| 173.224.125.222 || MagicalTux [US] || 173.224.125.222 || {{Table Value Yes}} || {{Fallback Nodes/Node Up|version=0.3.24}} || 2011-08-09 08:00:03 || ?<br />
|-<br />
| bitcoin.es || neutrino || 188.165.138.165 || {{Table Value Yes}} || {{Fallback Nodes/Node Up|version=0.3.24}} || 2011-08-09 08:00:03 || ?<br />
|-<br />
| 74.57.236.239 || ? || 74.57.236.239 || {{Table Value Yes}} || {{Fallback Nodes/Node Old|version=0.3.0}} || 2011-08-09 08:00:04 || ?<br />
|-<br />
| 98.143.152.14 || osmosis || 98.143.152.14 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || 2011-08-09 05:00:33 || ?<br />
<!-- END NODELIST --><br />
|}<br />
<br />
=== Tor nodes ===<br />
<br />
{|class="wikitable sortable"<br />
! Hostname !! Owner !! Status !! Last Seen (GMT) !! Accepts IP transactions<br />
|-<br />
| ijzt2eeizty3p5xe.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| j43z65b6r2usg3vk.onion || Dybbuk || ? || 2011-02-11 || Yes<br />
|-<br />
| pvuif6nonbhj3o3r.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| c5qvugpewwyyy5oz.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| vso3r6cmjoomhhgg.onion || echelon || ? || 2011-02-11 || Yes<br />
|-<br />
| bitcoinbudtoeks7.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| iy6ni3wkqazp4ytu.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| h4kklwodpcmo6cbq.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| vv6kcfscuntybrzm.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| nlnsivjku4x4lu5n.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| xqzfakpeuvrobvpj.onion || ? || ? || 2010-11-13 || No<br />
|-<br />
| 4lmduyac3svgrrav.onion || ? || ? || 2011-02-11 || No<br />
|-<br />
| usasx4urod3yj4az.onion || ? || ? || 2011-02-11 || No<br />
|}<br />
<br />
== Adding a node ==<br />
<br />
Before adding yourself as a fallback node, you should be sure your node will stay online for a long time. If a node is offline for more than 24 hours it will be removed from the list. To accept IP transactions you will have to add the ''-allowreceivebyip'' flag to your command line parameters.<br />
<br />
To add a node in this list, you just need the ip/hostname and your name, the other fields will be filled automatically. Insert the following lines before the <tt>END NODELIST</tt> line:<br />
<br />
<nowiki>|-<br />
| ip || your name</nowiki><br />
<br />
Please note that a bot will connect to your node every hour to check its status and version.</div>Osmosishttps://tests.bitcoin.it/w/index.php?title=Fallback_Nodes&diff=13288Fallback Nodes2011-07-20T18:22:10Z<p>Osmosis: /* IPv4 Nodes */</p>
<hr />
<div>This is a list of nodes which are considered reliable. Nodes from this list which are down for more than 24 hours will be automatically removed and status of each node is displayed and updated every hour by [[User:WikiBot|WikiBot]].<br />
<br />
== How to use this list ==<br />
<br />
=== Connect to nodes ===<br />
<br />
You can connect to these nodes with the ''-addnode=ip'' switch instead of the usual node harvesting process (through IRC or via the embedded nodelist). You can connect to more than one node by using ''-addnode=ip'' more than once. It is usually a good idea to connect to more than one of these nodes.<br />
<br />
==== Nodes without a fixed ip ====<br />
<br />
If the node IP is not fixed (see "Fixed" column), you will have to resolve the node's name (first column) each time the IP changes. Some nodes may have their ip change once a day, some others once a month, and some others may stay on the same IP for years. Still, as long as the IP is not fixed, there is no guarantee it will stay the same.<br />
<br />
The [[Original Bitcoin client]] do not support hostnames to the ''-addnode'' parameter, so you must do the resolving part for it. For example on linux:<br />
bitcoind -addnode=$(host ndrix.com |sed s/"^.*has address "//)<br />
<br />
=== IP Transactions ===<br />
<br />
You can also send [[IP Transactions]] to these nodes. If you include your bitcoin address in the "message" field, you may have your coins back.<br />
<br />
=== Tor network ===<br />
<br />
To use tor .onion addresses, you need to map virtual ips via the ''torrc'' file:<br />
<br />
mapaddress 192.0.2.2 ijzt2eeizty3p5xe.onion<br />
mapaddress 192.0.2.3 j43z65b6r2usg3vk.onion<br />
mapaddress 192.0.2.4 pvuif6nonbhj3o3r.onion<br />
<br />
Once you have configured and restarted tor, 192.0.2.2 will connect to ijzt2eeizty3p5xe.onion when accessed through the Tor proxy (and likewise for the other IPs/onions). You can then run Bitcoin with -addnode=192.0.2.2, or even send bitcoins to that IP address. You can use any arbitrary IP addresses with MapAddress, though some of the common non-routable ranges (10.*, 192.168.*) will not work due to a Bitcoin bug. 192.0.2.1-192.0.2.255 is the recommended range because it is both non-routable and compatible with Bitcoin.<br />
<br />
== Nodes list ==<br />
<br />
=== IPv4 Nodes ===<br />
<br />
{|class="wikitable sortable"<br />
! Hostname !! Owner !! IP !! Fixed !! Status !! Last Seen (GMT) !! Accepts IP transactions<br />
|-<br />
<!-- BEGIN NODELIST --><br />
| 46.4.13.200 || WakiMiko || 46.4.13.200 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || 2011-07-20 15:00:03 || ?<br />
|-<br />
| 178.63.62.15 || MagicalTux [DE] || 178.63.62.15 || {{Table Value Yes}} || {{Fallback Nodes/Node Down}} || 2011-07-20 01:00:06 || No<br />
|-<br />
| fallback2.bitcoin.me.uk || Vladimir [Pool] || 91.209.162.5 || {{Table Value No}} || {{Fallback Nodes/Node Down}} || 2011-07-20 12:00:02 || No<br />
|-<br />
| zack.home.chrishowie.com || cdhowie || 98.222.140.181 || {{Table Value No}} || {{Fallback Nodes/Node Down}} || 2011-07-20 11:00:08 || No<br />
|-<br />
| 98.143.152.19 || osmosis<br />
<!-- END NODELIST --><br />
|}<br />
<br />
=== Tor nodes ===<br />
<br />
{|class="wikitable sortable"<br />
! Hostname !! Owner !! Status !! Last Seen (GMT) !! Accepts IP transactions<br />
|-<br />
| ijzt2eeizty3p5xe.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| j43z65b6r2usg3vk.onion || Dybbuk || ? || 2011-02-11 || Yes<br />
|-<br />
| pvuif6nonbhj3o3r.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| c5qvugpewwyyy5oz.onion || ? || ? || 2011-02-11 || Yes<br />
|-<br />
| vso3r6cmjoomhhgg.onion || echelon || ? || 2011-02-11 || Yes<br />
|-<br />
| bitcoinbudtoeks7.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| iy6ni3wkqazp4ytu.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| h4kklwodpcmo6cbq.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| vv6kcfscuntybrzm.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| nlnsivjku4x4lu5n.onion || ? || ? || 2011-02-11 || ?<br />
|-<br />
| xqzfakpeuvrobvpj.onion || ? || ? || 2010-11-13 || No<br />
|-<br />
| 4lmduyac3svgrrav.onion || ? || ? || 2011-02-11 || No<br />
|-<br />
| usasx4urod3yj4az.onion || ? || ? || 2011-02-11 || No<br />
|}<br />
<br />
== Adding a node ==<br />
<br />
Before adding yourself as a fallback node, you should be sure your node will stay online for a long time. If a node is offline for more than 24 hours it will be removed from the list. To accept IP transactions you will have to add the ''-allowreceivebyip'' flag to your command line parameters.<br />
<br />
To add a node in this list, you just need the ip/hostname and your name, the other fields will be filled automatically. Insert the following lines before the <tt>END NODELIST</tt> line:<br />
<br />
<nowiki>|-<br />
| ip || your name</nowiki><br />
<br />
Please note that a bot will connect to your node every hour to check its status and version.</div>Osmosis