Looking at Bitcoin addresses and the way they are constructed, we can easily write a bash script that generates a valid address from any SHA-256 hash.
initialsha=600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408
ripemd160=`echo -n $initialsha | xxd -r -p | openssl rmd160 -binary | xxd -p`
extripemd160=`echo 00$ripemd160`
finalsha=`echo $extripemd160 | xxd -r -p | openssl sha256 -binary | openssl sha256 -binary | xxd -p`
chks=${finalsha:0:8}
btc25=$extripemd160$chks
We now need to encode that in Base58 and add a '1' in front of it:
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
EncodeBase58() {
# 58 =0x3A
bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
tac |
while read n
do echo -n ${base58[n]}
done
}
address=$(EncodeBase58 $btc25)
btcaddress=1$address
echo $btcaddress
16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM
It is then sufficient to send any little amount of BTC to this address to permanently store a one-way derivative of the initial hash into the live block chain. We then get a worldwide checkable timestamp of the initial hash.
How to get a copyright then ? A copyright must guarantee the anteriority of a document (the timestamp), as well as the author. As an example, let us consider a GPL software or a CC-BY music. Before publishing your work, just generate a gnupg certificate with your name, construct a message containing the document hash and the type of licence you choose, sign it, and hash the result (you can publish it as your Copyright).
cat | gpg --sign -armor | sha256sum > initialsha.txt
user: "FirstName Surname <Firstname.Surname@mydomain.com>"
1024-bit DSA key, ID 2AEC2964, created 2007-02-13
This is my work SHA256 hash:
600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408
This is the licence I choose:
CC BY-NC-SA
^D
initialsha=`cat initialsha.txt`
echo $initialsha
24fceef3613eeabb8e1d812b2c3734905229f0868de388c26c39dda541a1bb40
Running the above scripts with that hash we get the BTC address 1N7U25T5qCYZvBFviDTkXbvQBXhGHMksoW. Just send 0.0001 BTC to that address and you are done. The guarantee relies on the fact that the whole BTC network time is valid (therefore the timestamp too), and that the transaction is permanently and publicly stored in a unbreakable chain (as long as the BTC story holds...).
Comments !