:: [Libbitcoin] Version3 Update
Forside
Slet denne besked
Besvar denne besked
Skribent: Eric Voskuil
Dato:  
Til: libbitcoin
Emne: [Libbitcoin] Version3 Update
I've recently completed a batch of work on Version3 [master branch].
These changes were motivated by a desire to further reduce our external
dependencies and generally improve code quality and reduce API complexity.

The latest version (4.2) of libzmq integrates tweetnacl. This allows us
to remove our libsodium dependency without loss of functionality or
security. libczmq++ is a zeromq library that was created by genjix for
use with libbitcoin. While some others use it we have been the only ones
to maintain it. This library was built on czmq, which is a zeromq C
library that builds on libzmq.

It turns out that the functionality in czmq++ can be reproduced using
libzmq directly without any increase in complexity or volume of code. In
fact building directly on libzmq in this case is simpler and more
efficient. But to make these changes efficiently required breaking
changes in libczmq++. It was much simpler and will be easier to maintain
over time by just integrating the capability directly into our
libbitcoin-protocol repository.

So libsodium has been dropped, and libczmq++ and czmq have been replaced
by our own libbitcoin-protocol. Once libzmq 4.2+ and libsecp256k1 are
released and packaged we will be dependent upon only our own repos and
well-supported and packaged external repos (boost and zeromq, and
libsecp256k1).

The implementation is much easier to follow, maintain and build on. This
has led to improvements in libbitcoin-client and libbitcoin-server. For
example, notice the dramatically simpler version3 client interface:

https://en.bitcoin.it/wiki/Libbitcoin_Client

These changes also resolved one of the two open bugs (shutdown segfault)
against the full version3 stack. This was resolved by simplifying the
node/server shutdown code, which was inadvertently allowing the node to
destruct before all threads were joined.

Also, the BX cert-new and cert-public commands have been modified to
work only with sodium keys, and both BS and BX config has been updated
to only use these key values (as opposed to ZMQ cert files). The keys
can be manually extracted from cert files, so existing certs can still
be used. This is designed to simplify config, work around a unicode path
limitation in ZMQ, and improve testability and consistency for the cert
commands. Keys are encoded in Z85 (base85) in order to prevent confusion
with bitcoin ec keys (both are 256 bit values), and for consistency with
ZMQ certificates and conventions.

Currently BS transitions from a complete header-first sync directly into
server API option (BN transitions into doing nothing at that point). To
complete a minimal version3 release requires that post-sync node
operation be reintegrated. I'd also like to make the header-first sync
restartable (currently it must complete sync or the database must be
resynced in full). I'm hoping to get these implemented and a release out
in the next 2 weeks - before I'm off for a few weeks on holiday.

e