Etherplan Coin (EPC): A Multichain Mineable Token – First, Second, and Third Iterations


This is part of a series of articles that explain Etherplan Coin (EPC):

• Etherplan Coin (EPC): A Multichain Mineable Token – First, Second, and Third Iterations – 

• Etherplan Coin (EPC): A Multichain Mineable Token – Fourth Iteration – 

• Etherplan Coin (EPC): A Multichain Mineable Token – Fifth and Sixth Iterations – 

• Etherplan Coin (EPC): A Multichain Mineable Token – Seventh Iteration – 


Etherplan Coin (EPC).
Etherplan Coin (EPC) proof of work miner network, blocks, ERC20 smart contracts in multiple EVM chains, and the EPC wallet.

Etherplan Coin (EPC) is a mineable token that may be transferred between Ethereum Virtual Machine (EVM) blockchains without depending on multi-signature schemes or trusted third parties and may be held off chain when in transit between chains.

It is a multichain coin as it is mined by an Etherplan proof of work miner network and may move between EPC ERC20 smart contracts hosted on Ethereum compatible blockchains such as Ethereum, Cardano, Polkadot, BNB, Tezos, Cosmos, and others.

Below are the first three iterations of the idea. I will post in this website any new iterations in the near future as the design evolves.

First Iteration

1. An independent network of Etherplan EPC miner nodes performs a proof of work, based on a puzzle, to mint 10 new coins every 15 seconds perpetually (no fancy monetary policy for this example, but the supply schedule may be fine tuned before launch).

2. Each time a miner creates a block it sends it to identical Etherplan smart contracts at several EVM compatible chains, say the top 10 chains (Ethereum, Cardano, Polkadot, BNB, VeChain, Cosmos, Avalanche, EOS, TRON, and Tezos).

3. These smart contracts in these chains receive the block, verify that it was built based on the rules and post the 10 new EPC to the account of the winning miner (the miner can send a new coinbase for each block as usual).

4. Although the miner sent the block to all contracts on all chains, by default the coins will be booked only in one of them, say Ethereum (the miner may select that when he sends the block).

5. However, all smart contracts are aware that such coins exist in one of the chains.

6. As long as the coins are moved, traded, and transferred within the chain where they were posted they are entered as usual as ERC20 transactions in that chain; ETH in this case.

7. However, there is a special transaction that may be sent to these contracts which is a withdrawal from that chain.

8. When this happens the smart contract debits the coins from its balance, in the ETH chain in this case, and generates a certificate (like when crusaders went to Jerusalem with certificates from Europe to get some money there) that the person withdrawing can get and resend to another Etherplan equivalent smart contract in another chain; say, Cardano.

9. When the Etherplan smart contract in the Cardano chain gets the certificate, it generates and deposits the coins that were withdrawn from the ETH chain into the account of the user (all account formats are the same in all EVM chains) and now they can be used in the Cardano chain as ERC20 transfers, etc.

10. No matter where the coins are (in ETH, Cardano, Polkadot, etc.), the global stock is the same. When coins are removed from one chain they are deposited in the same amount in another.

Summary

The EPC miner nodes only mine and send blocks to all Etherplan ERC20 smart contracts so that they verify them and keep track of the chain of solved puzzles and the stock of coins in the aggregate of the system. All coins are transferable between chains as the Etherplan smart contracts can receive withdrawal transactions (it’s like a burn of coins in that chain) and deposit certificates (they just create whatever amount is deposited in their state in their local chain).

Second Iteration

Mining is largely a one way communications system, there is no communication or bridges between components (except within the miner network), and users do not trust third parties to move funds. EPC tokens are held in ERC20 smart contracts in the selected EVM chains.

While EPC tokens are in transit between smart contracts (smartKs) between the different chains, they are held by users as certificates in their EPC wallets or any secure form or device as they would use to hold their private keys. These certificates are like signed transactions that have not yet been sent to a chain.

The custody of coins in transit and the movement between smartKs in the different chains is the responsibility of the user. Very much like when a crusader lost a certificate when he got to Jerusalem he would be pretty much fried.

The only problem to solve I see for now is how to issue blocks to multiple smartKs in multiple chains, and withdrawal and deposit certificates to multiple smartKs in multiple chains, so that EPC tokens are not forged and duplicated outside of the real supply. This is addressed in sections B and C below.

So, I will explain what are the components (only some are nodes) of the EPC system in section A below, and in sections B  and what are the risks and possible solutions.

A. Components

1. EPC Miners

These are EPC nodes external to the EVM chains, and, based on a certain adjustable difficulty level, only mine the hash of the previous block, plus a timestamp, plus a nonce. They do not process, verify, and mine transactions nor they serve as a communications channel between chains. They run the EPC client that only mines, sends the blocks to other miners so they can build and keep track of the chain, and sends the blocks to the EPC smart contracts (smartKs) on the chains so they can keep track of the chain and book the rewards per block as EPC tokens as per the monetary policy.

2. EPC Smart Contracts

These are ERC20 smartKs on each EVM chain that is selected to be part of the system. They receive blocks from EPC miners, verify them, and issue the rewards to the accounts of the miners who found them. The rewards cannot be issued in all chains, so each block has an instruction as to in what chain to issue the reward, and it is issued only in that smartK in that chain. All the other smartKs in the other chains only add the block to their state and are aware of the total issued supply of EPC tokens based on their local chains. These smartKs function as regular ERC20 contracts and can transfer EPC between accounts within the same chain as usual. They can also receive withdrawal transactions where they burn the amount of tokens that are withdrawn and issue a withdrawal certificate to the user who is doing the withdrawal. They can also receive deposit certificates from users where they issue the EPC being deposited by them. These smartKs have no communications with anything else other than miners who send blocks, users who transfer EPC within the same smartK within the same chain, and users who withdraw and deposit EPC from and to that smartK from and to that chain.

3. EPC Users

Users are people who own EPC tokens with their private keys. They have the EPC wallet that is used to:

a) transfer EPC tokens as regular ERC20 tokens within the same EPC smartK within the same chain,
b) withdraw EPC tokens from an EPC smartK in a chain as a withdrawal transaction that issues a withdrawal certificate,
c) hold EPC tokens in transit between smartKs in the different chains as withdrawal certificates while they are not being sent as deposit certificates to any other chain, and
d) deposit EPC tokens to an EPC smartK in any chains as a deposit transaction of a deposit certificate.

4. EPC Chain

It is a regular blockchain that is stored by miners and smartKs in the different EVM chains to be able to verify new blocks and for miners to know what is the longest chain so they can work on the next block. The POW chain serves as a way to prevent forging of the chain, to give unforgeable costliness to the EPC tokens, and to give them a reference for their value in the economy. It also serves as a Nakamoto consensus mechanism between the miners as they have to know the longest chain, but it DOES NOT serve as the consensus mechanism as to transaction ordering or history in all the chains as that is delegated to the local EVM chains where the smartKs are hosted. POW also does not serve as the communications system between smartKs in the different EVM chains as these only receive blocks, issue rewards, and process withdrawal and deposit certificates as long as their transaction formats are correct.

5. EPC Token Supply

For now it is set at 10 EPC per block perpetually, but it can be changed to optimize it, but it will be fixed once the system is launched. In any case, the global supply is only one and all miners, smartKs in all chains, and users must know that there is only one unique stock of EPC and that they are not forgeable.

6. EPC Client

This is a mining client and wallet for full node operators, but it largely mines and mints EPC tokens to be booked in the smartKs in the chains.

7. EPC Wallet

This is a wallet for users to move EPC ERC20 tokens like a regular wallet, but may also send signed withdrawal and deposit transactions to the smartKs in the different chains. The withdrawal and deposit transactions actually erase and issue tokens in the smartKs in the different chains without modifying the global supply of EPC. The wallet receives a withdrawal certificate from the smartK in a chain where EPC are being withdrawn. This withdrawal certificate may be held in the wallet or other means for whatever time the user wishes. The withdrawal certificate may be signed in the wallet with a private key which turns it into a deposit certificate. The deposit certificate may be then sent to a smartK in any of the EVM chains as an EPC deposit transaction. Then, the smartK will issue the tokens in that chain. Deposit certificates may also be held by the user if he wishes and sent at any time (see below risks about this).

8. EPC Withdrawal TX and Withdrawal Certificate

When a user sends a withdrawal TX to a smartK in the system in any chain, the smartK will burn the withdrawn EPC in its state in its local chain and issue a withdrawal certificate to the account that made the withdrawal. This withdrawal certificate is received and held by the user while in transit between chains. Although the certificate is public knowledge, it can only be used by the owner because it has to be signed with the private key to be turned into a deposit certificate to be sent as a deposit transaction to another smartK in the system in any of the EVM chains.

9. EPC Deposit TX and Deposit Certificate

When a user holds a withdrawal certificate in transit he can sign it with his private key to turn it into a deposit certificate. Once signed, he can send it to the EPC smartK in the chain he wishes to deposit it to. Once a smartK receives a deposit TX, it will issue the corresponding EPC to the account who sent it in the local chain. A deposit certificate may be held in transit, but it seems risky as it is signed and ready for deposit by anyone who holds it.

10. Certificate In Transit

When a user gets a withdrawal certificate from a smartK in any chain, he can just hold it indefinitely. This means the EPC coins are not in the smartK of origin nor in any other destination smartK in any chain. They are just held as a number in the withdrawal certificate in possession of the user. The withdrawal certificate cannot be used if given to someone else or stolen because it is not signed with the private key of the owner. When a withdrawal certificate is signed by the owner, then it may be given to others or stolen and used. Certificates in transit are useful when users want to get out of a chain and just hold on to EPC coins. They can then be re-deposited in the same smartK or chain or used to deposit in any other smartK or chain in the EPC system.

B. The Supply Problem

1. When miners send blocks to the smartKs in the different EVM chains, they could send an instruction to all of them to issue the 10 EPC reward. This would issue EPC tokens in excess of the supply policy.

2. When users send deposit transactions after withdrawing from a smartK, they could send them to multiple smartKs in multiple chains multiplying their holdings.

C. Possible Solutions

1. Zcash and Mimble Wimble (GRIN) work with a sort of “optimistic” supply verification system where as long as all transactions are formed according to the protocol they assume there is no excess supply. However, they have no way of auditing this as all data is secret.

In the Etherplan Coin EPC system, the same seems to happen: As long as all transactions are formed correctly, all miner nodes and smartKs could assume that there is no excess supply.

The good thing is that this can be audited subjectively by running a script that counts all the balances in all the smartKs in all the chains. This means that the miner or user who multiplied his coins may be detected, which means that, at least, it may be known whether the system has been breached.

2. The miners could be monitoring all the supply in all the smartKs in all the chains using this script and when they detect a breach they could send a “burn” transaction type to neutralize the multiplied coins.

3. A cryptographic system of sending new blocks and deposit transactions where no duplication in multiple smartKs in multiple chains is possible must be invented…. :0)

4. A communications and verification system between all the components may be used (Flyclient + SHA 3 in the EPC nodes?), but this would probably make the system very heavy and costly (I like that users can just hold their coins and they run the risk of that part of the system).

5. Another possible solution may be that, as miners with blocks, each time a users sends a TX they send it to all smartKs in all chains so they can see that it was deposited only in one of them (but this is costly and users could still lie to all components, I think).

Third Iteration

I made the design below that I think closes all the loopholes, so coins cannot be multiplied while permitting the free transfer of EPC tokens between EPC ERC20 smartKs in the different chains. I don’t think any new fancy cryptography, other than FlyClient coupled with SVP, is needed.

Now, the EPC wallets are used by EPC owners to send normal ERC20 transactions to the different chains, to make withdrawals (where the coins withdrawn are moved to a local pending burn pool), but the deposit certificates are sent in the form of deposit transactions to the EPC miners, instead of to other smartKs in other EVM chains directly. The EPC miners then process and send these deposit transactions to the different EPC smartKs in the different chains inside the blocks as part of the general state transition of the system.

The Model

Diagram of the Etherplan Coin (EPC) model.
Diagram of the Etherplan Coin (EPC) model.

Explanation

1. EPC Miner Network

Is the miner network as described before. They keep track of the global supply stock, process transfers between the chains that are sent as deposit transactions by user wallets, and send the blocks with the state transitions to all the smartKs in all chains. To prevent forgery and multiplication of coins by miners, the blocks and state transitions are sent to the smatKs in the different chains only after they are verified and consensus was achieved by all miner nodes over the current block and state transition being sent. (Note now the block header has 6 components again as the EPC miner chain now has to process deposit/transfer transactions from user wallets.)

2. EPC Block

As said in the previous point, the blocks are sent from the EPC proof of work (POW) miner network to all the smartKs on all chains. They are sent after consensus was achieved by all miner nodes. The blocks include the miner reward, the choice as to on which network to book the reward, and any transfers by users between chains. This state transition information will be received by all smartKs in all chains; the deposit of the miner reward with fees will be made in the chain of choice by the miner; and the EPC transfers between the smartKs in the different chains will be finalized where the receiving smartK will make the new deposit in the local chain by issuing the coins, and the sending smartK will complete the burn of coins of that deposit from the pending burn pool in its local chain.

3. EPC Smart Contracts in the Different Chains

These will receive from wallets local transactions that will be processed as regular internal ERC20 transactions. They will also receive from wallets withdrawal transactions which will move the funds to the local pending burn pool. When withdrawal transactions are processed and funds moved to the pending burn pool, the smartKs will issue a withdrawal certificate and send it to the user’s wallet. SmartKs in the different chains will also receive the blocks with the state transitions from the EPC miner network. When this happens, they will verify that the state transition is done according to the rules, deposit the miner rewards and fees in the chosen chain, and issue or burn the coins that are transferred between chains. By doing all this, their local supply stock should emerge and should reconcile with their share or number shown in the global supply stock sent by the miner network.

4. EPC Wallet

The EPC wallet is used to send regular ERC20 transactions to the EPC smartKs in all chains, send withdrawal transactions to the same smartKs where the coins withdrawn are moved to a local pending burn pool, receive the withdrawal certificates issued by the smartKs, sign the withdrawal certificates into deposit certificates, and, when the user wishes, send the deposit certificates as deposit transactions to the miner pool (which results in EPC transfers between chains). When deposit transactions are sent to miners, a fee in EPC may be added to make sure miners are motivated to include them in the next block.

If the blocks can be pushed in the way described above to all smartKs in all EVM chains I think I have closed all the loopholes and I don’t think coins may be multiplied either by miners when sending their rewards and fees, or users when sending deposit transactions that result in EPC transfers between chains.


Code Is Law

Author: Donald McIntyre

Read about me here.