View gist:9397005
### Keybase proof
I hereby claim:
* I am charleyhine on github.
* I am charley ( on keybase.
* I have a public key whose fingerprint is BB73 60F9 53BB D92E 48F9 AFEA 03E8 8F10 5CCC FCB4
To claim this, I am signing this object:
View gist:0dd1a7504c00b121de74
require 'uri'
require 'net/http'
# Request: My API (
uri = URI.parse("")
http =, uri.port)
http.read_timeout = 30
request =
View gist:2dd04b5e533908b90239
require 'chain'
response = Chain.get_transaction_op_return('8bae12b5f4c088d940733dcd1455efc6a3a69cf9340e17a981286d3778615684')
p response['text']
=> "charley loves heidi"
View gist:4e7b227d8fe2977f507a
"hash": "1Bj5UVzWQ84iBCUiy5eQ1NEfWfJ4a3yKG1",
"balance": 31330001,
"received": 1032680001,
"sent": 1001350000,
"unconfirmed_received": 13600000,
"unconfirmed_sent": 13630000,
"unconfirmed_balance": -30000
View gist:abf228e3b9e680cbcb46
class HomeController < ApplicationController
skip_before_filter :verify_authenticity_token, only: [:callback]
def register_callback
register_url = ''
callback_url = ''
callback_alias = 'charley'
response =,
body: { url: callback_url,
View gist:2197b76ed8f276f2dadc
class HomeController < ApplicationController
def callback
respond_to do |format|
format.all { render text: }
View gist:b56b7c7d9b5c73bd85b0
Verifying that +charley is my Bitcoin username. You can send me #bitcoin here:
View gist:04f8374966fa1985df4e

Create Payment Address (revised)

Create with new URL (POST)

    "block_chain": "bitcoin",
    "destination_address": "1dk2l...",
    "webhook_url": "",
View gist:c8b4c25343766d2c4cc5
<!DOCTYPE html>
<title>Bitcoin API - Chain</title>
<link rel='shortcut icon' type='image/x-icon' href='/chain32x32.ico' />
<link rel='shortcut icon' type='image/x-icon' href='/chain16x16.ico' />
<meta name="description" content="Chain is a powerful block chain API that makes it easy to build Bitcoin applications.">
<!--facebook meta tags-->
View gist:5457d2d3a36b17f7f820
def result
tx = JSON.parse(request.raw_post)
type = tx['payload']['type']
confs = tx['payload']['confirmations']
amount_s = tx['payload']['received']
tx_id = tx['payload']['transaction_hash']
addr = tx['payload']['address']
render nothing: true, status: 200