What if…

What if there is a blockchain where only certain nodes, in possession of one of accepted private keys, can add data (i.e. new blocks) to a blockchain, whose blocks are (SQLite) databases, and where those existing nodes can accept new ones into their ranks by signing the candidate’s keys in a web-of-trust style?

What if public (government) documents were distributed in this way… ? What if Wikipedia was… ?

Querying the blockchain

All the blocks in the blockchain can be queried by using a command such as ./daisy query “SELECT COUNT(*) FROM wikinews_titles” (note the quotes!) . This will iterate over all the blocks, and in those blocks where the query is successful, will output the results to stdout as JSON objects separated by newlines. Of course, this is limited to read-only queries.

Intended uses

Some possible use cases I’ve thought of for blockchains where everyone can download and verify the data, but only a few parties can publish:

  • Distributing academic articles: create a new blockchain for academic institutions (and Arxiv and such) and allow them to push blocks with articles into the blockchain.
  • Distributing municipal and governmental records: each institution / agency could be allowed to publish blocks with records and documents into the blockchain.
  • Distributing scientific data: only certified research institutions publish data into the blockchain.
  • Distributing sensor data, by having gateways publishing daily aggregate data from sensor networks.
  • Distributing sports / betting / lottery results
  • Wikileaks, of course
  • Making a gigantic world-wide database of e.g. product information: manufacturs could add information about their products, keyed on e.g. UPC codes

ToDo

  • Implement nicer error handling when replying to messages
  • Refactor db… , action… and blockchain… funcs into struct methods
  • Implement the “URL” encoding for block transfers: so the data in the JSON messages isn’t block data, but an URL to the block data.
  • Implement a Bloom filter for tables in SQL queries, to skip querying blocks which don’t have the appropriate tables.
  • Implement stochastic guarded block importing: if there apparently is a new block in the network: ask a number of peers if they’ve seen it before importing it.

Random thoughts and blue-Moon wishes

  • How to deal with blockchain abuse? I.e. one of the signatories turns out to be an adversary? Some ideas:

    • Limit the amount of data (in bytes) a signatory can add by the signatorie’s age (i.e. the longer the key is approved, the more data it can add). This offers absolutely no protection against “sleepers” which turn out to be adversaries after enough time has passed.
    • Require multiple signatures on blocks, which offers no protection against a clique of adversaries, and inconveniences the common use case where there are indeed individul authoritative sources of data.
    • Create a cryptocurrency overlay on the blockchain (possibly using external cryptocurrencies, tokens) where adding data becomes expensive – which doesn’t protect against a well-funded adversary.

Block metadata

Basic crypto

ECDSA P-256 is used for public key crypto operations.

Strings refered in Daisy as “public keys” are SHA256 hashes of public keys and begin with the string “1:” (the 1 is to indicate a key type, should it need to change in the future). They look like “1:9569f0894e3d2b435a4c49c6a97501f4191b9729ff53be5acee2c7bd4be0e439”.