
Daisy: A private blockchain where blocks are SQLite databases, in Go - syncopate
https://github.com/ivoras/daisy
======
egypturnash
Everything abut this feels like the most terrible idea ever, but in such a
_fascinating_ way. It's beautiful.

~~~
vonhugendong
My thought EXACTLY. Can't wait to play around with this...

------
runeks
What's the point of using a blockchain in this way?

Bitcoin's blockchain is necessary because newer blocks need to inherit the
proof-of-work done on previous blocks, since the correct chain will be the one
with the most cumulative work in it (presuming it's also valid). So it needs
to be a sequential list of blocks, where each new block references the
previous one.

But I can't see why this is useful when a) proof-of-work isn't used and b)
blocks are separate databases. Why not just have one, big database and accept
commits into this if they're signed with the expected private keys?

~~~
imtringued
You could probably probably get away with putting a single sqlite database on
IPFS and using IPNS to point to the latest version and achieve the same thing.
IFPS' block level deduplication means you'd only have to download the changes
if the database receives a new update.

I'd like to see a decentralised database that doesn't require downloading the
entire dataset. It should be possible to implement index-only queries that
don't need to do a full table scan and therefore could run entirely in a
browser. The only problem is that having an index for every possible query
means the indices require more data than the dataset itself.

~~~
tveita
Something like [https://github.com/lmatteis/torrent-
net](https://github.com/lmatteis/torrent-net) ?

------
cl0rkster
From what I read, any holder of a private key that is accepted as
authoritative can add data to the chain at will and without restriction. The
consensus algorithm would then allow that user to rewrite the entirety of the
blockchain at will from the point their key was trusted forward by simply
creating a longer chain at no cost. What am I missing?

~~~
runeks
> What am I missing?

You're not missing anything, in my opinion.

Private blockchains make little sense, and the standard rebuttal of this
simply lists a large number of "potential applications", without going into
detail on any of them and explaining how a private blockchain solves that
specific problem.

------
oever
Government employ working on publishing government documents here. This looks
very interesting. What if a private key is leaked (by accident or on purpose)?
It would be good to have multiple branches of government sign the published
documents.

Is there a small tutorial on how to quickly set this up for demo and
evaluation?

------
oelmekki
There is something I don't get about the databases distributed : they are
read/write, and their data is not part of what is distributed in p2p, is that
right? It seems to be what means "Block payloads are SQLite database files.
Except for special metadata tables, their content is not enforced".

If that's so, what is the purpose of distributing blank sqlite databases (with
exception of blockchain keys metadata)? Also, how is it p2p distributed if
several users may have the sqlite databases in different state (and thus,
different sqlite files)?

~~~
gricardo99
My understanding is the data is distributed, the metadata tables are enforced
by the blockchain protocol, but the contents are free to be whatever the
writer wants to put in the database. Once it's written, the metadata/protocol
enforces the integrity of the data on the blockchain.

~~~
oelmekki
Indeed, it would make sense. "Content is not enforced" would mean "content
data structure is up to block creator". Thanks!

------
b34r
I feel like people are actively trying to mash up technologies just because.
No real benefit, just toy projects.

~~~
minxomat
So? Just for fun is not allowed anymore?

~~~
b34r
¯\\_(ツ)_/¯ idk I'd rather it be on Show HN than front page.

~~~
syncopate
It was on posted as Show HN six days ago but didn't generate any discussion:
[https://news.ycombinator.com/item?id=14512531](https://news.ycombinator.com/item?id=14512531)

------
kej
This looks interesting, but I feel like it's conflating two equally
interesting ideas, "what if only certain nodes could make new blocks" and
"what if the blocks had some kind of structured data".

I think moving those into two separate but compatible projects might help both
of them take off.

~~~
DennisP
Private versions of Ethereum do both things; JP Morgan is leading the charge
on this with their Quorum software. But it's object-structured data instead of
SQL.

[https://www.jpmorgan.com/country/US/EN/Quorum](https://www.jpmorgan.com/country/US/EN/Quorum)

------
oelmekki
Thinking twice about it, there is something exciting here about the concept.

Of all databases, sqlite has this special interest : it's the perfect tool to
be embedded as local database in clients.

Now, if we consider that blockchain is a new p2p effort to build decentralized
softwares, putting sqlite on a blockchain makes a lot of sense : this is a
mean to distribute data for decentralized apps.

It also makes sense in an era where data mining becomes a thing on its own,
and not just as part of a software stack.

Now, this is clearly not a drop in for our usual database on our server (where
latency and concurrent writing is the topmost concern, two points which are
blockchains weak points - and sqlite weakpoints), but there is certainly
something to explore there.

~~~
misterdata
See
[https://github.com/pixelspark/catena](https://github.com/pixelspark/catena)
\- does exactly this.

~~~
oelmekki
Love this. Catana and Daisy have different approaches, Daisy is distributing
databases that can bootstrap an offline app, while Catana is truly a
decentralized online database. Both are really interesting ideas, thanks for
pointing it out!

------
misterdata
Why store a database file in each block when you could also store
transactions? This is what Catena does:
[https://news.ycombinator.com/item?id=14548174](https://news.ycombinator.com/item?id=14548174).
Also allows for some interesting things you can do with privileges, for
instance.

------
rakoo
I don't understand. The added value of a blockchain compared to a simple
distributed store is that peers who don't want to trust each other need to get
to an agreement. All the examples look like they can be solved with a standard
distributed store like a set of couchDB instances where no deletion can
happen.

------
spookyactor
If a blockchain is a public ledger, what is a private blockchain?

~~~
gricardo99
A blockchain is a distributed ledger, not necessarily public, although
bitcoin, being the most famous, is public.

In this implementation it seems anyone can read the blockchain, but writing to
it is permissioned/controlled.

------
mirekrusin
What's the difference/benefits from, for example, having a feed to stream pgp
signed data where signature is for the current and previous message for
example?

~~~
jimmykennedy
You just described a blockchain/DLT...

