Electrum Protocol Specification
Stratum is a universal bitcoin communication protocol used mainly by bitcoin client Electrum and miners.
Format
Stratum protocol is based on JSON-RPC 2.0 (although it doesn’t include “jsonrpc” information in every message). Each message has to end with a line end character (n).
Request
Typical request looks like this:
{ "id": 0, "method":"some.stratum.method", "params": [] }
id begins at 0 and every message has its unique id number
list and description of possible methods is below
params is an array, e.g.: [ “1myfirstaddress”, “1mysecondaddress”, “1andonemoreaddress” ]
Response
Responses are similar:
{ "id": 0, "result": "616be06545e5dd7daec52338858b6674d29ee6234ff1d50120f060f79630543c"}
id is copied from the request message (this way client can pair each response to one of his requests)
result can be:
null
a string (as shown above)
a hash, e.g.:
{ "nonce": 1122273605, "timestamp": 1407651121, "version": 2, "bits": 406305378 }
an array of hashes, e.g.:
[ { "tx_hash: "b87bc42725143f37558a0b41a664786d9e991ba89d43a53844ed7b3752545d4f", "height": 314847 }, { "tx_hash": "616be06545e5dd7daec52338858b6674d29ee6234ff1d50120f060f79630543c", "height": 314853 } ]
Methods
Last updated