Walltime API

Table of Contents

1 Market info (public API)

1.1 General info

To retrieve Walltime's market info (last price, 24h volume, etc) use the following URL (you can change the 'now' GET parameter to a random value to avoid caching):

https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/walltime-info.json?now=1528962473468.679.0000000000873

You should expect a response like this:

{
  "version":"1",
  "last_update":"2018-06-14T08:09:00Z",
  "last_update_timestamp":"1528963740875",
  "BRL_XBT":{
    "last_inexact":"1101.6841677241139",
    "last":"525161485492/476689691",
    "highest_bid_inexact":"995.5729567925198",
    "highest_bid":"306779077558/308143241",
    "n_trades_24h":"125",
    "lowest_ask_inexact":"1101.6841677241139",
    "lowest_ask":"525161485492/476689691",
    "base_volume24h_inexact":"5289.955729567925",
    "base_volume24h":"26449778647839625987/5000000000000000",
    "quote_volume24h_inexact":"4.916662254035813",
    "quote_volume24h":"49166622540358131/10000000000000000",
    "base_volume_today_inexact":"5289.955729567925",
    "base_volume_today":"26449778647839625987/5000000000000000",
    "quote_volume_today_inexact":"4.916662254035813",
    "quote_volume_today":"49166622540358131/10000000000000000",
    "base_volume_yesterday_inexact":"0",
    "base_volume_yesterday":"0",
    "quote_volume_yesterday_inexact":"0",
    "quote_volume_yesterday":"0"
  }
}

Like every other method this request will return both exact and inexact values (keys suffixed by '_inexact').

This endpoint will be updated after every round closing but you should expect some delay since it's asynchronous.

1.2 Last Trades Retrieval

First, access the following URL (you can change the 'now' GET parameter to a random value to avoid caching):

https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/meta.json?now=1517922306634.319625.92

The result will be very similar to this:

{
    "current_round": 2033713,
    "code_version": "cycloid-3.1.0",
    "order_book_pages": 33,
    "suspended_actions": [],
    "order_book_prefix": "order-book/v8878cb",
    "last_trades_prefix": "last-trades/v8878cb",
    "best_offer": {
        "brl-xbt": "25000",
	"xbt-brl": "1/25500"
    }
}

Take 'last_trades_prefix' key returned by the previous request to mount the following URL:

https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/%7Blast_trades_prefix%7D_%7Bsource_target%7D_%7Byear%7D_%7Bmonth%7D_%7Bday%7D_%7Bhour%7D_p0.json

The keywords between keys should be replaced as below:

  • last_trades_prefix: the homonymous key gotten from meta.json;
  • source_target: a trading pair (BTC-XBT or XBT-BRL, for now);
  • year: the year you want to retrieve;
  • month: the month of selected year;
  • day: the day of selected month;
  • hour: the hour of the selected day in the 24-hour format, remember to zero-pad one digit numbers (e.g. 23, 11, 01, 05);

Keep in mind that every date field (year, month, day and hour) is based on UTC/GMT timezone.

So if you want to retrieve the last trades of BRL-XBT pair on 30th June 2018 at 4AM (UTC) the URL will be:

https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/last-trades/v8878cb_BRL-XBT_2018_06_30_04_p0.json

If you're based in a different timezone than UTC remember to convert it.

The result of this page will look like this:

{
  "version":"1",
  "last_trades":[
    {
      "trade_id":"84f53d20-6f88-11e8-94d5-528a14868232",
      "date":"2018-06-14T04:07:57Z",
      "timestamp":1528949277786,
      "type":"buy",
      "rate_inexact":"1068.5002643511436",
      "amount_inexact":"0.0467945602525077",
      "total_inexact":"50.0",
      "rate":"1095186811746/1024975705",
      "amount":"25624392625/547593405873",
      "total":"50",
      "round":"12915"
    },
    {
      "trade_id":"111f8080-6f89-11e8-94d5-528a14868232",
      "date":"2018-06-14T04:11:52Z",
      "timestamp":1528949512818,
      "type":"buy",
      "rate_inexact":"1068.5002643511439",
      "amount_inexact":"0.09358912050501539",
      "total_inexact":"100.0",
      "rate":"1095186811746/1024975705",
      "amount":"51248785250/547593405873",
      "total":"100",
      "round":"12920"
    }
  ]
}

The last_trades key translates into an array containing objects of last trades of chosen date. Something we wish to point out:

  1. We're both showing exact values (as seen in rate, total and amount keys) and inexact values (as seen in rate_inexact, total_inexact and amount_inexact), if you need accuracy we would suggest you to use the exact ones;
  2. The 'round' key inside last trade JSON object provides you the round number in which this order was executed, both partially or fully;
  3. Walltime will generate last trades file every hour as of 15th June 2018.

1.3 Order Book Retrieval

First, access the meta.json URL passing the current instant (the value must be changed on each request to avoid caching layers):

https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/meta.json?now=1517922306634.319625.92

Which returns a JSON similar to this:

{
  "current_round":1490454,
  "code_version":"bean-curve-2.7.2",
  "order_book_pages":31,
  "suspended_actions":[],
  "order_book_prefix":"order-book/v8878cb",
  "best_offer":{
    "xbt-brl":"1/22000",
    "brl-xbt":"210201/10"
  }
}

In this example you can see that the best offer to purchase Bitcoins is BRL 22000 while the best offer to sell is BRL 21020.10.

You can also see that ther order book is 31 pages long and that the current round number (prices change once per round) is 1490454.

This is useful to retrieve the order book in detail. Using the information above you can construct the URL to fetch the first page of the book - pay attention to the prefix returned above as well as the round number in the URL:

https://s3.amazonaws.com/data-production-walltime-info/production/dynamic/order-book/v8878cb_r1490445_p0.json?now=1517922306795.319787.02

Calling this URL you will see:

{
  "timestamp": 1517922305747,
  "xbt-brl": [
    [
      "189346284384447/5000000000000000",
      "1704116559460023/2000000000000"
    ],
    [
      "28053/12500000",
      "645190947/12500000"
    ],
    [
      "19231097/100000000",
      "442315231/100000"
    ],
    [
      "100389/20000000",
      "230894800389/2000000000"
    ],
    [
      "4329/1000000",
      "999999/10000"
    ],
    [
      "170917/12500000",
      "4956593/15625"
    ],
    [
      "217/1000",
      "5097113/1000"
    ],
    [
      "51174663/100000000",
      "2405209161/200000"
    ],
    [
      "527373/20000000",
      "123984864927/200000000"
    ],
    [
      "2379703/12500000",
      "5613726516109/1250000000"
    ],
    [
      "25003/500000",
      "60007174997/50000000"
    ],
    [
      "11083481/50000000",
      "33250443/6250"
    ]
  ],
  "brl-xbt": [
    [
      "102947749/50000",
      "102947749/1100000000"
    ],
    [
      "350",
      "70/4141"
    ],
    [
      "13351/50",
      "13351/1035150"
    ],
    [
      "95079/100",
      "95079/2070200"
    ],
    [
      "9749/100",
      "9749/2059900"
    ],
    [
      "50015",
      "10003/4000"
    ],
    [
      "421717/50",
      "421717/990000"
    ],
    [
      "7667/25",
      "7667/487500"
    ],
    [
      "10462769336964223649/1000000000000000",
      "70219928436001501/130000000000000000"
    ],
    [
      "10",
      "10/19291"
    ],
    [
      "100",
      "10000/1909999"
    ],
    [
      "50",
      "10/3811"
    ]
  ]
}

Simply replacing p0 by p1 in the URL above (and so on and so forth) you will be able to fetch every order currently in the book.

2 Transactional API (account API)

2.1 Beta (v1) API - usage

2.1.1 Intro

Walltime provides an API that allows full interaction with a user account - including creating/canceling orders, generating new deposit addresses, handling withdrawals, and more.

2.1.2 Using it

Get in touch with our support using any of the available channels (see https://walltime.info/index_pt.html#!text?content=ajuda) and request the API to be enabled for your account.

You will be asked to provide a bitcoin address which will be used to sign every request made to the API.
IMPORTANT: This bitcoin address currently must be a non-segwit (also known as legacy) address. This restriction will be lifted in a future version.

Losing control of the corresponding private key (which only you should have access to) is the same as losing control of your account - so please be very careful with it.

You will also be provided an UUID which will be used for every request made to our services.

2.2 Beta (v1) API - transaction API catalog

2.2.1 General Guidance & Step-by-Step instructions

Below you will find details for each available command.

The API is idempotent and fully asynchronous - you will first insert your command in a queue using a unique nonce you must generate and afterwards retrieve the results using an URL built with a fixed prefix concatenated with the nonce you provided.

Step-by-Step:

  1. You should first create your request - the contents of the "data" section of each command example below.
    • Expiration (for brevity omitted in all examples below) - not mandatory but strongly recommended step (specially for production setups): define an UTC expiration date (after which your command will no longer will be executed, but dropped instead) and add it to your "data" object under an "expiration" key formatted as an ISO8601 timestamp string:

      {"expiration": "2018-06-22T15:56:00Z","nonce": "837cf807-095d-4875-ad0f-b5471a25a46c", "version": "v1",.....}
      

      Defining an expiration is useful among other things because:

      • It averts replay attacks that could possibly take place (even far in the future) if non-expiring requests are leaked;
      • Since the API is asynchronous in nature, in case of significant queueing or outage in the API service you might prefer that your queued requests get dropped instead of executing in an arbitrary instant in the future.
  2. You should then sign the data. This can be done using with bitcoin core itself (see https://bitcoin.org/en/developer-reference#signmessage and https://bitcoin.org/en/developer-reference#signmessagewithprivkey ) or with a number of third-party APIs (such as https://bitcoinj.github.io/javadoc/0.14.7/org/bitcoinj/core/ECKey.html#signMessage-java.lang.String- ). Some tips on how to sign a message using bitcoin core are available.
  3. You will build the final json request which includes the bitcoin address used for the signature, the signature itself and the data.
  4. You should fetch https://walltime.info/data/dynamic/api.json where you will find values for api-queue-url and api-response-url-prefix. Example:

    curl https://walltime.info/data/dynamic/api.json                                                                                                                                                                                          [20:30:02]
    {
      "api-queue-url":"https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01",
      "api-response-url-prefix":"https://s3.amazonaws.com/response-production-walltime-info/production/index/"
    }
    
  5. You will submit the JSON to the processing queue under the api-queue-url URL. Feel free to re-submit the message if you have any kind of connection error. We guarantee requests will be processed at most once (the nonce is used to ensure that).
  6. You should then then retrieve the results in a URL which is constructed by our api-response-url-prefix + the nonce you provided yourself.

2.2.2 add-withdraw-address

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"IBU6J3aywqaRC2GZ2RnyCfbM+q0ZF1PjMLydrruFdNWAFwVWC+IHlXMtfElQmO84WvkBggUPYkvXyRH30aFjHm0=","data":"{\"nonce\": \"837cf807-095d-4875-ad0f-b5471a25a46c\", \"version\": \"v1\", \"command\": \"add-withdraw-address\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"account_info\\\": \\\"{\\\\\\\"account\\\\\\\": \\\\\\\"0000\\\\\\\", \\\\\\\"account_digit\\\\\\\": \\\\\\\"0\\\\\\\", \\\\\\\"account_type\\\\\\\": \\\\\\\"cc\\\\\\\", \\\\\\\"agency\\\\\\\": \\\\\\\"1111\\\\\\\", \\\\\\\"agency_digit\\\\\\\": \\\\\\\"1\\\\\\\", \\\\\\\"bank\\\\\\\": \\\\\\\"077\\\\\\\", \\\\\\\"bank_other\\\\\\\": \\\\\\\"\\\\\\\", \\\\\\\"currency\\\\\\\": \\\\\\\"brl\\\\\\\", \\\\\\\"extra_info\\\\\\\": \\\\\\\"\\\\\\\", \\\\\\\"label\\\\\\\": \\\\\\\"077 - Banco Inter ag. 1111-1 c/c 0000-0\\\\\\\", \\\\\\\"type\\\\\\\": \\\\\\\"new\\\\\\\"}\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>3505cffd-e801-47f6-883b-a2a9eb0963cd</MessageId><MD5OfMessageBody>65511757f1d505b84a39326e53714ae4</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>e561afaf-e6c4-586f-b69e-fcc8af3b5de2</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/837cf807-095d-4875-ad0f-b5471a25a46c

{
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"New exit address added, GC6CAG3."
  },
  "transaction":{
    "identifier":"eb152c3b-25ab-4023-adc4-0aba67e477fb"
  },
  "api_usage_fees":{
    
  }
}
➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"H9epVr1X83TtJrTzIL7A5yT58rP1JWNQnwnpv+okFb8AfJgdhi21LOefJDf8LCTKRTrtPqW6j0K/u46RIfaGhkI=","data":"{\"nonce\": \"802acc8f-0f82-4115-b528-d7db21d4201c\", \"version\": \"v1\", \"command\": \"add-withdraw-address\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"account_info\\\": \\\"{\\\\\\\"address\\\\\\\": \\\\\\\"1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj\\\\\\\", \\\\\\\"currency\\\\\\\": \\\\\\\"xbt\\\\\\\", \\\\\\\"label\\\\\\\": \\\\\\\"1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj\\\\\\\", \\\\\\\"type\\\\\\\": \\\\\\\"new\\\\\\\"}\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>ab64b542-bf9f-4660-ac8e-ecc39e473e36</MessageId><MD5OfMessageBody>8acabbf51751a72848b08bc524b0c374</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>ecffdede-6d06-54e9-9246-8db92682699f</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/802acc8f-0f82-4115-b528-d7db21d4201c

{
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"New exit address added, GC6CAG3."
  },
  "transaction":{
    "identifier":"4d49d521-97f9-40fa-973e-c4c58459a3a7"
  },
  "api_usage_fees":{
    
  }
}

2.2.3 cancel-order

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"H5t79L4xtrmrQQLIwZ7y901EXyQqqLbpBf+U3kfpIOxUIFeOhiRZeN9ryq/YjX24SumHQM1Muft5idjNUqaK2lU=","data":"{\"nonce\": \"27bdf6f1-ee56-421c-bab8-f4474f880dac\", \"version\": \"v1\", \"command\": \"cancel-order\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"id\\\": \\\"5aed433a-badf-47b6-84aa-80c2d9c5efe7\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>13477f5d-b4d4-4202-9d56-3d8c48f6cf5d</MessageId><MD5OfMessageBody>d23b9dbc8ae67ce6bf254aca2b7a6c4a</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>7eed5c73-ae76-564b-bc2d-0f14e85749a9</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/27bdf6f1-ee56-421c-bab8-f4474f880dac

{
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"The cancellation of the order has been requested, but no guarantee it will be canceled."
  },
  "transaction":{
    "identifier":"2b6eb696-37d1-4365-92e3-340e76122250"
  },
  "api_usage_fees":{
    
  }
}

2.2.4 create-order

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"IFTyTf7vY9IX0z9dZMsnVmL+SgHf1PB5IO75+VBalbGKOYVib3xe7Q6YQ3NlVfwLzh8rmqnLUxr5yjf2oClBEGc=","data":"{\"nonce\": \"ff8cb1b6-d92b-47e6-8f3e-e89f7658c60a\", \"version\": \"v1\", \"command\": \"create-order\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"source_amount\\\": \\\"10\\\", \\\"source_symbol\\\": \\\"brl\\\", \\\"target_amount\\\": \\\"1\\\", \\\"target_symbol\\\": \\\"xbt\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>a954b729-d345-4b0d-87fe-1727295d6d50</MessageId><MD5OfMessageBody>c8647a6c423c5e0fd57488a408aafb33</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>a031cbd0-c1e0-5d29-b378-98b7849af446</RequestId></ResponseMetadata></SendMessageResponse>%                                       

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/ff8cb1b6-d92b-47e6-8f3e-e89f7658c60a

{
  "order_id":"5aed433a-badf-47b6-84aa-80c2d9c5efe7",
  "status":{
    "success":true,
    "processed":true,
    "code":"ORDER_CREATED",
    "description":"The order has been created."
  },
  "transaction":{
    "identifier":"3e87bf2c-1f23-42f8-9228-4c092b4f89ed"
  },
  "api_usage_fees":{
    
  }
}

2.2.5 generate-new-deposit-address

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"H1jCO0rRWBcQHVRgO+oUfmetWj9Fwb9ZK/KUB/sasIakTcGuH8tyyZ3Qa0GWeItULf5y57/pIdZF5pY0N0RqAyE=","data":"{\"nonce\": \"af5571cc-bca0-4384-a8a4-9ad118272bef\", \"version\": \"v1\", \"command\": \"generate-new-deposit-address\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"currency\\\":\\\"xbt\\\",\\\"declared_amount\\\":\\\"5/1000\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>d4183805-adb7-466e-9281-c773b9eac62f</MessageId><MD5OfMessageBody>12b45ffd213fe06ee2b15da00b7e3a7d</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>94a3600d-5723-5628-b1c2-336a7966b433</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/af5571cc-bca0-4384-a8a4-9ad118272bef

{
  "address":"3JwJxdS4weGmnPQFrqTaDQwFzz3oFXxyAU",
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"The address has been generated."
  },
  "transaction":{
    "identifier":"23924ca5-2ddf-4512-ba9e-ace5748269b0"
  },
  "api_usage_fees":{
  }
}

2.2.6 get-account-info

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature": "H1lhTwovtH1p/d/08eiNw9OF6xNBlY8Aqyd1YEfegm7VTl3p6iOokqzOO7LtbIXfRYgvt9pDq4LEdrHCLWXPY3E=","data":"{\"nonce\": \"9512b45b-88a1-46f6-b957-76ac5d2705d5\", \"version\": \"v1\", \"command\": \"get-account-info\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>7d420788-6280-458d-b13d-d7533514b157</MessageId><MD5OfMessageBody>a40413f8d46d553d3952afc0870cd5e5</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>0c871df4-c583-57ae-aa88-4e93eb3f755e</RequestId></ResponseMetadata></SendMessageResponse>

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/9512b45b-88a1-46f6-b957-76ac5d2705d5

{
  "account":{
    "flags":[
      "physical-address-digitized",
      "bcc-migrated",
      "verified",
      "bcc-sent"
    ],
    "video_code":"6563",
    "updated_at":"1525459260980",
    "balance":{
      "brl":"0/1"
    },
    "unconfirmed_balance":{
      "brl":"0/1"
    },
    "reserved_balance":{
    },
    "withdraw_addresses":{
      "brl":[
        {
          "address":"9002ade83c317a1466c90d7a18185239b6c99fb79afdbc1e120837c5b4073f9f",
          "label":"001 - Banco do Brasil S.A. ag. 0030-2 c/c 85423-9",
          "blocked":false,
          "last_used":"1495550782233"
        }
      ],
      "xbt":[
        {
          "address":"1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX",
          "label":"1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX",
          "blocked":false,
          "last_used":"0"
        }
      ]
    },
    "withdraw_made_today":{
      "brl":"0",
      "xbt":"0"
    },
    "withdraw_limits":{
      "9002ade83c317a1466c90d7a18185239b6c99fb79afdbc1e120837c5b4073f9f":"30000",
      "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX":"10"
    },
    "extra_info":{
      "bcc_status":"sent"
    }
  },
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"Account info revealed."
  },
  "transaction":{
    "identifier":"b6294253-a21f-4b15-8150-ecf4cb9404c9"
  },
  "api_usage_fees":{
  }
}

2.2.7 get-account-statement

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature": "II8+T0nQA8Mruw+X0biGcAIbGX9Xn8twItXeDp/SbjrrTA5SOGPotydMFOFnmX7kin7+Kqmjq9c/8xm3nMOLmj0=","data":"{\"nonce\": \"2c159c3c-9a83-436c-a94f-368b9de047fc\", \"version\": \"v1\", \"command\": \"get-account-statement\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"days_ago\\\": 60, \\\"n_days\\\": 60, \\\"minutes_offset\\\": -180}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>c8204ad8-67bb-4652-8833-209c4420312a</MessageId><MD5OfMessageBody>3d3244ef02af9a17efbc19eec04c21f1</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>f7b11ca7-7e0c-583b-b781-4fc042645598</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/2c159c3c-9a83-436c-a94f-368b9de047fc

{
  "statement":{
    "interval":[
      1520312362305,
      1525496362305
    ],
    "entries":[
      {
        "date":"1520312362305",
        "amount":"0",
        "currency":"brl",
        "type":"previous-balance",
        "params":[]
      },
      {
        "date":"1525496362305",
        "amount":"0",
        "currency":"brl",
        "type":"final-balance",
        "params":[]
      }
    ]
  },
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"Nice."
  },
  "transaction":{
    "identifier":"69726ec2-0d49-4dc5-8225-ee6869b4c053"
  },
  "api_usage_fees":{
    
  }
}

2.2.8 get-orders

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature": "IDg2vJGz1urtb6gAl1iiK1vudvm3wehQKNspgYqPRN82QhbY1VJMityiW4UyWmLVFqBcH29/cEmQONpqbZhFt3s=","data":"{\"nonce\": \"c3d11930-fe93-4b3f-8c69-2518cb18fe19\", \"version\": \"v1\", \"command\": \"get-orders\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>6d52b160-6044-4b42-bde6-892c51becf6d</MessageId><MD5OfMessageBody>b688dbbf3eb4459a60117dca54e8f603</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>2220d561-1a29-5e4b-88fa-86062fa7bbb2</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/c3d11930-fe93-4b3f-8c69-2518cb18fe19

{
  "orders":{
    "pending":{
      
    },
    "active":{
      
    },
    "inactive":{
      
    }
  },
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"You found the rabbit."
  },
  "transaction":{
    "identifier":"f93174bf-0f31-4d0c-9562-430cc20a9b85"
  },
  "api_usage_fees":{
    
  }
}

2.2.9 inform-deposit

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"H9PTjFMiTPi/ADd2SDaHgoOYOPxIWK0cVTxcKk/QvTHFWPCcT4Y8dhcPtBEpZFX/XUTvg6IuyBHQJvYQHnUBRaQ=","data":"{\"nonce\": \"a3eb06c3-6eaf-483e-878d-01396b2ea19d\", \"version\": \"v1\", \"command\": \"inform-deposit-production\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"deposit_info\\\": \\\"{\\\\\\\"address\\\\\\\": \\\\\\\"b43095ed-1e38-4558-9f55-9a901bd34e37\\\\\\\", \\\\\\\"currency\\\\\\\": \\\\\\\"brl\\\\\\\", \\\\\\\"receipt\\\\\\\": \\\\\\\"TESTE DE COMPROVANTE - EXEMPLOS API\\\\\\\", \\\\\\\"sourceBankId\\\\\\\": \\\\\\\"033\\\\\\\", \\\\\\\"destinationBankId\\\\\\\": \\\\\\\"033\\\\\\\"}\\\", \\\"declared_value\\\": \\\"50\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"
<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>0ea49bdd-8074-4ab5-8559-6ab58fb5194a</MessageId><MD5OfMessageBody>6b8015fca5f3c1f9bb0f6e50a044659d</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>d2fd9418-22c4-5019-9f74-c77f1a615fe9</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/a3eb06c3-6eaf-483e-878d-01396b2ea19d

{
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"The deposit was informed."
  },
  "transaction":{
    "identifier":"10b1d8f4-e034-4f4e-81fc-d13ac0b9b531"
  },
  "api_usage_fees":{
    
  }
}

2.2.10 request-withdraw

➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj","bitcoin-signature":"H+dBalweH1G80WNV3C78DoLF5O5z6uvV3/Ovkzj7xbRjZ9rc3xCVJwWRTlsJGI+KSex4+MsMVLME/1OJUkdu0C8=","data":"{\"nonce\": \"0504f07c-3a1c-4091-bc1f-0167ac6034d2\", \"version\": \"v1\", \"command\": \"request-withdraw\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"account_info\\\": \\\"{\\\\\\\"currency\\\\\\\": \\\\\\\"brl\\\\\\\", \\\\\\\"id\\\\\\\": \\\\\\\"9002ade83c317a1466c90d7a18185239b6c99fb79afdbc1e120837c5b4073f9f\\\\\\\", \\\\\\\"label\\\\\\\": \\\\\\\"001 - Banco do Brasil S.A. ag. 0030-2 c/c 85423-9\\\\\\\", \\\\\\\"last_used\\\\\\\": \\\\\\\"\\\\\\\", \\\\\\\"type\\\\\\\": \\\\\\\"old\\\\\\\"}\\\", \\\"amount\\\": \\\"10\\\", \\\"force_fee\\\": \\\"0\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>57035717-73b5-4e87-b4c7-f06eb8b3d39d</MessageId><MD5OfMessageBody>c4deae42ae886320d16356e68b923014</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>91f0d677-15fb-53b3-a3cf-851058542ec8</RequestId></ResponseMetadata></SendMessageResponse>

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/0504f07c-3a1c-4091-bc1f-0167ac6034d2

{
  "withdraw_uuid":"5aed4b6f-2799-4da3-bd28-1ebcc6481fb2",
  "global_hash":"20f7728c37fd11c1068659dd27c9c10d855878b03d726c13366d1602a434a5d9",
  "label":"001 - Banco do Brasil S.A. ag. 0030-2 c/c 85423-9",
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"The withdraw was requested successfully."
  },
  "transaction":{
    "identifier":"5f79cf29-9f60-471e-9fae-f50134b983e3"
  },
  "api_usage_fees":{
    
  }
}
➜ curl --data-urlencode 'MessageBody={"bitcoin-address": "1Lj6CEXAMPLEINVALIDADDRESSXGgerDyj" ,"bitcoin-signature":"H1sYN/x74EbzyijsKYDD1YjdsjxrAwOV2VxDkWG7SkLxTvwm7Xh5fKPxwdzbAgLR65xveJfZgJgKMRwnGWXpGqU=","data":"{\"nonce\": \"54fef977-86a6-419c-87a0-c9b85c1f3dbc\", \"version\": \"v1\", \"command\": \"request-withdraw\", \"user\": \"3905d6d0-720b-ae00-2404-123048082400\", \"body\": \"{\\\"account_info\\\": \\\"{\\\\\\\"account\\\\\\\": \\\\\\\"2222\\\\\\\", \\\\\\\"account_digit\\\\\\\": \\\\\\\"2\\\\\\\", \\\\\\\"account_type\\\\\\\": \\\\\\\"cc\\\\\\\", \\\\\\\"agency\\\\\\\": \\\\\\\"3333\\\\\\\", \\\\\\\"agency_digit\\\\\\\": \\\\\\\"3\\\\\\\", \\\\\\\"bank\\\\\\\": \\\\\\\"033\\\\\\\", \\\\\\\"bank_other\\\\\\\": \\\\\\\"\\\\\\\", \\\\\\\"currency\\\\\\\": \\\\\\\"brl\\\\\\\", \\\\\\\"extra_info\\\\\\\": \\\\\\\"Conta de teste API\\\\\\\", \\\\\\\"label\\\\\\\": \\\\\\\"033 - Santander ag. 2222-2 c/c 3333-3\\\\\\\", \\\\\\\"type\\\\\\\": \\\\\\\"new\\\\\\\"}\\\", \\\"amount\\\": \\\"10\\\", \\\"force_fee\\\": \\\"0\\\"}\"}"}' "https://sqs.us-east-1.amazonaws.com/211690707610/walltime-production-api?Action=SendMessage&Version=2011-10-01"

<?xml version="1.0"?><SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2011-10-01/"><SendMessageResult><MessageId>1c048f6c-f365-417e-8f88-fb107679b686</MessageId><MD5OfMessageBody>6c7a55b9d145a0507d3de6da9f45f8d9</MD5OfMessageBody></SendMessageResult><ResponseMetadata><RequestId>fba691a4-aa4d-5dc2-aa4f-c2c3e4b62e64</RequestId></ResponseMetadata></SendMessageResponse>%

➜ curl https://s3.amazonaws.com/response-production-walltime-info/production/index/54fef977-86a6-419c-87a0-c9b85c1f3dbc

{
  "withdraw_uuid":"5aed4cbb-5e8c-4b15-afda-ca532537d1d9",
  "global_hash":"c8d936c1f56e3d9c93acad9f363d934fff9198c8b18e0ec946ed9c51bd864e70",
  "label":"033 - Santander ag. 2222-2 c/c 3333-3",
  "status":{
    "success":true,
    "processed":true,
    "code":"SUCCESS",
    "description":"The withdraw was requested successfully."
  },
  "transaction":{
    "identifier":"5dfb9257-83c6-44dc-835c-0391cab6234f"
  },
  "api_usage_fees":{
    
  }
}

2.3 Signing a message with Bitcoin core

2.4 Step 1. Generate an address.

The proper way of doing it is through the command

bitcoin-cli getnewaddress "" "legacy"

on a secure machine.

Just to understand how signing works you can use https://www.bitaddress.org/ to generate a sample wallet. One test key pair generated there:

1K9YaFcGJuhf5HhMApotQPPRuW3dcEkYLm with the private key KyyoXk36J8DkcGvF8tRUCZZ1GpbtLwWCvhmhYRzKNxD6z4hKcwMv

2.5 Step 2. Perform the signature itself.

The proper way of signing is with a command similar to:

bitcoin-cli signmessage '1K9YaFcGJuhf5HhMApotQPPRuW3dcEkYLm' 'sampleMessage'

The reason this is the right way of doing it is that the private key will be safely stored within your bitcoin core instance itself, and will be as safe as the other private keys for addresses within it.

Again for testing purposes we can sign directly with the private key generated above:

bitcoind bitcoin-cli signmessagewithprivkey 'KyyoXk36J8DkcGvF8tRUCZZ1GpbtLwWCvhmhYRzKNxD6z4hKcwMv' 'sampleMessage'

which returns

IDcGHZzDNapnOtCtuM5H1UvEj7l4zHKme574u4eIHxyiCwu+g07wfAhaElyojCh3z1+xYviBgOOYDmNRtjaZmAo=

2.6 Step 3. Verify the signature

You can check the results using bitcoin core or using websites such as https://tools.bitcoin.com/verify-message/ :

sample_message_verification.png

Author: Walltime

Created: 2018-06-30 Sat 01:57