Boring into Burrow

Hyperledger Global Forum - 3-6 March 2020
Silas Davis - Burrow maintainer - Monax CTO

Hello – I'm Silas 👋

  • Burrow maintainer
  • CTO of Monax
  • Former TSC member

The next thirty minutes of your life

  • Burrow is boring (in a good way)
  • Burrow is pragmatic
  • Burrow is just enough

The next thirty minutes of your life

  1. Burrow the Embeddable
  2. Burrow the Sidechain
  3. Burrow the Cosmonaut

What is Burrow?

  • Smart contract execution engine
  • Full DLT 'framework'
  • Quite old

What's in the box

  • Tendermint consensus
  • EVM and WASM support
  • On-chain governance
  • Nice tooling

What do we want to be?

  • Boring
  • Simple
  • Fast

Boring

  • Predictable
  • No pluggable consensus
  • No pluggable execution engines
  • No killer feature
  • Novelty is in composition

Simple

  • Single binary
  • Single codebase
  • Easy to understand
  • Easy to operate
  • Burrow likes to borrow
  • Essentials included

Fast

  • Run fast enough
  • Fails fast (and safe)
  • Quick to change

The Redis of blockchain

Burrow aims to be simple, complete, opinionated, and lightweight.

Where did Burrow come from?

  • Ethereum was interesting but early
  • Nothing like it existed so we built it (Eris DB)
  • First permissioned blockchain to market
  • Tendermint was extracted from Eris DB
  • Eris DB became Hyperledger Burrow

Why does Burrow still exist?

To provide a shared data and process layer for:

  • The Monax Platform
  • The Agreements Network
  • Various permissioned marketplaces

Why should Burrow exist?

  • To help bridge the public/private network divide
  • Provide on-chain Business Process execution
  • The Hyperledger gateway to Cosmos
  • Ad-hoc state channels (offline blockchain?)

Part 1/3

Burrow the Embeddable

Burrow includes a hackable EVM/WASM smart contract execution engine

type Executor interface {
	Execute(txEnv *txs.Envelope) (*exec.TxExecution, error)
}

type Callable interface {
	Call(state State, params CallParams) (output []byte, err error)
}

type Dispatcher interface {
	Dispatch(acc *acm.Account) Callable
}

Construct your own chamber

Clear division of labour:

  • Tendemint for consensus
  • IAVL for state
  • Our EVM
  • Perlin's Life WASM engine
  • Extendable kernel
  • Extendable RPC layer

(relative) Simplicity

  • We are ~100,000 lines of Go
  • Go-ethereum is ~400,000 lines of Go and 20,000 lines of C
  • Not being constrained by the public Ethereum is an advantage
Go-ethereum - courtesy of scc code summariser
──────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
JSON                     35402  12553821    17139         0 12536682          0
Go                         903    384512    23780     37702   323030      34408
YAML                       152     13547      203       142    13202          0
C Header                    54     10900     1052      2102     7746        858
JavaScript                  35     14721     1779      4780     8162        925
Markdown                    33      4023      918         0     3105          0
C                           14      7020      665       506     5849       1159
───────────────────────────────────────────────────────────────────────────────
Total                    36667  12996958    46711     45837 12904410      37489
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop $559,590,569
Estimated Schedule Effort 169.856247 months
Estimated People Required 390.250543
───────────────────────────────────────────────────────────────────────────────
Burrow - courtesy of scc code summariser
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
Go                         528     99258    10256      5332    83670      15142
Markdown                    97      4083     1094         0     2989          0
YAML                        68      4199      685        93     3421          0
JavaScript                  40      2396      398       278     1720        119
Protocol Buffers            28      2945      481       938     1526          0
Shell                       16       807      161       163      483         69
JSON                        13      6979        0         0     6979          0
───────────────────────────────────────────────────────────────────────────────
Total                      805    121361    13198      6922   101241      15340
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop $3,445,240
Estimated Schedule Effort 24.549023 months
Estimated People Required 16.624172
───────────────────────────────────────────────────────────────────────────────

Batteries included

Burrow CLI

  • Run directly on your host OS (no containers required)
  • burrow spec and burrow configure
$ burrow spec -v1 | burrow configure -s- | burrow start -c-
  • Forensics with burrow explore
  • Deployment and testing with burrow deploy and burrow tx

Javascript/Typescript client

  • Burrow.js (now with added Typescript)
  • Solidity type generation
  • Contract interface

RPC layers

  • GRPC and Protobuf everywhere
  • Transact, ExecutionEvents, Names, Query, Keys
  • Ready-only HTTP for administration
  • Web3 JSON RPC

SQL mapping layer –Vent

[
  {
     "TableName": "EventTest",
     "Filter": "EventType = 'LogEvent'",
     "FieldMappings": [
         {
            "Field": "key",
            "ColumnName": "testkey",
            "Type": "bytes32",
            "Primary": true
         }
     ]
  }
]

Dump/restore

Extract the state from one chain and paste it onto a new one

  • Upgrades
  • Hack state
  • Backups and ETL
  • Forks
  • Redaction

Dump/restore

Usage:

$ burrow dump remote --height=1337 > dump.json

$ burrow configure -m BurrowTestRestoreNode \
  -n "Restored Chain" \
  -g genesis-original.json \
  -w genesis.json \
  --restore-dump dump.json > burrow.toml

$ burrow restore dump.json

$ burrow start

Part 2/3

Burrow the Sidechain

Sidechain?

  • State stored somewhere else
  • Track and prove
  • Extrinsic incentives

Scale invariance

From the small to the large:

  • Burrow-in-a-box
  • Private cloud (crypto-Zookeeper)
  • Layer 2 scaling
  • Public proof-of-stake networks
  • Multi-chain world (e.g. Part 3 spoiler: Cosmos...)

Shared data

  • Model shared data as public data
  • Observability
  • Even if private

Governance

  • Bonding to validate
  • Proposals to change system
  • GovTx for admin
  • IdentifyTx for network bootstrap

On-chain ABI service

  • Helps Burrow be self-contained
  • Code generation
  • Much friendly calling an introspection

Keys service

  • Burrow can act as a user delegate
  • Supports traditional web app & API
  • Simple local wallet

Part 3/3

Burrow the Cosmonaut

What is Cosmos?

  • Internet of blockhains
  • Hierarchical proofs
  • Only pay for interactions you care about
  • Only price for interactions you care about

Build your own Cosmos Zone

  • Cosmos is happening
  • Burrow will support it
  • Burrow will actually be ready for it

Inter-Blockchain Communication Protocol (IBC)

In conclusion

  • We are boring, but we are also interesting
  • We are utilitarian
  • We are ambivalent
  • We have what it takes to deploy a practical blockchain

Join us!

  • You can help us
  • You should help us
  • You will help us

Or else...

Questions?

Want moar Burrow?

Wed 3:00 pm: Burrow and Solang
Fri 2:30 pm: Burrow Workshop

Contact
See also

## Points: I also want this to tie together my three approximate threads: 1. Hackable Solidity/WASM/EVM execution engine (I don't want to make this the main thrust) 2. Burrow in the multi-chain world: side-chain/burrow-in-a-box/public permissioned/personal node (c.f. Studio) 3. Burrow - Build your own Cosmos Zone Outline Intro: 3 minute Point 1: 7 minutes Point 2: 7 minutes Point 3: 7 minutes Conclusion: 4 minutes Plea: 2 minutes (signpost other talks) Questions: remaining time Total: 30 minutes (40 minutes) allocated With speakers notes this document probably needs to be 3500-4000 words for 100 words/minute.

Hello I my name is Silas, I am the longest-standing maintainer of Hyperledger Burrow, the CTO of Monax, and an erstwhile Hyperledger Technical Steering Committee member. ### Interests - Dancing - Cheap wine - Blockchains

*I will describe Burrow and attempt to convince you that:*

- Embeddable, what we are most known, for but not the first thing we think of when we think of burrow - Sidechain: about how Burrow relates to, and is companion to 'state elsewhere' - Cosmos: How Burrow is exceptionally well placed to be Hyperledger's gateway to the Cosmos ecosystem *By considering the three characters of Burrow:*

A few different ways into that: - The oldest Hyperledger codebase of which nobody has heard. - Burrow and Tendermint have eris-db as a common ancestor - they used to be a single codebase - Tendermint a PBFT-style with a novel linear view-change - Tooling: that tooling is mostly lovely

- They are all problematic - Even more boring than Git is stupid. - The kind of boring that lets you sleep well at night.

- Predictable: - pure go binary performance which is easily profiled - consensus mechanism with no leader election - fully deterministic execution - complete rollback-version history and built-in forensics tooling when things go wrong - No killer feature: - We don't have fully-homomorphic steganographic meta-consensus, but we do have nice logs - No single gimmick - No great novelty in the individual pieces we have - But the combination and orchestration is - An EVM with permissions - Go native functions that can be called from WASM and EVM - Fine-grained event stream stored in an immutable trie - Ed25519 and secp256k1 support

- Simple is a cursed description - rarely does software set out to be 'complex and slow' - so simple can be weasel-word - Easy to understand: well-structured commented code, discoverable - Easy to operate: logging, metrics, and kubernetes support - Needed features: if a feature is needed in wild to make useful, we take an opinion, and include it - Burrow likes to borrow: And we shirk responsibility for those features... 'get someone else to do it'

- fast enough, i.e. fairly slow -D - lots of room for improvement and we will - we are not the scaling bottleneck - Vent helps the scaling target (c.f. Vent / RDMS) - BFT/Tendermint favours just exploding rather than getting it wrong. - Rollback mechanism if anything is corrupted

My hackneyed phrase aiming to encapsulate these ideas and bask in the reflected glory of redic

- Casey, Preston, and Tyler and decentralised video sharing use-case for a competition - Tendermint and Burrow shared growing pains and both stronger because of it. integration runs deep

- We appear to have small cannabis market following - Legal tech and cannabis - Pleasing combo - Please come and talk to me if you use Burrow

These ideas are looking to the future, but we have significant support in these directions already - The Hyperledger community could benefit by exploiting the public chain ecosystem - To track and prove state across different chains - There should be more interest than there is - Cosmos: internet of blockchains, see part 3 - Most of 'blockchain' is in git already - burrow can operate in a mode like a git repo - join a network and synchronise - core use-case, legal agreements, the abiility to use the same structures in different contextx - privately transact privately amongst counterparties is compelling. - A hop skip and jump away from flexible ad-hoc state channels - just `burrow init`

Point 1

- Using interfaces is not something of which to be excessively proud, - Much pain over there years has wrought solid engineering boundaries - Our split from Tendermint and our love of Borrowing/reuse, as well as being a good dependency for other projects means we care about thsi

You can extend what we have in interesting ways - Kernel: export our functions (unlike go-eth that is not trying to be embedded - You could run us in other context - e.g. DB backend - We use our own embeddability to provide no-consensus mode

- This is an admittedly crude way to compare - but code is our biggest liability so I am going to do anyway

- Note does not include dependencies for either project - Not an apples to apples comparison etc - BUT STILL...

It's boring, but no containers needed - Specify and configure a chain from the comfort of your commandline - multi-chain support - debug, introspect

- GRPC: use from any language - robust transport layer - Protobuf: high level abstract interface and commitments as well as efficient binary protocol - Names: Burrows DNS - Execution events: powers may features and ways of thinking about things incuding vent

- Vent with burrow.js, vent helper, synchronisation, single system illusion - This gives you query-side scaling - Ability to run traditional databse and blockchain togethe

The chief motivator for this functionality is given we that our state must have bit-perfect alignment. How do we move fast and break things? Our pragmatic answer is to implement `git rebase` for blockchains. Sacrilege!? Kind of... We actually form a chain-of-chains via an AppHash (state root hash) in the genesis of the new chain poiting to the old chain at the fork height - Upgrades: e.g. improve binary format, improve storage space, fix bugs - Backups: a quickly addressable backup in a manipulatable protobuf/JSON format - also useful for data mining and import purposes - Forks: perhaps some participants of a network would like to run a fork not including some transaction this provides a mechanism for starting a new instance with the state at some height - We also have plans to allow forks to be orchestrated via our on-chain governance primitives (see later!) - Redaction: Sometimes the law requires we remove some information - perhaps our blockchain/other system data split needs to change. This gives us a mechanism

Point 2

- Elsewhere: database, other chain, blob store - Prove: data may not be stored but proof of interactions (e.g. acceptance, approval, consent, signature) in database, mainnet, etc may be - Extrinsic: a bond that can be slashed, need to cooperate, etc

Scale invariance: a common runtime between these allows you to track and prove state across other systems - Agreements and process repository, put it on a thumb drive - Cloud: etcd alternative, BFT? why not? - File-based backend c.f. SQLlite - Staking e.g. delegated proof of stake, random elections

- This comes from our experience with legal agreements, we have our core interaction on chain - Shared data: model data users share as if it is public there are benefits: - Strong audit log - Less noise (billings, organisations, profile information) - Ready for public-network spin out

- Bonding - the ability to vote and become a validator - possible to only - Proposals allow accounts with the PROPOSAL permission to propose an alteration to the network. - GovTx is a transaction type that is often behind a proposal-wall with the ability to arbitrarily update an on-chain account. This is a 'Root' permission - you can grant it to no-one, or online let a smart contract have it. Flexibility for all kinds of networks - both moderated and permissionless - Burrow nodes need to have the BOND permission to act as a validator - A variety of bonded proof-of-stake and proof-of-authority networks can be built using this model. - We will be providing additional crypto-economic primitives

Very useful feature not found on other ethereum clients to my knowledge - Contract metadata can be found - What is deployed at this address?

Delgate: can sign on someone's behalf user proxy contract

Point 3

- IP routing analogy, escalate a transaction to hub-chain (really 'next chain up') when you need to get it somwehre - Track validator state, and provide light proof thing you care about happened somwhere. - See also: polkadot - Digression: EOS, VRF validator functions, Async (e.g. hashgraph)

- Support: IBC work + long-standing support of secp256k1/ed25519 for eth side-chaing - Ready: side-chain has been driving burrow development for a long time - Agreements Network and our tendermint history - A proven dapp framework to run on cosmos - SDK is interesting but more focussed on apps within zones and possibly overengineered for som euse cases

Thanks to one of our maintainers Greg Hill we have some early work on implementing some of this protocol

- Burrow packs a large number of features in a modest package - Burrow is boring (in a good way) - Utilitarian: we include features where there was a need, where you will need it in real life - Our features are wrenched painfully from compromise - Ambilavent: - public/private/cloud - ethereum/cosmos or other source of truth - synchronised full network or local repository - Proof-of-stake, proof-of-authority, benevolent dictator

- Can: documentation, EVM fixes, tooling, testing - Should: you might be sweating needlessly trying to _configure_ something else to do your will. - Just hack Burrow - Will: if that doesn't work, then maybe a threat will...

Wednesday, March 4 • 3:00pm - 3:15pm