• Stars
    star
    499
  • Rank 88,341 (Top 2 %)
  • Language
    Scala
  • License
    Creative Commons ...
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ergo protocol description & reference client implementation

Ergo

Welcome to the official repository for the Ergo Platform. This repository contains the reference client, also known as the node, for Ergo. Ergo is a cryptocurrency protocol that has been designed to offer a secure environment for peer-to-peer transactions. It supports programmable scarce money (Ergo) and a wide range of financial tools.

The reference client is primarily written in Scala. While certain components of the protocol are implemented in other languages (for instance, sigma-rust is a Rust-based implementation of the ErgoScript cryptocurrency scripting language), the reference client provides the most complete and comprehensive implementation of the Ergo protocol.

Key Features of Ergo

Ergo, while sharing some commonalities with Bitcoin as a UTXO Proof-of-Work cryptocurrency, stands out due to its unique design and features. It has been built from the ground up, introducing several innovative elements:

  • ErgoScript: A powerful contract language in the multi-stage extended UTXO model. More details can be found in the ErgoScript whitepaper.
  • Autolykos2: A memory-hard Proof-of-Work function, providing enhanced security. Learn more about it here.
  • Support for Stateless Clients: Ergo supports asymmetric stateless clients, based on this paper, and includes features like NiPoPoWs and hybrid modes.
  • Advanced Transactional Language: Ergo introduces an alternative transactional language that is more powerful than Bitcoin Script and is designed to be safe against heavy validation attacks.
  • Innovative Fee Model: Ergo implements an alternative fee model with a mandatory storage-rent component (also known as demurrage).

Specifications

  • white paper - a brief description of the protocol
  • ErgoScript white paper - describes ErgoScript, a Cryptocurrency Scripting Language Supporting Noninteractive Zero-Knowledge Proofs used in Ergo

More papers can be found at docs.ergoplatform.com/documents.

Security Assumptions

The Ergo client operates under certain assumptions about its environment:

  • The execution environment is trusted. Although the seed is stored in an encrypted file, and the client's wallet attempts to purge the secret key from memory as soon as it is no longer needed, the client does not have defenses against side-channel attacks, memory scans, etc.
  • Clocks are expected to be synchronized to a reasonable degree. If a block's timestamp is more than 20 minutes into the future, the block will be temporarily rejected. The client does not utilize NTP or other time synchronization protocols.

Building and Running the Node and UI

For instructions on how to build and run the node and UI, refer to the official documentation.

By default, the node processes all blocks from the genesis block. However, there are other options available that may be more suitable for hardware with limited resources.

  • Bootstrapping with a UTXO set snapshot: This works similarly to Ethereum's snap-sync. The node first downloads a UTXO set snapshot from a secure point in the past, then downloads blocks following the UTXO set snapshot and applies them to the set. For more details and security proofs, refer to the "Multi-mode cryptocurrency systems" paper. To enable this feature add the following to your configuration file:

ergo {
  ...
  node.utxoBootstrap = true
  ...
}
  • The UTXO set snapshot bootstrapping can be further optimized by combining it with NiPoPoW (Non-Interactive Proofs of Proof-of-Work). This method allows for syncing the headers-chain in logarithmic time, as opposed to the linear time required by the standard SPV sync for headers. For more details, refer to the NiPoPoW paper.

ergo{
  ...
  node.nipopow.nipopowBootstrap = true
  node.utxo.utxoBootstrap = true
  ...
}
ergo {
   ...
   node.stateType = "digest"
   node.blocksToKeep = 2160 # store and process last three days only
   node.nipopow.nipopowBootstrap = true   # compatible with NiPoPoWs 
   ...
}

For more detailed information on different modes of node operation, please visit docs.ergoplatform.com/node/modes.

Testing Procedures

Ergo utilizes three types of tests:

  1. Unit and property tests: These can be run using the sbt test command.
  2. Integration tests: These tests require Docker to be installed. Run them with the sudo sbt it:test command.
  3. Bootstrapping tests: These tests are time-consuming as they verify that the node is syncing with the main network in various regimes. Docker is also required for these tests. Run them with the sudo sbt it2:test command.

Setting up the Project in an IDE

You can use either IntelliJ IDEA (Community or Ultimate edition) or VSCode with the Metals extension.

Ensure that the project can be built with sbt before opening it in an IDE. You may need to resolve any dependency errors first.

To open the project in IntelliJ IDEA, select File / Open and navigate to the project folder. This will initiate the Project Import Wizard, which uses the SBT configuration (build.sbt file) to generate the project configuration files for IDEA. You can view the project configuration in the File / Project Structure... dialog. If the import is successful, you should be able to compile the project in the IDE.

Contributing to Ergo

Ergo is an open-source project and we welcome contributions from developers and testers! Join the discussion on Ergo Discord in the #development channel and check out our Contributing documentation.

Frequently Asked Questions

For common queries, please refer to our Frequently Asked Questions page.

More Repositories

1

ergo-wallet-app

Ergo Wallet App
Kotlin
96
star
2

sigma-rust

Rust implementation of ErgoTree interpreter and wallet-related features
Rust
69
star
3

eips

Ergo Improvement Proposals
65
star
4

awesome-ergo

A curated list of awesome and useful Ergo resources
64
star
5

sigmastate-interpreter

ErgoScript compiler and ErgoTree Interpreter implementation for Ergo blockchain
Scala
62
star
6

oracle-core

Core off-chain component of Oracle Pools
Rust
61
star
7

ergoscript-by-example

Learn ErgoScript by reading example smart contracts powered by Ergo Playground.
52
star
8

Autolykos-GPU-miner

CUDA-based GPU miner for Ergo (Autolykos algorithm)
C
39
star
9

ergo-appkit

Appkit: A Library for Java/Scala/Kotlin Development of Ergo Applications
Java
38
star
10

ergo-headless-dapp-framework

An easy to use framework for building Ergo headless dApps. Developed by EMURGO and Ergo Platform.
Rust
23
star
11

ergodocs

HTML
22
star
12

explorer-backend

Ergo Blockchain Explorer
Scala
22
star
13

ergo-js

JS library for Ergo integration
JavaScript
17
star
14

ergo-node-interface-rust

A Rust library which makes interacting with and using an Ergo Node simple. Developed by EMURGO and Ergo Platform
Rust
15
star
15

grow-ergo

Grow ERG
14
star
16

ergo-bootstrap

Ergo bootstrap tool, built on top of ergo-nix, will help you to quickly deploy an Ergo blockchain cluster with a handful of useful tools you might need to start developing your dApps.
Shell
11
star
17

website

Sources of ergoplatform.org
HTML
11
star
18

ergo-utilities-rust

General utilities to make writing off-chain Ergo code in Rust simpler.
Rust
10
star
19

ergo-dex

ErgoDex: A Decentralized Exchange on Ergo Blockchain
Scala
9
star
20

ergo-jde

Ergo transaction builder using JSON
Scala
9
star
21

board-new

Public bulletin board implementation
Scala
8
star
22

sigmaverse

Website for ergo dApps
TypeScript
7
star
23

ergo-playgrounds

Run contracts + off-chain code in the browser
Scala
6
star
24

scanner

Ergo Blockchain Scanner
Scala
6
star
25

ergo-scala-compiler

ErgoScala to ErgoTree compiler
Scala
6
star
26

ergo-contracts

Contracts for Ergo with verified properties
Scala
6
star
27

ergofund

ErgoFund Backend
JavaScript
5
star
28

ansible

One repo to rule them all
Shell
5
star
29

ergo-nix

Nix
5
star
30

explorer-frontend

ERGO Explorer
TypeScript
5
star
31

ergo-tool

A Command Line Interface for Ergo blockchain
Scala
5
star
32

ledger-app-ergo

Ergo application for Ledger Nano S
C
5
star
33

bounded-vec

Non-empty rust Vec wrapper with type guarantees on lower and upper bounds for items quantity.
Rust
5
star
34

ergoweb

JavaScript
4
star
35

ergoscript-compiler

Scala
4
star
36

ergo-lib-wasm

ergo-lib bindings for JS/TS
TypeScript
4
star
37

explorer-back

Ergo blockchain explorer backend
Scala
4
star
38

sips

SigmaUSD Improvement Proposals
3
star
39

ergo-node-interface

Interface for Ergo node
JavaScript
2
star
40

Self-Reproducing-Coins

Sources for paper https://arxiv.org/pdf/1806.10116.pdf
TeX
2
star
41

dexy-usd-bank-ui

TypeScript
2
star
42

ergo-utility

A set of useful utilities for Ergo protocol
Scala
2
star
43

node-info-monitor

Ergo node API /info monitoring tool
Python
2
star
44

community

Discussion and documentation on community practices
Shell
1
star
45

autoleakus

Scala
1
star
46

spacefees

"On Space-Scarce Economy In Blockchain Systems" draft
Jupyter Notebook
1
star
47

ergo-dropbox

1
star
48

docs-ergoplatform

Ergoplatform Documentation
JavaScript
1
star
49

ergo-wallet

Tools for keys management, transactions signing
Scala
1
star
50

developer-docs

Documentation for developers
JavaScript
1
star