SlideShare a Scribd company logo
39th International Symposium on Reliable Distributed Systems 2020
Shanghai, China
TZ4Fabric
Executing Smart Contracts with ARM TrustZone
Christina Müller†, Marcus Brandenburger∗, Christian Cachin†,
Pascal Felber‡, Christian Göttel‡, Valerio Schiavoni‡
†University of Bern, Cryptology and Data Security
∗IBM Research Zurich
‡University of Neuchâtel, Complex Systems
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 1 / 16
Introduction
Motivating scenario
Coffee tracking system
Blockchain with smart contracts
Supply-chain tracing
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 2 / 16
Introduction
Motivating scenario
Coffee tracking system
Blockchain with smart contracts
Supply-chain tracing
Problem: hardware and software integrity can
be compromised
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 2 / 16
Introduction
Motivating scenario
Coffee tracking system
Blockchain with smart contracts
Supply-chain tracing
Problem: hardware and software integrity can
be compromised
Solution: trusted execution environments
(TEE)
hardware and software components shielding
from attacks
Based on Fabric Private Chaincode [SRDS’19]
Smart contract execution and ledger are
shielded by Intel SGX
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 2 / 16
Background
Raspberry Pi
Component Raspberry
SoC Broadcom R
VideoCore with ARM Cortex-A
Memory LPDDR
Disk microSD or HDD/SSD via USB
Ethernet Fast or Gigabit
Other Audio, BT, Camera, Display, GPIO, HDMI, WiFi
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 3 / 16
Background
ARM TrustZone
EL0
EL1 EL1
EL0
EL3 EL3
EL2
Secure Monitor
Hypervisor
OS
App
TOS
TA
EL2SPM
SMC
SMCHVCSVC
SMC
SMCHVCSVC
Normal World Secure World
A set of Arm security extensions
Hardware separation of worlds
through NS-bit
Exception level (EL)
Higher numbered EL have higher
privilege
Secure Monitor Call (SMC) to
switch worlds
Trusted execution environment (TEE)
GlobalPlatfrom (GP) TEE standard
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 4 / 16
Background
Open Portable TEE
EL0
EL1
EL2
EL3
Normal World Secure World
EL0
EL1
EL2
EL3
Secure Monitor Dispatcher
xen
Driver
OP-TEE
tee-supplicant
libteeclibc
TA
libutee
OP-TEE
OS PTA
CA
CA: client application
TA: trusted application
PTA: pseudo trusted application
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 5 / 16
Background
Hyperledger Fabric
Phase 1: Endorsement
Application sends transaction proposal to endorsing peers
Peers invoke chaincode and produce result
Peers send transaction response with endorsement back
100100010100000001
001001111010100011
101110101101110010
001001001010011110
100100010100000001
001001111010100011
101110101101110010
001001001010011110
?
?
?
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 6 / 16
Background
Hyperledger Fabric
Phase 2: Ordering
Transactions are sent to ordering service
Ordering service orders transaction responses into blocks
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 7 / 16
Background
Hyperledger Fabric
Phase 3: Validation
Orderings service broadcasts blocks to peers
Peers validate block and append it to ledger
Peers apply write set if there is no conflict
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 8 / 16
Architecture
100100010100000001
001001111010100011
101110101101110010
001001001010011110
Client Wrapper Proxy
Orderer
Wrapper: facilitate communication with the proxy via gRPC
Proxy: wrapper interface to chaincode running in normal world
Chaincode: smart contract executed in secure world with TZ
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 9 / 16
Evaluation
Setup
Nodes: 1× orderer, 1 − 8× peer, 1 − 8× proxy, 1 − 8× client
Server: dual socket Intel Xeon L5420 at 2.5 GHz and 8 GB RAM
Raspberry Pi 3B and 3B+ with PoE
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 10 / 16
Evaluation
Preliminary Evaluation
1 2 4 8
1
4
16
64
256
1024
Number of clients
Throughput[tx/s]
Read throughput
1 2 4 8
1
4
16
64
256
1024
Number of clients
Latency[ms]
Read latency
baseline QEMU QEMU baseline RaPi RaPi
Baseline RaPi achieves higher throughput than emulated RaPi with QEMU
Lower throughput of prototype than emulated RaPi
Throughput gets worse with increasing number of clients
Also higher latency with a single client
Possible bottleneck?
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 11 / 16
Evaluation
Latency Breakdown
create	gRPC	stream
chaincode_wrapper chaincode_proxy
chaincode
client
invoke
TEEC_OpenSession
GetStateResponse(ii)
GetStateRequest(ii)
InvocationResponse(iv)
return
{A}
TEEC_CloseSession
TEEC_InvokeCommand(i)
return(i)
TEEC_InvokeCommand(iii)
return(iii)
{D}
{J}
{M}
{G}
InvocationRequest(iv)
{O}
{N}
{B}
{C}
{I}
{E}
{H}
{K}
{L}
{F}
Time each segment individually
Segment B contributes 65 − 75% of
the total time
Load chaincode as TA
Before invocation
TEEC_OpenSession
All other segments contribute up to
1%
Problem identification:
Reuse TEE context and TA session
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 12 / 16
Evaluation
Throughput
0 200 400
0
1
2
Throughput [tx/s]
Latency[s]
a) Read latency
1 2 4 8 16 32 64 128
0
200
400
Number of clients
Throughput[tx/s]
b) Transactions
0 200 400
0
200
400
600
Throughput [tx/s]
Energy[J/tx]
c) Energy
0 200 400
0
1
2
Throughput [tx/s]
Latency[s]
d) Write latency
1 2 4 8 16 32 64 128
0
200
400
Number of clients
Throughput[tx/s]
e) Transactions
0 200 400
0
200
400
600
Throughput [tx/s]
Energy[J/tx]
f) Energy
baseline QEMU QEMU baseline RaPi RaPi
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 13 / 16
Evaluation
Energy
0 200 400
26
28
30
Throughput [tx/s]
Ordererenergy[kJ]
a) Orderer reads
0 200 400
26
27
28
29
Throughput [tx/s]
Avgpeerenergy[kJ]
b) Peer reads
0 200 400
0
10
20
30
Throughput [tx/s]
Avgproxyenergy[kJ]
c) Proxy reads
0 200 400
26
27
28
29
Throughput [tx/s]
Ordererenergy[kJ]
d) Orderer writes
0 200 400
26
27
28
Throughput [tx/s]
Avgpeerenergy[kJ]
e) Peer writes
0 200 400
0
10
20
30
Throughput [tx/s]
Avgproxyenergy[kJ]
f) Proxy writes
baseline QEMU QEMU baseline RaPi RaPi
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 14 / 16
Conclusion & Future Work
Conclusion:
Deployment of chaincodes on TZ-enabled devices in Hyperledger Fabric
Shielding chaincode execution with TZ
TZ4Fabric prototype running on Raspberry Pi 3B and 3B+
Performance and energy trade-offs
Future:
Consolidation of proxy and peer
How will performance and energy be impacted?
Reuse TEE context and TA session in prototype
Simplify the installation of chaincodes with TZ in TZ4Fabric
Attempt to shield the ledger
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 15 / 16
Thank you
Thank you for your attention!
The research leading to these results has received funding from the European
Union’s Horizon 2020 research and innovation programme under the LEGaTO
Project (legato-project.eu), grant agreement No 780681.
SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch
TZ4Fabric: Executing Smart Contracts with ARM TrustZone 16 / 16

More Related Content

PDF
Scrooge Attack: Undervolting ARM Processors for Profit
PDF
SRDS18: Security, Performance and Energy Trade-offs of Hardware-assisted Memo...
PPTX
CEM Workshop Lectures (3/11): Mesh Generation in CEM
PPTX
Federated HPC Clouds Applied to Radiation Therapy
PPTX
CEM Workshop Lectures (11/11): CEMExpert Usage of Almond Geometry for RCS Cal...
PPTX
CEM Workshop Lectures (7/11): PO/PTD Solver for RCS Computation
PPTX
CEM Workshop Lectures (6/11): FVTD Method in CEM
PDF
11 Synchoricity as the basis for going Beyond Moore
Scrooge Attack: Undervolting ARM Processors for Profit
SRDS18: Security, Performance and Energy Trade-offs of Hardware-assisted Memo...
CEM Workshop Lectures (3/11): Mesh Generation in CEM
Federated HPC Clouds Applied to Radiation Therapy
CEM Workshop Lectures (11/11): CEMExpert Usage of Almond Geometry for RCS Cal...
CEM Workshop Lectures (7/11): PO/PTD Solver for RCS Computation
CEM Workshop Lectures (6/11): FVTD Method in CEM
11 Synchoricity as the basis for going Beyond Moore

What's hot (14)

PDF
Enabling Power-Efficient AI Through Quantization
PPTX
High throughput implementations of cryptography algorithms on GPU and FPGA
PPTX
Virtualized high performance computing with mellanox fdr and ro ce
PDF
2013 14-vlsi-project-titles-for-me-mtech-pantech-pro ed
PDF
[OpenStack Day in Korea] Understanding OpenStack from SDN/NV Viewpoint
DOCX
Vlsi ieee 2014 project titles
PDF
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
PDF
"Optimizing SSD Object Detection for Low-power Devices," a Presentation from ...
PDF
VLSI Projects, IC Design, Low Power VLSI, Power Management, BIST, FPGA Projec...
PDF
Ijarcet vol-2-issue-3-901-903
PDF
New Media Services from a Mobile Chipset Vendor and Standardization Perspective
PDF
“Secure Hardware Architecture for Embedded Vision,” a Presentation from Neuro...
PDF
P138 142 r4c03
PPTX
CEM Workshop Lectures (9/11): Modelling Electromagnetics Field
Enabling Power-Efficient AI Through Quantization
High throughput implementations of cryptography algorithms on GPU and FPGA
Virtualized high performance computing with mellanox fdr and ro ce
2013 14-vlsi-project-titles-for-me-mtech-pantech-pro ed
[OpenStack Day in Korea] Understanding OpenStack from SDN/NV Viewpoint
Vlsi ieee 2014 project titles
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
"Optimizing SSD Object Detection for Low-power Devices," a Presentation from ...
VLSI Projects, IC Design, Low Power VLSI, Power Management, BIST, FPGA Projec...
Ijarcet vol-2-issue-3-901-903
New Media Services from a Mobile Chipset Vendor and Standardization Perspective
“Secure Hardware Architecture for Embedded Vision,” a Presentation from Neuro...
P138 142 r4c03
CEM Workshop Lectures (9/11): Modelling Electromagnetics Field
Ad

Similar to TZ4Fabric: Executing Smart Contracts with ARM TrustZone (20)

PDF
Trust Data Sharing and Utilization Infrastructure for Sensitive Data Using Hy...
PDF
iperfTZ: Understanding Network Bottlenecks for TrustZone-based Applications
PDF
WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for T...
PPTX
Blockchain solution architecture deliverable
PPTX
RISC-V 30906 hex five multi_zone iot firmware
PDF
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
PDF
Hyperledger Fabric Architecture
PDF
Hyperledger Fabric update Meetup 20181101
PPTX
Deploy a blockchain web-app with Hyperledger Fabric 1.4 - Concepts & Code
PDF
Deployablockchainwebappwithhyperledgerfabricpresentation 190820170703
PDF
Wwc developing hyperledger applications v4
PPTX
Blockchain, 
Hyperledger fabric & Hyperledger cello
PDF
Architecture of the Hyperledger Blockchain Fabric
PPTX
Blockchain Hyper Ledger Fabric : Bangkok Conference
PDF
Week-8.pdfedfedoejdeosjdoesedcesesdsedse
PDF
UNIT-4BlockChainTechnologies.NFTDLTHYPERLEDGERpdf
PPSX
Blockchain HyperLedger Fabric Internals - Clavent
PDF
Wwc developing hyperledger applications v2
PDF
blockchain-and-trusted-computing
PDF
Lecture 8 Hyperledger Fabric 2022f.pdf
Trust Data Sharing and Utilization Infrastructure for Sensitive Data Using Hy...
iperfTZ: Understanding Network Bottlenecks for TrustZone-based Applications
WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for T...
Blockchain solution architecture deliverable
RISC-V 30906 hex five multi_zone iot firmware
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
Hyperledger Fabric Architecture
Hyperledger Fabric update Meetup 20181101
Deploy a blockchain web-app with Hyperledger Fabric 1.4 - Concepts & Code
Deployablockchainwebappwithhyperledgerfabricpresentation 190820170703
Wwc developing hyperledger applications v4
Blockchain, 
Hyperledger fabric & Hyperledger cello
Architecture of the Hyperledger Blockchain Fabric
Blockchain Hyper Ledger Fabric : Bangkok Conference
Week-8.pdfedfedoejdeosjdoesedcesesdsedse
UNIT-4BlockChainTechnologies.NFTDLTHYPERLEDGERpdf
Blockchain HyperLedger Fabric Internals - Clavent
Wwc developing hyperledger applications v2
blockchain-and-trusted-computing
Lecture 8 Hyperledger Fabric 2022f.pdf
Ad

More from LEGATO project (20)

PDF
A practical approach for updating an integrity-enforced operating system
PDF
TEEMon: A continuous performance monitoring framework for TEEs
PDF
secureTF: A Secure TensorFlow Framework
PDF
PipeTune: Pipeline Parallelism of Hyper and System Parameters Tuning for Deep...
PDF
LEGaTO: Machine Learning Use Case
PPTX
Smart Home AI at the edge
PPTX
LEGaTO: Low-Energy Heterogeneous Computing Use of AI in the project
PPTX
LEGaTO Integration
PPTX
LEGaTO: Use cases
PPTX
LEGaTO: Software Stack Programming Models
PPTX
LEGaTO: Software Stack Runtimes
PPTX
LEGaTO Heterogeneous Hardware
PPTX
LEGaTO: Low-Energy Heterogeneous Computing Workshop
PDF
Infection Research with Maxeler Dataflow Computing
PDF
Smart Home - AI at the edge
PDF
FPGA Undervolting and Checkpointing for Energy-Efficiency and Error-Resiliency
PDF
Device Data Directory and Asynchronous execution: A path to heterogeneous com...
PDF
Scheduling Task-parallel Applications in Dynamically Asymmetric Environments
PDF
RECS – Cloud to Edge Microserver Platform for Energy-Efficient Computing
PDF
Secure Task-Based Programming with OmpSs and SGX
A practical approach for updating an integrity-enforced operating system
TEEMon: A continuous performance monitoring framework for TEEs
secureTF: A Secure TensorFlow Framework
PipeTune: Pipeline Parallelism of Hyper and System Parameters Tuning for Deep...
LEGaTO: Machine Learning Use Case
Smart Home AI at the edge
LEGaTO: Low-Energy Heterogeneous Computing Use of AI in the project
LEGaTO Integration
LEGaTO: Use cases
LEGaTO: Software Stack Programming Models
LEGaTO: Software Stack Runtimes
LEGaTO Heterogeneous Hardware
LEGaTO: Low-Energy Heterogeneous Computing Workshop
Infection Research with Maxeler Dataflow Computing
Smart Home - AI at the edge
FPGA Undervolting and Checkpointing for Energy-Efficiency and Error-Resiliency
Device Data Directory and Asynchronous execution: A path to heterogeneous com...
Scheduling Task-parallel Applications in Dynamically Asymmetric Environments
RECS – Cloud to Edge Microserver Platform for Energy-Efficient Computing
Secure Task-Based Programming with OmpSs and SGX

Recently uploaded (20)

PPTX
Classification Systems_TAXONOMY_SCIENCE8.pptx
PDF
Placing the Near-Earth Object Impact Probability in Context
PDF
The scientific heritage No 166 (166) (2025)
PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PPT
protein biochemistry.ppt for university classes
PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PPTX
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
PPTX
INTRODUCTION TO EVS | Concept of sustainability
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPTX
neck nodes and dissection types and lymph nodes levels
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPTX
2Systematics of Living Organisms t-.pptx
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPTX
2. Earth - The Living Planet Module 2ELS
PPTX
famous lake in india and its disturibution and importance
PDF
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
Classification Systems_TAXONOMY_SCIENCE8.pptx
Placing the Near-Earth Object Impact Probability in Context
The scientific heritage No 166 (166) (2025)
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
Derivatives of integument scales, beaks, horns,.pptx
protein biochemistry.ppt for university classes
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
INTRODUCTION TO EVS | Concept of sustainability
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
7. General Toxicologyfor clinical phrmacy.pptx
neck nodes and dissection types and lymph nodes levels
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
2Systematics of Living Organisms t-.pptx
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
2. Earth - The Living Planet Module 2ELS
famous lake in india and its disturibution and importance
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
POSITIONING IN OPERATION THEATRE ROOM.ppt

TZ4Fabric: Executing Smart Contracts with ARM TrustZone

  • 1. 39th International Symposium on Reliable Distributed Systems 2020 Shanghai, China TZ4Fabric Executing Smart Contracts with ARM TrustZone Christina Müller†, Marcus Brandenburger∗, Christian Cachin†, Pascal Felber‡, Christian Göttel‡, Valerio Schiavoni‡ †University of Bern, Cryptology and Data Security ∗IBM Research Zurich ‡University of Neuchâtel, Complex Systems SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 1 / 16
  • 2. Introduction Motivating scenario Coffee tracking system Blockchain with smart contracts Supply-chain tracing SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 2 / 16
  • 3. Introduction Motivating scenario Coffee tracking system Blockchain with smart contracts Supply-chain tracing Problem: hardware and software integrity can be compromised SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 2 / 16
  • 4. Introduction Motivating scenario Coffee tracking system Blockchain with smart contracts Supply-chain tracing Problem: hardware and software integrity can be compromised Solution: trusted execution environments (TEE) hardware and software components shielding from attacks Based on Fabric Private Chaincode [SRDS’19] Smart contract execution and ledger are shielded by Intel SGX SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 2 / 16
  • 5. Background Raspberry Pi Component Raspberry SoC Broadcom R VideoCore with ARM Cortex-A Memory LPDDR Disk microSD or HDD/SSD via USB Ethernet Fast or Gigabit Other Audio, BT, Camera, Display, GPIO, HDMI, WiFi SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 3 / 16
  • 6. Background ARM TrustZone EL0 EL1 EL1 EL0 EL3 EL3 EL2 Secure Monitor Hypervisor OS App TOS TA EL2SPM SMC SMCHVCSVC SMC SMCHVCSVC Normal World Secure World A set of Arm security extensions Hardware separation of worlds through NS-bit Exception level (EL) Higher numbered EL have higher privilege Secure Monitor Call (SMC) to switch worlds Trusted execution environment (TEE) GlobalPlatfrom (GP) TEE standard SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 4 / 16
  • 7. Background Open Portable TEE EL0 EL1 EL2 EL3 Normal World Secure World EL0 EL1 EL2 EL3 Secure Monitor Dispatcher xen Driver OP-TEE tee-supplicant libteeclibc TA libutee OP-TEE OS PTA CA CA: client application TA: trusted application PTA: pseudo trusted application SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 5 / 16
  • 8. Background Hyperledger Fabric Phase 1: Endorsement Application sends transaction proposal to endorsing peers Peers invoke chaincode and produce result Peers send transaction response with endorsement back 100100010100000001 001001111010100011 101110101101110010 001001001010011110 100100010100000001 001001111010100011 101110101101110010 001001001010011110 ? ? ? SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 6 / 16
  • 9. Background Hyperledger Fabric Phase 2: Ordering Transactions are sent to ordering service Ordering service orders transaction responses into blocks SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 7 / 16
  • 10. Background Hyperledger Fabric Phase 3: Validation Orderings service broadcasts blocks to peers Peers validate block and append it to ledger Peers apply write set if there is no conflict SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 8 / 16
  • 11. Architecture 100100010100000001 001001111010100011 101110101101110010 001001001010011110 Client Wrapper Proxy Orderer Wrapper: facilitate communication with the proxy via gRPC Proxy: wrapper interface to chaincode running in normal world Chaincode: smart contract executed in secure world with TZ SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 9 / 16
  • 12. Evaluation Setup Nodes: 1× orderer, 1 − 8× peer, 1 − 8× proxy, 1 − 8× client Server: dual socket Intel Xeon L5420 at 2.5 GHz and 8 GB RAM Raspberry Pi 3B and 3B+ with PoE SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 10 / 16
  • 13. Evaluation Preliminary Evaluation 1 2 4 8 1 4 16 64 256 1024 Number of clients Throughput[tx/s] Read throughput 1 2 4 8 1 4 16 64 256 1024 Number of clients Latency[ms] Read latency baseline QEMU QEMU baseline RaPi RaPi Baseline RaPi achieves higher throughput than emulated RaPi with QEMU Lower throughput of prototype than emulated RaPi Throughput gets worse with increasing number of clients Also higher latency with a single client Possible bottleneck? SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 11 / 16
  • 14. Evaluation Latency Breakdown create gRPC stream chaincode_wrapper chaincode_proxy chaincode client invoke TEEC_OpenSession GetStateResponse(ii) GetStateRequest(ii) InvocationResponse(iv) return {A} TEEC_CloseSession TEEC_InvokeCommand(i) return(i) TEEC_InvokeCommand(iii) return(iii) {D} {J} {M} {G} InvocationRequest(iv) {O} {N} {B} {C} {I} {E} {H} {K} {L} {F} Time each segment individually Segment B contributes 65 − 75% of the total time Load chaincode as TA Before invocation TEEC_OpenSession All other segments contribute up to 1% Problem identification: Reuse TEE context and TA session SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 12 / 16
  • 15. Evaluation Throughput 0 200 400 0 1 2 Throughput [tx/s] Latency[s] a) Read latency 1 2 4 8 16 32 64 128 0 200 400 Number of clients Throughput[tx/s] b) Transactions 0 200 400 0 200 400 600 Throughput [tx/s] Energy[J/tx] c) Energy 0 200 400 0 1 2 Throughput [tx/s] Latency[s] d) Write latency 1 2 4 8 16 32 64 128 0 200 400 Number of clients Throughput[tx/s] e) Transactions 0 200 400 0 200 400 600 Throughput [tx/s] Energy[J/tx] f) Energy baseline QEMU QEMU baseline RaPi RaPi SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 13 / 16
  • 16. Evaluation Energy 0 200 400 26 28 30 Throughput [tx/s] Ordererenergy[kJ] a) Orderer reads 0 200 400 26 27 28 29 Throughput [tx/s] Avgpeerenergy[kJ] b) Peer reads 0 200 400 0 10 20 30 Throughput [tx/s] Avgproxyenergy[kJ] c) Proxy reads 0 200 400 26 27 28 29 Throughput [tx/s] Ordererenergy[kJ] d) Orderer writes 0 200 400 26 27 28 Throughput [tx/s] Avgpeerenergy[kJ] e) Peer writes 0 200 400 0 10 20 30 Throughput [tx/s] Avgproxyenergy[kJ] f) Proxy writes baseline QEMU QEMU baseline RaPi RaPi SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 14 / 16
  • 17. Conclusion & Future Work Conclusion: Deployment of chaincodes on TZ-enabled devices in Hyperledger Fabric Shielding chaincode execution with TZ TZ4Fabric prototype running on Raspberry Pi 3B and 3B+ Performance and energy trade-offs Future: Consolidation of proxy and peer How will performance and energy be impacted? Reuse TEE context and TA session in prototype Simplify the installation of chaincodes with TZ in TZ4Fabric Attempt to shield the ledger SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 15 / 16
  • 18. Thank you Thank you for your attention! The research leading to these results has received funding from the European Union’s Horizon 2020 research and innovation programme under the LEGaTO Project (legato-project.eu), grant agreement No 780681. SRDS’20 22.09.2020 | CRYPTO, IBM & IIUN | Christian Göttel | christian.goettel@unine.ch TZ4Fabric: Executing Smart Contracts with ARM TrustZone 16 / 16