Skip to content

Instantly share code, notes, and snippets.

View assafshomer's full-sized avatar

Assaf Shomer assafshomer

View GitHub Profile
@assafshomer
assafshomer / colored-coins-encoding.rb
Last active August 29, 2015 14:22
Colored Coins Precision Encoding Scheme
require 'terminal-table'
MAX_SATOSHIS = 21*(10**6)*(10**8)
def max_num(mantis_bits,available_bits)
mantis(mantis_bits)*(10**exponent(mantis_bits,available_bits))
end
def mantis(mantis_bits)
2**mantis_bits
@assafshomer
assafshomer / gist:5f47ddbff9b0dd5bc31a
Created May 14, 2015 10:58
Toshi Block Subscription on the Bitcoin Network
def url(network)
case network.to_sym
when :testnet
return 'wss://testnet3.toshi.io'
when :bitcoin
return 'wss://bitcoin.toshi.io'
else
return "'ws://localhost:5000'"
end
end
@assafshomer
assafshomer / gist:225862b0531beeb1a628
Created May 14, 2015 10:57
Toshi Transaction Subscription on Testnet3
def url(network)
case network.to_sym
when :testnet
return 'wss://testnet3.toshi.io'
when :bitcoin
return 'wss://bitcoin.toshi.io'
else
return "'ws://localhost:5000'"
end
end
@assafshomer
assafshomer / gist:92925b2789f6cebf93b7
Last active August 29, 2015 14:21
Toshi Block Subscription to Testnet3
def url(network)
case network.to_sym
when :testnet
return 'wss://testnet3.toshi.io'
when :bitcoin
return 'wss://bitcoin.toshi.io'
else
return "'ws://localhost:5000'"
end
end
Verifying that +coincooler is my openname (Bitcoin username). https://onename.com/coincooler