Scaling up zkSNARKS with Intel SGX for Proof-of-Transcoding
Tags: Cryptocurrency, Cryptography, Crypto, Blockchain

In order to meet the level of verification required for the VideoCoin Network, our development team has made a breakthrough to improve proof-of-transcoding with an integrated zkSNARKS and Intel’s Software Guard Extensions(Intel SGX) solution.

A few months back, we shared VideoCoin’s breakthrough advancements in using zkSNARKS for proof of video transcoding. Building on these advancements, our team has a newly implemented solution that enhances verification on-chain through the VideoCoin Network.

In the zkSNARKS based proof-of-transcode, the Worker(Transcode Miner), generates the zkSNARKS proof and submits to the VideoCoin Network. The zkSNARKS verification process requires checking of elliptic curve pairings(bilinear maps) which are compute-intensive tasks. The problem is the high usage of the CPU limits the number of verifications that can be performed, and this impacts performance.

We’re excited to share the new highly scalable solution based on Intel Software Guard Extensions(SGX) wherein a separate zkSNARKS verifier runs in SGX Enclave along with the Worker.

How Intel SGX and VideoCoin Network integration works

Intel SGX Enclave is a trusted execution environment embedded in a process that protects code and data from disclosure or modification. Enclaves are protected areas of execution. Application code can be put into an enclave via special instructions and software made available to developers via the Intel SGX SDK. SGX Enclaves are hardened by CPU-based security mechanisms. SGX Enclaves can also be remotely provisioned and attested. One part of physical memory(RAM) is reserved for enclaves. It is called Enclave Page Cache, or EPC. EPC memory is encrypted in the RAM.

When the Worker is running on a machine with SGX support, the VideoCoin Network enables the offloading of the verification computations to a program running in the SGX Enclave. A trusted attestation server, which is a form of Oracle running on the VideoCoin Network, establishes the chain-of-trust. The attestation server maintains a list of valid verifiers. It can detect any compromised nodes and remove them from the authorized verifiers.

Integration Overview of SGX-based Worker and the VideoCoin Network

Each remote SGX machine will have two accounts on the VideoCoin Network, one Worker account that performs work and receives rewards, and one Verifier account that runs in SGX Enclave to perform verifications.

The role of the Worker account is the same as current transcode miners in the VideoCoin Network.

The role of the Verifier account is similar to Verifier Oracles in the VideoCoin Network except the Verifier runs along with the Worker on the same machine.

The verifier running in the trusted enclave will be attested. View this white paper for more information on attestation: https://software.intel.com/en-us/articles/innovative-technology-for-cpu-based-attestation-and-sealing

After performing the transcoding of a chunk, the Worker generates zkSNARKS proof and submits to the Verifier running in the SGX Enclave.

The Verifier performs the verification and sends the result to the VideoCoin Network. Verifier signs the validation transaction with the private key corresponding to the account registered with the VideoCoin Network.

The same zkSNARKS scheme designed for non-SGX systems will be used with the SGX system except the verifier will be running in the SGX Enclave.

FAQ

Q: What is the role of zkSNARKS in the new proof-of-transcode? Can we do away with it and use any alternative?

A: The “probabilistically checkable proofs” of zkSNARKS provides an efficient proof generation and verification mechanism. It provides succinct proofs for recording on the blockchain.

Q: What are the advantages of using SGX based zkSNARKS Verifier?

A: Scalability: Verifier running in an SGX enclave can be treated as equivalent to “verifier Oracle” for the blockchain. This alleviates the need for running dedicated verifiers or burdening EVM with on-chain verification.

Improved security: Since the proof system, verification system and compute resources are closely located, man-in-the-middle attacks are eliminated.

More robust verification: Since the verifier is running on the same system as a transcoder, we can enable more robust commitment schemes for the transcoded data.

Q: What are the disadvantages?

A: Requires the setup of an ISV Provisioning Server that communicates with Intel Attestation Server which brings in a centralized component into the network.

References

1. Overview of Intel SGX: https://blog.quarkslab.com/overview-of-intel-sgx-part-1-sgx-internals.html

2. A Pure Rust Implementation of an Elliptic Curve Keypair Generator in an Intel SGX Enclave: https://github.com/provable-things/ethereum-keys-sgx