voltairelabs / plasma

Ethereum plasma implementation
MIT License
49 stars 14 forks source link

Investigate support for ERC20 tokens #15

Open federicobond opened 6 years ago

shogochiai commented 6 years ago

What is this token for? Deposited ETH on Plasma chain? So the PlasmaETH will be ERC-20 token? I wanna know some underlying discussion.

jdkanani commented 6 years ago

Current implementation - master branch - supports ETH. You deposit ETH and use PlasmaCoin as ETH on plasma chain.

This pull request #17 implements token ERC20 instead of ETH. You can deposit defined token (check constructor argument which defines main chain's token address https://github.com/jdkanani/plasma/blob/c189d9808763abe69067277c66dab55b66187c4f/contracts/RootChain.sol#L82) and PlasmaCoin will represent that token on plasma chain.

shogochiai commented 6 years ago

Okay so on master, both deposit and PlasmaCoin are ETH. On PR #17, deposit is ETH and PlasmaCoin is "PlasmaWP-mentioned block withholding attack desincentivizing token".

So this ERC-20 token must be used for transaction fee, and PoS validation reward, right?

federicobond commented 6 years ago

With #17 you can deposit tokens from an ERC-20 compatible token contract defined in the RootChain constructor a get a UTXO for that token in the Plasma chain.

shogochiai commented 6 years ago

Deposit is gonna be arbitrary ERC-20 token, PlasmaCoin will represent that Plasma chain's token, okay.

And this PlasmaCoin will be re-implemented on each child Plasma chain, but this repo is gonna be template/framework for building offspring chains, hence no need to reinvent wheel, right?

federicobond commented 6 years ago

That's right, a new contract instance must be deployed for each token you want to support.

shogochiai commented 6 years ago

The rootchain is expensive, hence for example nth-depth PlasmaChain's PlasmaCoin(ERC-20 based) is not able to be processed & defined on the rootchain contract.

Then I guestimated that (n-1)th PlasmaChain might have an ability to define Plasma contract for nth PlasmaChain, and this PlasmaCoin is not defined on the rootchain.

For enabling that, this repo must have EVM to define&process PlasmaContract, rather thab on the rootchain PlasmaContract. CMIIW.