Bitcoin/Use notary

From PeerFreedom Wiki
Jump to navigation Jump to search

It is possible to use blockchain, of Bitcoin for example, as a secure digital timestamp notary.

Goal

This allows to save (as of now) 80 bytes of data in one Bitcoin transaction into Bitcoin blockchain.

This data could be a short text message, tiny binary data, but main use probably would be to save a checksum of some bigger document - then document is distributed via other methods, but the checksum saved in blockchain results in a sure timestamp, that no one can forge, to guarantee that at given time/date this document was known/existed (with accuracy of around 10 minutes up to maybe 4 hours, sometimes a bit more - depending on blocks time, and on miner clock skew).

Bitcoind manually

This can be done by hand, using commands offered in the Bitcoin (official / Bitcoin Core) client.

Examples here are using command-line program bitcoin-cli to talk to the Bitcoin node (bitcoind) using RPC commands. (Same should work in any Bitcoin RPC client).


bitcoin-cli  -rpcwallet=wallet-x-notary-use   createrawtransaction  "[]"   '{"data":"546D6D6D6E5453450A"}'

02000000000100000000000000000b6a09546d6d6d6e5453450a00000000

bitcoin-cli  -rpcwallet=wallet-rafal-notary-use   fundrawtransaction "02000000000100000000000000000b6a09546d6d6d6e5453450a00000000"  '{"conf_target":2}'

{
  "hex": "020000000120f80268a8ee7a3bc13b0fbeed5212c00071d9f8e44542e389bfb2c9e1ea7d780000000000feffffff0200000000000000000b6a09546d6d6d6e5453450a9f640a00000000001600141434a3eb3f5fbb86ed2aa17dd8587bfc2af0f1d300000000",
  "fee": 0.00002492,
  "changepos": 1
}

bitcoin-cli  -rpcwallet=wallet-rafal-notary-use   signrawtransactionwithwallet   '020000000120f80268a8ee7a3bc13b0fbeed5212c00071d9f8e44542e389bfb2c9e1ea7d780000000000feffffff0200000000000000000b6a09546d6d6d6e5453450a9f640a00000000001600141434a3eb3f5fbb86ed2aa17dd8587bfc2af0f1d300000000'

{
  "hex": "0200000000010120f80268a8ee7a3bc13b0fbeed5212c00071d9f8e44542e389bfb2c9e1ea7d780000000000feffffff0200000000000000000b6a09546d6d6d6e5453450a9f640a00000000001600141434a3eb3f5fbb86ed2aa17dd8587bfc2af0f1d3024730440220597c3b7734b0a12865fc628920ef6d58f4e291996da0cf97e5168a52ba33053d02200baf787299488e67ec85e865f878b3ae0922c45f0d3241a3aaa42cb9a682b899012102feeb9799fda533088121b29d5b45bd9012c7bf56e878358a0e34e48b726bdab400000000",
  "complete": true
}


bitcoin-cli  -rpcwallet=wallet-rafal-notary-use   sendrawtransaction      "0200000000010120f80268a8ee7a3bc13b0fbeed5212c00071d9f8e44542e389bfb2c9e1ea7d780000000000feffffff0200000000000000000b6a09546d6d6d6e5453450a9f640a00000000001600141434a3eb3f5fbb86ed2aa17dd8587bfc2af0f1d3024730440220597c3b7734b0a12865fc628920ef6d58f4e291996da0cf97e5168a52ba33053d02200baf787299488e67ec85e865f878b3ae0922c45f0d3241a3aaa42cb9a682b899012102feeb9799fda533088121b29d5b45bd9012c7bf56e878358a0e34e48b726bdab400000000"

d47dfd6d83e915a5417c802184fd054184f7e6977a738df64839dc0d7e97e86f

Result of this:

https://blockstream.info/tx/d47dfd6d83e915a5417c802184fd054184f7e6977a738df64839dc0d7e97e86f?expand

as seen there:

OP_RETURN0 BTC
Type
OP_RETURN
scriptPubKey (asm)
OP_RETURN OP_PUSHBYTES_9 546d6d6d6e5453450a
scriptPubKey (hex)
6a09546d6d6d6e5453450a
OP_RETURN data
TmmmnTSE