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:
![]()
Blockchain resources
Elixir community effort
- exchain/exchain on GitHub
- robinmonjo/coincoin
Background
Videos
Topical
General
Bitcoin
Ethereum
- Ethereum Design Rationale
- Ethereum Virtual Machine and Execution Environment Overview
- Ethereum Platform Review Opportunities and Challenges for Private and Consortium Blockchains
Books
- Princeton Bitcoin Book
- Blockchain Revolution: How the Technology Behind Bitcoin Is Changing Money, Business, and the World by Don Tapscott et al.
- The Science of the Blockchain by Roger Wattenhofer
- Mastering Bitcoin: Unlocking Digital Cryptocurrencies by Andreas M. Antonopoulos
White Papers
Benchmarks
These projects are in active (rapid!) development and in a variety of languages.
- Ethereum
- Hyperledger
- Fabric (Go)
- Sawtooth (Python)
- Juno (Haskell) – Smart Contracts Running on a BFT Hardened Raft
- Stellar
Academic Papers
Specific implementations
- Bitcoin: A Peer-to-Peer Electronic Cash System
- Ethereum Yellow Paper – formal specification
Meta-analysis
- The Quest for Scalable Blockchain Fabric: Proof-of-Work vs. BFT Replication
- Hiding Transaction Amounts and Balances in Bitcoin (zero knowledge proofs)
- Misbehavior in Bitcoin: A Study of Double-Spending and Accountability (double-spending attack)
Distributed consensus
- Tangaroa: a Byzantine Fault Tolerant Raft
- Practical Byzantine Fault Tolerance (PBFT)
- Building Replicated Systems for Performance (“Adam”)
- All about Eve: Execute-Verify Replication for Multi-Core Servers (extended version)
- The Stellar Consensus Protocol: A Federated Model for Internet-level Consensus
- Raft Refloated: Do We Have Consensus?
- Non-determinism in Byzantine Fault-Tolerant Replication
- CheapBFT: Resource-efficient Byzantine Fault Tolerance
- Reaching Agreement in the Presence of Faults
Proofs of “X”
Various methods of using blockchain technologies to prove something in a way that is cryptographically verifiable.
FOR CRYPTOCURRENCY
OTHER PROOFS
- Proof of Elapsed Time (PoET)
- Proof of Existence (or Publication)
- Proof of Ownership
- Proof of Integrity
- Proof of Agreement
- Proof of Receipt
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 consensusexpaxos- Paxos consensusrafute- Another implementation of Raftdike- 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
merklet- Hash trees - Riak implementation
Cryptography
Elixir
elixir-rsa- Erlangpublic_keycryptography wrapperelixir-ecc- elliptic curve cryptographyelixir-mcrypt- NIF wrapper around libmcryptcryptex- library for encrypting/decrypting, signing/verifying data
Erlang
Keywords: state machine replication, distributed cryptographic ledger, transaction log
Most Liked
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
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 ![]()
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.
https://github.com/robinmonjo/blockchain
Any feedbacks/contributions are welcome and you can let me know what you think here.
Regards,
Robin
Popular in Wikis
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










