The blockchain is a distributed ledger that stores transactions between trustless parties, and evolved to supports Turing-complete applications called smart contracts. However, it is not adequate to execute a computation-heavy code. With heavy computation, blockchains could experience Verifier’s Dilemma, block computation limit, high transaction fee, or TPS decrease. These issues prevent blockchain to enable complex technologies such as zero-knowledge proof, formal verification of smart contracts. Since those problems are originated in a native feature of blockchain system executing transactions in all nodes, on-chain solutions are hard to mitigate them. In this study, a proof of concept for a new execution model for computation-heavy contracts is proposed. The execution model adopted an Intel SGX chip for off-chain execution, and Outsourcing contracts for on-chain verification of the execution. The execution model on Ethereum shows almost uniform gas consumption and on-chain execution time regardless of the complexity of contracts. The proposed execution model not only enables computation-heavy contracts on a blockchain, but also prevents TPS decrease of blockchain network.
블록체인은 신뢰가 존재하지 않는 집단 사이에서 분산 장부를 저장할 수 있는 기술이며, 이는 스마트 컨트랙트라 불리우는 튜링 완전한 어플리케이션을 실행 시킬 수도 있도록 진화되었다. 그러나, 블록체인은 고연산 코드를 실행시키기에는 적합하지 않다. 고연산이 필요한 작업에 대해서 블록체인은 검증자의 딜레마, 블록 연산량 제한, 높은 트랜잭션 처리 비용, 초당 트랜잭션 처리량 감소 등의 문제를 겪을 수 있다. 이러한 문제들은 블록체인이 영지식 증명이나 스마트 컨트랙트 형식 검증과 같은 복잡한 기능을 가지는 것을 제한한다. 이는 모든 노드들이 동일한 트랜잭션을 처리하는 블록체인의 본질적인 요소에서 발생하는 문제이기에 온체인의 기술로 문제를 해결하기 어렵다. 이 연구에서는 고연산 스마트 컨트랙트를 위한 새로운 실행 모델의 개념증명을 보였다. 그 실행모델은 오프체인 실행을 위해 신뢰실행환경을 제공하는 인텔의 칩을 적용하였으며, 온체인에서 아웃소싱 컨트랙트를 통해 오프체인 실행을 검증한다. 이더리움에 적용된 이 모델은 스마트 컨트랙트의 복잡도와 상관없이 가스 소모량과 온체인 실행 시간을 거의 일정하게 유지하였다. 제시된 새 실행 모델은 고연산 컨트랙트를 블록체인에서 사용가능하게 할 뿐만 아니라 블록체인 네트워크의 초당 트랜잭션 처리량 감소를 막는 역할로서 작용할 수 있다.