Skip to content

Instantly share code, notes, and snippets.

View gmajoulet's full-sized avatar

Gabriel Majoulet gmajoulet

View GitHub Profile
@mhanne
mhanne / gist:9338371
Created March 4, 2014 01:17
Blind liability proof based on bitcoin merkle trees
# Blind liability proof based on bitcoin merkle trees
module BLProof
def self.sha256 data
Digest::SHA256.base64digest(data)
end
def self.hash_nodes a, b
value = a[:value] + b[:value]
hash = sha256( value.to_s + a[:hash] + b[:hash] )