Skip to content

ethanfrey/peggy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETGate

Send ethereum tokens to tendermint zones.

Usage

Start etgate

  1. Install golang, geth, and basecoin.
  2. go get this repository, and run glide update
  3. cd to cmd/etgate and go build.
  4. Run geth --testnet --fast on the other window and wait until sync is completed.
  5. Run ./init.sh
  6. Run ./etgate gate start --testnet --nodeaddr=tcp://localhost:12347

Deposit/Withdraw ethers

  1. cd to server/ and go build
  2. Run ./server
  3. Open http://localhost:12349 on your web browser
  4. Paste your deployed contract's address and name of the key(money)
  5. Type the amount of ethers you want to deposit and press Deposit
  6. Type the destination address, the amount of ethers, password of your tendermint account, and press Withdraw

Demo

Demo

Features

Deposit

Each time when users send deposit message to the contract, it will generate an event. The relayers, on the other hand, will consistently upload ethereum headers to the tendermint zone. Since an ethereum header contains the merkle root of the receipts, the events could be proven with proving merkle path. This scheme is called sidechaining. The zone will mint new coins right after the relayers uploaded the events.

Withdraw

NOTE: As merkleeyes uses ripemd160 instead of keccak-256, it is extremely expensive to prove data in a tendermint zone with solidity(nearly 0.1ether). For now, ETGate uses 2/3+ validator's multisig for each withdrawal to be validated.

The relayers also upload tendermint headers to the contract. The contract will confirm the header when 2/3+ validators signed. After the corresponding header is confirmed, the users can withdraw their tokens via submitting the necessary data(destination, value, etc) and its merkle proof. The contract will verify the proof, and release the tokens.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 92.8%
  • JavaScript 4.2%
  • HTML 2.5%
  • Shell 0.5%