Baseledger core consensus for running validator, full and seed nodes

baseledger-core

Baseledger core consensus client for running a validator, full or seed node.

⚠️ WARNING: this code has not been audited and is not ready for use in production. The Baseledger mainnet is scheduled to launch in Q1 2022.

This package depends on a modified version of Tendermint v0.34.11 which requires a Vault for storing private key material. We also compile the Baseledger Application Blockchain Interface (ABCI) and tendermint core dependencies together within a single binary for ease-of-use, cross-platform portability and optimal performance.

Quickstart

  1. Install golang
  2. Build the project from source
  3. Create a Vault and Ed25519 keypair using the prvd CLI
  4. Run a full or validator node
  5. (Optional) Deposit UBT in the appropriate staking contract

Roadmap

Baseledger was created by Unibright and Provide and is under active development.

Testnets

In the spirit of developing a proof of concept implementation to experiment with network validation in tendermint (including staking and delegation), native opcodes and a community block explorer, the team built the "lakewood" testnet. This testnet was created using Cosmos SDK.

The "peachtree" testnet was created from scratch using tendermint for BFT consensus and the Provide stack for subscribing to events emitted by the Baseledger governance and staking contracts, broadcasting baseline proofs to the network and otherwise interacting with the Baseline Protocol. As a result of this design, baseledger-core can be built as a single container and added to existing deployments of the Provide stack for increased security. baseledger-core can also run standalone (i.e., outside the context of a Provide stack). Baseledger nodes running outside the context of a Provide stack are not restricted from operating as validator, full or seed nodes. Organizations implementing the baseline pattern in commercial multiparty workflows benefit from running a local Baseledger node because it provides additional security to the cryptographic commitments (proofs) stored within the Provide stack without sacrificing any privacy guarantees inherent to baselining.

Mainnet

The Baseledger mainnet is currently scheduled to launch in Q1 2022. More information will be made available in Q4 2021 about the governance council and how you can apply to become a validator on the mainnet to earn block rewards in UBT.

Prerequisites

  • golang (1.16 recommended); only required when building from source

Hardware Requirements

The following are the minimum hardware requirements recommended for running a Baseledger validator or null node:

  • 2+ CPU cores
  • 4GB RAM minimum
  • SSD; recommended minimum free disk space >= 10GB as of September 2021

Build

git clone [email protected]:baseledger/baseledger-core.git
make build

Creating a Vault

Using the Provide CLI, you can easily setup a secure vault instance to secure your Baseledger keys. Baseledger currently supports Ed25519 keys for peer-to-peer authorization and validator keys.

If you have not previously created a Provide user, first create one:

prvd users create

Next, authenticate using those credentials and create a vault and Ed25519 key:

prvd authenticate
prvd vaults init --name 'Baseledger Vault'
prvd vaults keys init

# follow the prompts; control-c to bypass selecting an application and organization

✔ Baseledger
✔ asymmetric
✔ sign/verify
Name: Baseledger node key
Description: My first baseledger node key
✔ Ed25519

You will see the UUID of the created vault key.

You will also need to authorize a refresh token for the user or organization that is the owner of the vault by running the following:

prvd api_tokens init [--organization <org uuid>] --offline-access

Note the refresh token, vault id and vault key id. Each of these values will be used to run a validator or full node.

Running a Full Node

You can use the following command to run a full node on the Baseledger "peachtree" testnet:

VAULT_REFRESH_TOKEN=<your refresh token> \
VAULT_ID=<vault id> \
VAULT_KEY_ID=<vault key id> \
BASELEDGER_MODE=full \
LOG_LEVEL=debug \
BASELEDGER_LOG_LEVEL='main:info,*:error' \
BASELEDGER_GENESIS_URL=http://genesis.peachtree.baseledger.provide.network:1337/genesis \
BASELEDGER_PERSISTENT_PEERS=187b285fcf8bff3f08f5e61cfe05b713a4d32356@genesis.peachtree.baseledger.provide.network:33333 \
BASELEDGER_PEER_ALIAS=<your alias> \
./.bin/node

Running a Validator Node

Running a validator node requires the user to be a depositor on the configured staking contract. See the staking contract deposit() method described below.

You can use the following command to run a validator node on the Baseledger "peachtree" testnet:

VAULT_REFRESH_TOKEN=<your refresh token> \
VAULT_ID=<vault id> \
VAULT_KEY_ID=<vault key id> \
BASELEDGER_MODE=validator \
LOG_LEVEL=debug \
BASELEDGER_LOG_LEVEL='main:info,*:error' \
BASELEDGER_GENESIS_URL=http://genesis.peachtree.baseledger.provide.network:1337/genesis \
BASELEDGER_PERSISTENT_PEERS=187b285fcf8bff3f08f5e61cfe05b713a4d32356@genesis.peachtree.baseledger.provide.network:33333 \
BASELEDGER_PEER_ALIAS=<your alias> \
./.bin/node

Governance

A governance contract architecture is being developed which will, among other things, make the staking and other future contracts upgradable by way of the governance council.

Ethereum Bridge

We have taken a minimalistic approach to the Baseledger node implementation using tendermint. A critical part of the architecture is maintaining a highly fault-tolerant bridge between a configured Ethereum network (e.g., mainnet, ropsten, kovan, etc.) and the Baseledger network (e.g., mainnet or peachtree etc).

Latency

Just as crypto exchanges await a number of block confirmations before making deposited assets available for use, there are a number of block confirmations which must occur on the EVM-based network which hosts the Baseledger governance and staking contracts prior to any bridged changes taking effect on the Baseledger network.

For example, if a staking contract withdraw() transaction affects the withdrawal of 100% of the amount on deposit, the validator will cease to participate in block rewards effective after the number of block confirmations. The number of L1 confirmations required prior to the Baseledger network recognizing any associated updates (e.g., changes to the validator set) is determined based on which EVM-based network is hosting the staking and token contracts:

Network Block Confirmations
mainnet 30
ropsten 3
rinkeby not supported at this time
kovan not supported at this time
goerli not supported at this time

Staking Contract

A staking contract, initialized with a reference to the UBT token contract address, is deployed on the following Ethereum networks:

Network Symbol Token Contract Address Staking Contract Address
mainnet UBT 0x8400D94A5cb0fa0D041a3788e395285d61c9ee5e --
ropsten UBTR 0xa9a466b8f415bcc5883934eda70016f8b23ea776 0x0B5FC75192F8EE3B4795AB44b3B455aB3d97A6dF
rinkeby -- -- --
kovan -- -- --
goerli -- -- --

Faucet

A faucet is being added to Provide Payments to make it easy to request UBT on supported testnets via the CLI.

Methods

The core purpose of the staking contract is to enable deposits and withdrawals of UBT on the Ethereum mainnet, or "test UBT" (such as UBTR, on the Ropsten testnet).

deposit(address beneficiary, bytes32 validator, uint256 amount) external

Become a depositor to the configured staking contract or increase an existing position.

Prior to making your first deposit into the staking contract from any address, or if a subsequent amount you wish to deposit exceeds the value of the remaining approved tokens, you must call approve(address spender, uint25¸amount) on the token contract to allow it to transfer UBT on your behalf when you call deposit().

The following example contract call to the UBTR token contract (0xa9a466b8f415bcc5883934eda70016f8b23ea776) approves the staking contract (0x0B5FC75192F8EE3B4795AB44b3B455aB3d97A6dF), enabling you to deposit up to 250,000 UBTR:

Function: approve(address spender, uint256 amount)

MethodID: 0x095ea7b3
[0]:  0000000000000000000000000b5fc75192f8ee3b4795ab44b3b455ab3d97a6df
[1]:  000000000000000000000000000000000000000000000000000016bcc41e9000

Call the deposit() method. The following example contract call to the staking contract on the "peachtree" testnet (0x0B5FC75192F8EE3B4795AB44b3B455aB3d97A6dF) results in 25,000 UBTR transferred and placed on deposit for benefit of sender.

Function: deposit(address beneficiary, bytes32 validator, uint256 amount) ***

MethodID: 0xeb2243f8
[0]:  000000000000000000000000bee25e36774dc2baeb14342f1e821d5f765e2739
[1]:  eacbbc154c8373d7cb9134ed2a2fa2a4bdaf8bfef27b91299b8dce4042bd0000
[2]:  00000000000000000000000000000000000000000000000000000246139ca800

This method emits a Deposit(address addr, address beneficiary, bytes32 validator, uint256 amount) event from the EVM/mainnet contract when a validator deposit succeeds, either by way of governance approval or, in primitive/testnet setups, implicit approval.

Staking contract source can be found here. Example transaction on Ropsten can be found here.

withdraw(uint256 amount) external

Initiate the withdrawal of a portion, or all, of a previously deposited stake from the configured staking contract; the following example contract call to the staking contract on the "peachtree: testnet (0x0B5FC75192F8EE3B4795AB44b3B455aB3d97A6dF) results in 10,000 UBTR being withdrawn from our depositor account on the staking contract and returned.

Function: withdraw(uint256 value) ***

MethodID: 0x2e1a7d4d
[0]:  000000000000000000000000000000000000000000000000000000e8d4a51000

This method emits a Withdraw(address addr, bytes32 validator, uint256 amount) event from the EVM/mainnet contract when a validator withdrawal succeeds, either by way of governance approval or, in primitive/testnet setups, implicit approval.

Staking contract source can be found here. Example transaction on Ropsten can be found here.

Proxy Staking

An abstract proxy staking mechanism is being developed to add composable delegation functionality to the staking contract (see relevant placeholder in the source code here). Validators will be able to create competitive proxy staking offerings and implementations.

💡 This is a great idea for a hackathon project at the upcoming EthAtlanta hackathon, happening October 1-3.

Additional documentation forthcoming.

Owner
Baseledger
Blockchain for Baselining
Baseledger
Similar Resources

CoreDNS plugin to create records for Kubernetes nodes.

kubenodes Name kubenodes - creates records for Kubernetes nodes. Description kubenodes watches the Kubernetes API and synthesizes A, AAAA, and PTR rec

Jul 7, 2022

Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021

Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

Dec 31, 2022

Reference implementation of the PLAN Data Model and core components

PLAN is a free and open platform for groups to securely communicate, collaborate, and coordinate projects and activities.

Nov 2, 2021

Go-libp2p-core. - Home to the interfaces and abstractions that make up go-libp2p

go-libp2p-core Home to the interfaces and abstractions that make up go-libp2p. I

Jan 17, 2022

A C/S Tool to Download Torrent Remotely and Retrieve Files Back Over HTTP at Full Speed without ISP Torrent Limitation.

remote-torrent Download Torrent Remotely and Retrieve Files Over HTTP at Full Speed without ISP Torrent Limitation. This repository is an extension to

Sep 30, 2022

Full-featured BitTorrent client package and utilities

torrent This repository implements BitTorrent-related packages and command-line utilities in Go. The emphasis is on use as a library from other projec

Jan 2, 2023

SOCKS Protocol Version 5 Library in Go. Full TCP/UDP and IPv4/IPv6 support

socks5 中文 SOCKS Protocol Version 5 Library. Full TCP/UDP and IPv4/IPv6 support. Goals: KISS, less is more, small API, code is like the original protoc

Jan 8, 2023

Wrapper around bufcli to make it do cross-repo compiles for private repos and use full paths.

Wrapper around bufcli to make it do cross-repo compiles for private repos and use full paths.

Bufme A tool for compiling protos with full directory paths and cross repo compiles. Introduction Protocol buffers rock, but protoc should die in a fi

Feb 5, 2022
Comments
  • Bug bounty - EthAtl hackathon

    Bug bounty - EthAtl hackathon

    Fixes a few bugs:

    • Use config.json file instead of trying to search for non-existent node.json
    • Add PROVIDE_ACCESS_TOKEN to environment variables
      • Gets passed in initializing command
      • Value set to "access token" that is returned in prvd api_tokens init
      • Added instruction in README
  • 5$ Wrench Attack

    5$ Wrench Attack

    image

    If a node operator is required to stake a minimum amount of tokens to run a validator, then that individual or corporation should take care to keep their private keys safe from extortion. What could be $100K stake today, could be worth $1M or more in the future.

    Possible suggestions:

    No KYC. Node operators be advised to keep their anonymity. Multi-signatures and/or time locks. Abandon minimum staking, and switch to a community elected model.

🌌 A libp2p DHT crawler that gathers information about running nodes in the network.
🌌 A libp2p DHT crawler that gathers information about running nodes in the network.

A libp2p DHT crawler that gathers information about running nodes in the network. The crawler runs every 30 minutes by connecting to the standard DHT bootstrap nodes and then recursively following all entries in the k-buckets until all peers have been visited.

Dec 27, 2022
The seed repository for your Flamego middleware modules

seed This repository contains seed files that almost every repository of Flamego middleware module should have. Using the content Create an empty repo

Dec 11, 2021
A base library defines interfaces and modules of aBFT Lachesis consensus protocol

Lachesis base A base library defines interfaces and modules of aBFT Lachesis consensus protocol. Part of galaxy' s Consensus-as-a-Service for distribu

Oct 25, 2021
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.

LWN Simulator A LoRaWAN nodes' simulator to simulate a LoRaWAN Network. Table of Contents General Info Requirements Installation General Info LWN Simu

Nov 20, 2022
EVM-compatible chain secured by the Lachesis consensus algorithm

ICICB galaxy EVM-compatible chain secured by the Lachesis consensus algorithm. Building the source Building galaxy requires both a Go (version 1.14 or

Jan 8, 2022
A research implementation of team rocket's leaderless consensus protocol

rocket A research implementation of team rocket's leaderless consensus protocol backlog Run consensus tests with agents that have corrupted configurat

Feb 1, 2022
Validator node for Bittorrent Chain Network

Delivery Validator node for Bittorrent Chain Network. It uses peppermint, customized Tendermint. Install from source Make sure your have go1.11+ alrea

Dec 14, 2021
Validator for your Traefik Proxy configuration
Validator for your Traefik Proxy configuration

Traefik Config Validator Note This is currently pre-release software. traefik-config-validator is a CLI tool to (syntactically) validate your Traefik

Nov 8, 2022
LNC is a lightning network capital management tool built for routing nodes.

LNC is a lightning network capital management tool built for routing nodes.

Dec 21, 2021
Go library providing an abstraction to Ethereum execution nodes

go-execution-client Go library providing an abstraction to Ethereum execution nodes. Its external API follows the official Ethereum consensus APIs spe

Aug 12, 2022