Twine: An Embedded Trusted Runtime for WebAssembly

Jämes Ménétrey, Marcelo Pasin, Pascal Felber, Valerio Schiavoni
3/29/2021
cs.CRcs.DCcs.PF

Official code: JamesMenetrey/unine-twine (43 stars, C++, Apache-2.0, last commit 2024-03-14).

Abstract

WebAssembly is an increasingly popular lightweight binary instruction format, which can be efficiently embedded and sandboxed. Languages like C, C++, Rust, Go, and many others can be compiled into WebAssembly.

Show full abstract

This paper describes Twine, a WebAssembly trusted runtime designed to execute unmodified, language-independent applications. We leverage Intel SGX to build the runtime environment without dealing with language-specific, complex APIs. While SGX hardware provides secure execution within the processor, Twine provides a secure, sandboxed software runtime nested within an SGX enclave, featuring a WebAssembly system interface (WASI) for compatibility with unmodified WebAssembly applications. We evaluate Twine with a large set of general-purpose benchmarks and real-world applications. In particular, we used Twine to implement a secure, trusted version of SQLite, a well-known full-fledged embeddable database. We believe that such a trusted database would be a reasonable component to build many larger application services. Our evaluation shows that SQLite can be fully executed inside an SGX enclave via WebAssembly and existing system interface, with similar average performance overheads. We estimate that the performance penalties measured are largely compensated by the additional security guarantees and its full compatibility with standard WebAssembly. An in-depth analysis of our results indicates that performance can be greatly improved by modifying some of the underlying libraries. We describe and implement one such modification in the paper, showing up to $4.1\times$ speedup. Twine is open-source, available at GitHub along with instructions to reproduce our experiments.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

TWINE: An Embedded Trusted Runtime for WebAssembly. This is the repository that contains the source code of Twine and the related benchmarks.

436C++, COct 14, 20202 years agoApache-2.0
benchmarkspaperreproducibilitysgxtwine+1 more

Similar Papers

Cite this paper

@article{mntrey2021twine,
  title  = {Twine: An Embedded Trusted Runtime for WebAssembly},
  author = {Jämes Ménétrey and Marcelo Pasin and Pascal Felber and Valerio Schiavoni},
  year   = {2021},
  eprint = {2103.15860},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.15860}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.15860.svg)](https://codeofpaper.com/paper/2103.15860)

Discussion