
Show HN: An SQL database on top of a blockchain - misterdata
https://github.com/pixelspark/catena/blob/master/README.md
======
misterdata
Author here, happy to answer any questions. The implementation notes [1] may
be of interest as well!

[1]
[https://github.com/pixelspark/catena/blob/master/Implementat...](https://github.com/pixelspark/catena/blob/master/Implementation.md)

------
detstrat
What are the relevant scenario's for using this? I think it might be useful
for IoT devices, but other than that?

~~~
misterdata
Could be anything that you could also use Ethereum for. This provides similar
functionality, only with a more familiar (SQL) interface.

Some things I thought of: governmental registries, tracking history of
physical assets (e.g. tracking of maintenance history of aerospace
components), software licensing, storing timestamped cargo manifests (like the
Maersk case). You could even build a currency on this with the right set of
privileges.

------
dozzie
Congratulations. I've never seen so much effort put into so dumb and wasteful
idea. Or at least, so dumb at the first sight. What's the point of using
_timestamping_ service (blockchain) to store _data_?

~~~
misterdata
Well, using a blockchain for timestamping alone is pretty much worthless if
it's not connected to an application. Bitcoin, Ethereum and others don't use a
blockchain just for timestamping either, but store all sorts of data in it
(transactions in Bitcoin and even complete programs in Ethereum).

That said, this is obviously not meant to store large amounts of data. But you
could quite easily build a currency on top of this (add a 'balances' table,
and use grants to determine who can update what - a future version could even
provide smart contracts through SQL stored procedures).

~~~
dozzie
> Well, using a blockchain just for timestamping is pretty much worthless in
> practice.

Quite the opposite. Using blockchain _for anything but timestamping_ is
worthless, because there are faster and less resource-intensive protocols for
about everything. Data storage, for instance, has distributed hash table, and
change coordination has leader election or consensus protocols.

> Bitcoin, Ethereum and others don't use a blockchain just for timestamping
> either, but store all sorts of data in it (transactions in Bitcoin and even
> complete programs in Ethereum).

You're putting the cart before the horse. These "all sorts of data" in
blockchain are in fact _documents_ that get _timestamped_ \-- the timestamp
says "document X was issued before document Y". A Bitcoin transaction in
isolation from all the other transactions is nothing more than a semi-random
string of bytes. For it to be a money-like thing you need to have previous
transactions (and how do you know they're previous? by _timestamp_ ) that
testify the account had enough resources for all the output.

~~~
misterdata
Yes, so what this does is timestamp transactions (in this case SQL DML) in a
decentralized way between nodes that do not or cannot trust each other. All
this while enforcing write permissions ('grants') that were agreed upon
earlier.

The idea that some of these transactions store data is not any different from
the idea that some transactions in Bitcoin add new coins to the system, or
that some transactions in Ethereum create and store contracts (which are code
and data).

Now of course you could, instead of storing the actual data and/or SQL, put
data in a DHT and reference and timestamp that.

~~~
dozzie
> Yes, so what this does is timestamp transactions (in this case SQL DML) in a
> decentralized way between nodes that do not or cannot trust each other. All
> this while enforcing write permissions ('grants') that were agreed upon
> earlier.

And this should be the very first thing to put in README. This is the single
most important thing about any program that uses a blockchain protocol: what
exactly is the decentralized, adversity-proof timestamping used for. Right
after that should be placed rationale, i.e. how does the hostility resistance
help compared to cooperation-based protocols.

~~~
GhostVII
Why would that need to be in the README? Isn't it the whole point of
blockchain?

~~~
misterdata
I think it is actually a good idea to describe the whole point of using a
blockchain as suggested. A lot of organisations I encounter don't really have
a clue and do not realize that even a traditional database could fill their
need perfectly in many cases.

