uranther

uranther

The Blockchain (distributed ledger technology)

What do you all think about writing a blockchain in Elixir? Being a functional language and having OTP in our arsenal, it seems it would be easier to get a block chain up-and-running quickly. We even have some good starting points for the consensus algorithm and hash trees:

:024: :lol:

Blockchain resources

Elixir community effort

Background

Videos

Topical

General

Bitcoin

Ethereum

Books

White Papers

Benchmarks

These projects are in active (rapid!) development and in a variety of languages.

Academic Papers

Specific implementations

Meta-analysis

Distributed consensus

Proofs of “X”

Various methods of using blockchain technologies to prove something in a way that is cryptographically verifiable.

FOR CRYPTOCURRENCY
OTHER PROOFS

Blockchain components

Distributed consensus algorithms

A fundamental problem in distributed computing and multi-agent systems is to achieve overall system reliability in the presence of a number of faulty processes. This often requires processes to agree on some data value that is needed during computation. Examples of applications of consensus include whether to commit a transaction to a database, agreeing on the identity of a leader, state machine replication, and atomic broadcasts. (Wikipedia)

  • raftex - Raft consensus
  • expaxos - Paxos consensus
  • rafute - Another implementation of Raft
  • dike - Paxos implementation in Erlang

Merkle (hash) trees

A hash tree or Merkle tree is a tree in which every non-leaf node is labelled with the hash of the labels or values (in case of leaves) of its child nodes. Hash trees are useful because they allow efficient and secure verification of the contents of large data structures. Hash trees are a generalization of hash lists and hash chains. (Wikipedia)

Elixir

Erlang

Cryptography

Elixir

  • elixir-rsa - Erlang public_key cryptography wrapper
  • elixir-ecc - elliptic curve cryptography
  • elixir-mcrypt - NIF wrapper around libmcrypt
  • cryptex - library for encrypting/decrypting, signing/verifying data

Erlang

Keywords: state machine replication, distributed cryptographic ledger, transaction log

Most Liked

aesedepece

aesedepece

Hi everyone,

Good news for you: there’s already at least one successfully funded open source Elixir project in the blockchain space.

We are Stampery, a startup leveraging the power of the bitcoin and ethereum blockchains to create immutable proof of existence, integrity and ownership of any kind of data set.

In fact, we have been part of the last batch of the aforementioned Boost accelerator. I am pretty sure @IamCharlesHan knows my colleges Luis, Daniele and of course Tomasso and his celebrated cooking skills.

Stampery was funded with $600K from Draper & Associates, Blockchain Capital and Di-Ann Eisnor in 2015 Q3, shortly after presenting at TechCrunch Disrupt SF.

We used Elixir to build our distributed blockchain data anchoring architecture, best known as BTA. It allows us to embed as many data as we want in a single bitcoin or ethereum TX.

We are open sourcing our whole stack these days. We started by publishing our binary merkle tree Elixir implementation, which as @uranther mentioned is crucial for any blockchain project you may want to start out:

We will continue releasing the source code for more components of our stack in the next weeks, including the bitcoin and ethereum raw transaction composer modules.

Of course I will be more than happy to contribute to this exchain initiative. I’m aesedepece at Github.

Let’s see what we can come up with!

uranther

uranther

Looking at the architectural diagram of Hyperledger, I tried to figure which modules would be suited to Elixir (highlighted yellow in the image) and which to Rust or the like (highlighted red). It seems Elixir could handle a large portion of these services, while leaving computation- and memory-intensive chaincode services to a faster computing language. That fast language could be Haskell or even Futhark. I wonder how juno compares to Ethcore Parity in chaincode/smart contract speed.

Maybe the ledger storage could be handled with Riak or a NewSQL database like VoltDB or CockroachDB? The event stream could be exposed through a WebSocket. Any other thoughts?

So a possible way forward is to build out Elixir services which replace those in Hyperledger. The idea being that we can write correct distributed systems code with fewer SLOC and which is easier to understand and reason about.


@aesedepece That’s awesome you are using Elixir for this exact purpose! I look forward to seeing more open source libraries released from Stampery. I am especially interested in these five types of proofs you provide:

  • Proof of Ownership
  • Proof of Existence
  • Proof of Integrity
  • Proof of Agreement
  • Proof of Receipt

I have some other feedback about the website and copy, but it doesn’t really fit in this thread :wink:

robinmonjo

robinmonjo

Hello all,

I made a “naive” blockchain in Elixir, inspired by existing implementations in JS and Haskell (links in the readme). I made this for educational purpose to improve my Elixir skills but this might (hopefully) be a good starting point.

Any feedbacks/contributions are welcome and you can let me know what you think here.

Regards,
Robin

rps17

rps17

Hi uranter,

that’s a good idea. I’m learning Elixir/Phoenix and have great interest in cryptocurrencies, applications of blockchain.
I’ve found this article and think it is interesting
http://yosriady.com/2016/05/19/merkle-trees-in-elixir/

uranther

uranther

Do you have any repository set up yet?

exchain/exchain on GitHub

I just created a new supervised mix project and put a tentative roadmap for the project.

Do you think it can all be done in Elixir / Erlang - any need for performant C code?

I think we can start implementing it in Elixir as non-fancy data structures until we need to start scaling it and optimizing bottlenecks. The “chaincode” or smart contracts portion should be done in Rust (or Futhark?) because that component must crunch numbers. It would be convenient to use the smart contracts virtual machine of Ethcore Parity, the latest Rust implementation of Ethereum, and likewise pluggable for that of Hyperledger Fabric or Sawtooth.

Where Next?

Popular in Wikis Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
Eiji
At start some definitions: HTTPS (is a protocol for secure communication over a computer network which is widely used on the Internet) -...
New
anildigital
Here is list of plugins for different editors Sublime Text 3 — Elixir.tmbundle - https://github.com/elixir-editors/elixir-tmbundle/#co...
New
georgeguimaraes
Hi people, since the new year is coming, I’d like to plan my travels for events in 2017. So, what events (Elixir or FP related) that you...
New
axelson
With the new year I am looking at travel for this year and I’d love to base some travel around Elixir. So in the spirit of the 2017 threa...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
swelham
Introduction After some discussion with a few other members we thought it might be an idea to start a thread where we can post about libr...
New
OvermindDL1
It was stated at https://github.com/elixir-lang/elixir/issues/6172 that Mirrors of the primary Elixir website would be useful since Cloud...
New
AstonJ
Wonder if we can compile a list of learning resources, blog posts, talks, threads etc to help those who are just learning about Contexts....
New
gmile
:httpc HTTP client is part of Erlang standard library, and as such can be easily used in Elixir code too. One particular advantage of usi...
New

Other popular topics Top

SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement