alephium / alephium

Reference client for Alephium protocol

Version Matrix

Alephium

This repository is the reference implementation of Alephium platform, which is a sharded blockchain to make programmable money scalable and secure.

Main Innovations

The protocol's innovations extend battle-tested ideas from Bitcoin and Ethereum:

  • BlockFlow algorithm based on UTXO model enables sharding and scalability for today (code + algorithm paper)
    • the first sharding algorithm supports single-step cross-shard transactions, same user experience as single chain
    • the PoW based sharding does not rely on beacon chain, simple and elegant
  • Stateful UTXO model combines the advantages of both eUTXO model and account model (see code, wiki to come)
    • tokens are first-class citizens and UTXO-based, which are safely owned by users directly instead of contracts
    • the same expressiveness as account model. DApps can be easily built on top of it with better security
    • support multiple participants in a single smart contract tx call. Multiple calls can be packed into a single tx too
  • Novel VM design resolves many critical challenges of dApp platforms (see code, wiki to come)
    • it's way less IO intensive
    • flash loan is not available by design
    • eliminate many attack vectors of EVM including unlimited authorization, double dip issue, reentrancy attack, etc
    • Utxo style fine-grained execution model makes risk-free arbitrage less common
  • Front-running mitigation through random execution of transactions (see code, wiki to come)
  • PoLW algorithm reduces the energy consumption of PoW in the long term (research paper)
    • Adaptive rewards based on hashrate and timestamp are designed and implemented
    • Internal mining cost through burning will be added when hashrate and energy consumption is significantly high

Development Status

This project is currently under heavy development with more code consolidation, optimizations, and tests. However, it can be used to run a TestNet already.

Installation

Requierments

You must have the following dependencies installed on your system in order to run our JAR delivrable:

  • java (>= 8, 11 is recommended)

Running

You can obtain our latest single JAR distribution from the GitHub releases and start the application using the following command:

java -jar alephium-.jar

Build from source

Requierments

In order to build the project from source the following dependencies must be installed on your system:

  • java (>= 8, 11 is recommended)
  • Python (Python3 is recommended)
  • SBT

Single JAR

In order to build a single runnable JAR use the following command: ./make assembly

The resulting assembly file will appear in /app/target/scala-2.13/ directory.

Univeral Zip distribution

In order to build a zip distribution including launch scripts use the following command: ./make package

The resulting package file will appear in the app/target/scala-2.13/universal directory.

Configuration

You can define user specific settings in the file $ALEPHIUM_HOME/user.conf, where by default $ALEPHIUM_HOME points to ~/.alephium.

Testing

There are two kinds of tests:

  1. Unit and property tests, which can be run with the ./make test command.
  2. Integration tests, ./make itest.