Peggy Dev Update #4

Lets take a quick walk from Rinkeby to Peggy Testnet #1 and back.

Peggy Dev Update #4

We've made enormous progress on the Peggy bridge over the last few weeks. We set a goal to have the bridge production ready in January 2021 and we're on track to meet that incredible target.

Since our last update

Stargate upgrade complete

30 days and 96 commits later we finished migrating the Peggy module to Stargate.

Cosmos -> ETH batches functional

The Peggy system now correctly generates, signs, and relays batches of transactions for arbitrary ERC20 tokens to Ethereum.

Many many bug fixes

Using our fully automated all up testnets we run a small testnet on every code change. Advancing these tests has allowed us to patch subtle issues very very quickly.

But no amount of automated testing is a substitute for real production!

Peggy Testnet1

Our second Althea Peggy testnet is live now, with 13 validators live and still accepting more.

Lets take a quick walk from Rinkeby to Peggy Testnet #1 and back.

Download the Althea Peggy client and Cosmos blockchain software.

wget https://github.com/althea-net/peggy/releases/download/Testnet1/client
wget https://github.com/althea-net/peggy/releases/download/Testnet1/peggy 

Set them as executable.

chmod +x client peggy

Generate a Cosmos blockchain key, be sure to copy both the public address and the 24 word backup phrase, you'll need them soon.

./peggy keys add peggytest

Now let's send that address 1 ERC20 token From Rinekby to the Althea Peggy Cosmos test chain, this is a long command so you may want to edit it and then paste it into a terminal.

The provided Ethereum private key has some Rinkeby ETH on it and a few thousand Bitcoin MAXX a ERC20 token we deployed for testing. You are of course free to use any ERC20 deployed on Rinkeby.

RUST_LOG=info ./client eth-to-cosmos \
        --ethereum-key="0xb1bab011e03a9862664706fc3bbaa1b16651528e5f0e7fbfcbfdd8be302a13e7" \
        --ethereum-rpc="http://peggy-testnet1.althea.zone:8545" \
        --contract-address="0xB411f2158e70414921BEA40bC3001F89F6595F22"\
        --erc20-address="0x3A020A6A407d145de10De0367a767611F1652c06" \
        --amount=1000000000000000000 \
        --cosmos-destination="your cosmos address!"

Lets query our balance on the Cosmos chain and see those Peggy tokens! You may need to wait about 30-60 seconds for the deposit to process.

./peggy query bank balances <your cosmos address!> --node tcp://peggy-testnet1.althea.zone:26657

Congrats you now have some Bitcoin MAXX! Now let's send it back to Rinekby, generate an address with Metamask and make sure your Metamask network is set to Rinkeby.


RUST_LOG=info ./client cosmos-to-eth \
        --cosmos-phrase="The Peggy key phrase you saved earlier" \
        --cosmos-rpc="http://peggy-testnet1.althea.zone:1317"  \
        --fees="peggy/0x3A020A6A407d145de10De0367a767611F1652c06" \
        --erc20-address="0x3A020A6A407d145de10De0367a767611F1652c06" \
        --amount=900000000000000000 \
        --eth-destination="<your Metamask address>"

You should see your tokens in Metamask in about a minute. You can also view them in the ERC20 transactions section on Etherescan. Remember that ERC20 deposits are technically calls to a different contract so they don't show on the main view.

What's left before production?

Before Peggy is ready we need to complete a few more tasks:

Slashing

Slashing is at this point well planned out and mostly an implementation task. Proof submission for some conditions may be tricky to finish implementing.

Tests with full (100 transaction) batches

Althea Peggy batches transactions from Cosmos to Ethereum to save on gas. This brings the fee to cross the bridge all the way down to where it's equivalent to a simple ERC20 transaction cost on Ethereum.

Total system audit

An audit for the Solidity code has been completed, but an audit of the entire Peggy system must of course include the slashing implementation and is therefore waiting on that.

Moving forward

A big thanks to our partners at UniFi DAO for working with us on Peggy development!

Althea's goal is to launch our blockchain early next year using Peggy to help power real people using crypto to solve their every day problems.

Construction team and equipment for an off-grid internet relay in rural Oregon.