存储计算范式探索：简析跨链支付协议 everPay 运行机制
Due to the scarce computing resources and a high fee, Bitcoin and Ethereum blockchains can hardly support everyday transactions. To solve this problem, everVision adopts a storage-based computation paradigm to build everPay, which is a trusted cross-chain payment and settlement protocol.
everPay locks the assets of other public blockchains into a smart contract and maps them to corresponding assets, which enables users to make transfers and payments on its protocol. everPay has a very low cost in reaching a consensus on transactions. For example, it only costs 0.05 US dollars to make thousands of transactions. Besides, everPay has no limit in TPS, which only depends on the application architecture of its protocol and server performance. As long as it conforms to the storage-based computation paradigm, the everPay protocol can scale “unlimitedly” to rival a traditional internet application.
Coordinators collect and verify transactions, and then package and add the valid ones onto the chain. They collect valid transactions from users with an API and put them into a serialized pending transaction pool. The pending transactions are packaged in batches and included on-chain every certain period of time. Coordinators generate a real-time global state according to both valid on-chain transactions and pending transactions.
Detectors download and verify on-chain data automatically to generate a global state and account balances. Detectors generate a state more slowly than coordinators because they only rely on on-chain data and do not count in pending transactions. Anyone can be a detector by downloading and running a detector program.
Watchmen are detectors that jointly manage assets. They can unlock assets with a multiSig or threshold signature scheme.
The everPay protocol currently supports two cross-chain solutions, i.e, MultiSig and Threshold Signature Scheme.
For the public blockchains that support smart contracts, everPay deploys a lockup contract with the MultiSig technology, and the keys are owned by different watchmen.
The everPay protocol listens for the asset transfer event and ensures that the transferred assets are mapped to corresponding assets after the transaction is confirmed.
When users send a transaction to burn assets, the transaction will be included onto a storage-oriented blockchain (Arweave) after it is verified. Watchmen listen for the events on the storage-oriented blockchain. When watchmen receive the burn transactions from the storage-oriented chain, they sign the validated transactions and send them to the corresponding public blockchains. After a burn transaction is signed by a certain number of asset managers, the original assets will be unlocked and returned to the user.
For the public blockchains that do not support smart contracts, everPay currently adopts the Threshold Signature technology, which is similar to MultiSig, to ensure the lockup of user assets.
The consensus of the everPay protocol is secured by a storage-based computation paradigm. In the paradigm, all the computing processes are completed off-chain, and the inputs from the application are stored on a blockchain. Coordinators, detectors and watchmen run the same business verification component. Anyone can download and run the detector program to load the blockchain data for checking transaction state. everPay packages all types of transactions, including mint/burn/transfer transactions, in the proper order and sends them to the storage-oriented blockchain. The third-party applications and individuals can check the transaction state with the detector program, which automatically downloads and verifies all the on-chain transaction records. If the states are respectively generated by a coordinator and a detector conflict, the application may have a risk of fraudulent consensus.
Resistance to malicious actors
Transactions are packaged in a serialized way into blocks, which are added onto the blockchain. Anyone who loads the transactions according to the packaging order generates the same state.
It makes no sense to include an invalid signature onto the blockchain. If an invalid signature is found, all the detectors will reject it.
Attack on Balance
Because all the transactions are executed in a serialized way, everPay is resistant to double-spend attacks. Besides, any transaction contains a nonce field to ensure its uniqueness, so as to resist replay attacks.
everPay only has a single coordinator to process transactions for now. What if the coordinator misbehaves? For example, when a user, who only owns 1 ETH, sends a transaction to transfer 2 ETH, the coordinator does not reject the transaction and includes it onto the blockchain. If any detector loads the serialized data from the blockchain and finds that the user only owns 1 ETH, they will reject the transaction. Hence, the invalid transaction will be found as soon as it is packaged and sent by the coordinator to the blockchain. Another case is that the coordinator allows the user to transfer 1 ETH twice in a row. The first transaction will be validated by a detector, turning the user’s account balance from 1 ETH to 0 ETH. But the second transaction will be rejected for the lack of funds in the user’s balance.
Take Ethereum as an example. everPay deploys a EthBot to listen for Ethereum events. When a user transfers some assets to the MultiSig smart contract, the EthBot will send a mint transaction to the everPay protocol after the transfer is confirmed in six blocks. Then the protocol will cryptographically verify the transfer and query an Ethereum node to ensure that the transfer is finalized with a minimum of 6 block confirmations. After the mint transaction is done, the transaction fingerprint will be labeled “minted” in the everPay protocol, so as to avoid repeated minting.
- Note: EthBot is not required and only designed for better user experience. Anyone can send a valid Ethereum transaction to the everPay protocol for minting.
When a user sends a burn transaction, the transaction will be packaged and added onto Arweave if it is validated by the everPay protocol. Watchmen who listen for Arweave events will verify the transaction and then send a multiSig transaction. Similarly, the Ethereum lockup contract will verify the transaction fingerprint to avoid the same transaction being repeatedly executed.
All the above processes can be checked by the detector program of the everPay protocol. Anyone can download the detector program and become a detector. Besides, everPay also provides an explorer for users to view and check transactions.
The consensus of everPay protocol is secured by a storage-oriented blockchain and checked by a detector program.
Easy to Use
Transactions are collected and included in batches onto the chain by coordinators in the proper order. In this way, the transactions can be processed off-chain in real time. It means the state of a coordinator’s ledger is updated in real time.
Hence, everPay enables users to make real-time transfers and make multiple transactions in a row. It brings a fast and convenient user experience as an Internet application.
In the edge cases where users have doubts about coordinators, they can track if their transactions are packaged and included onto the chain with the transaction explorer. Generally, coordinators package all the transactions into blocks according to a fixed order and add the blocks to the chain.
Unrestricted by Signature Algorithms
With the computation process moved off-chain, the storage-based computation paradigm supports arbitrary signature algorithms, which enables relatively flexible development. To be more specific, everPay can integrate more friendly internet signature algorithms, such as WebAuthn (R1), which totally removes key management (mnemonics) while ensuring security. In this case, users can sign their transactions in a secure and reliable way with a hardware device (e.g. a phone or computer).
everVision is dedicated to improving user experience, lowering the threshold for development and providing trusted decentralized financial applications for everyone. everPay is an easy-to-use blockchain-based solution and application protocol, which enables users to make payments and settlements in a reliable way and as efficiently as an internet application.
everVision website: https://ever.vision