Permissioned Distributed Ledgers (PDL); Smart Contracts; System Architecture and Functional Specification

DGR/PDL-004_smart contract

General Information

Status
Not Published
Current Stage
12 - Completion
Due Date
14-Jan-2021
Completion Date
08-Feb-2021
Ref Project

Buy Standard

Standard
ETSI GR PDL 004 V1.1.1 (2021-02) - Permissioned Distributed Ledgers (PDL); Smart Contracts; System Architecture and Functional Specification
English language
33 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

ETSI GR PDL 004 V1.1.1 (2021-02)






GROUP REPORT
Permissioned Distributed Ledgers (PDL)
Smart Contracts
System Architecture and Functional Specification
Disclaimer
The present document has been produced and approved by the Permissioned Distributed Ledger ETSI Industry Specification
Group (ISG) and represents the views of those members who participated in this ISG.
It does not necessarily represent the views of the entire ETSI membership.

---------------------- Page: 1 ----------------------
2 ETSI GR PDL 004 V1.1.1 (2021-02)



Reference
DGR/PDL-004_smart contract
Keywords
blockchain, policies, PDL, SLA, smart contract

ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE

Tel.: +33 4 92 94 42 00  Fax: +33 4 93 65 47 16

Siret N° 348 623 562 00017 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88

Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying
and microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.

© ETSI 2021.
All rights reserved.

DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.

3GPP™ and LTE™ are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners.
®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI

---------------------- Page: 2 ----------------------
3 ETSI GR PDL 004 V1.1.1 (2021-02)
Contents
Intellectual Property Rights . 6
Foreword . 6
Modal verbs terminology . 6
Executive summary . 6
Introduction . 6
1 Scope . 7
2 References . 7
2.1 Normative references . 7
2.2 Informative references . 7
3 Definition of terms, symbols and abbreviations . 8
3.1 Terms . 8
3.2 Symbols . 9
3.3 Abbreviations . 9
4 Introduction to Smart Contracts . 9
4.1 Introduction . 9
4.2 Object-Oriented Paradigm . 9
4.3 Properties of Smart Contracts . 10
4.3.1 Introduction. 10
4.3.2 Immutability . 10
4.3.3 Availability . 10
4.3.4 Transparency . 10
4.3.5 Self-Execution . 10
4.3.6 Reusability . 11
4.4 Storage . 11
4.5 The Lifecycle of a Smart Contract . 11
5 Smart Contracts - Lifecycle phases . 12
5.1 Introduction . 12
5.2 Planning Phase . 12
5.2.1 Introduction. 12
5.2.2 Governance . 12
5.2.2.1 Introduction . 12
5.2.2.2 Single-party Governance . 12
5.2.2.3 Multi-party Governance . 13
5.2.3 Design Planning - Coding and Testing . 13
5.2.4 Deployment Planning . 14
5.2.4.1 Introduction . 14
5.2.4.2 On-chain deployment . 14
5.2.4.3 Side-chain deployment . 14
5.2.4.4 Off-chain deployment . 15
5.2.4.5 Immutable deployment . 15
5.2.4.6 Terminable deployment . 15
5.2.4.7 Upgradeable deployment . 15
5.2.5 Draft template . 16
5.2.5.1 Introduction . 16
5.2.5.2 Terms negotiation . 16
5.2.5.3 Map draft template to the machine-readable context (Compile Draft) . 16
5.2.5.4 Draft review (reference checklist) . 16
5.3 Coding and testing phase . 17
5.3.1 Introduction. 17
5.3.2 Coding process . 17
5.3.3 Testing process . 17
5.3.4 Code/Programming language level Testing . 17
ETSI

---------------------- Page: 3 ----------------------
4 ETSI GR PDL 004 V1.1.1 (2021-02)
5.3.5 Smart Contract specific testing . 17
5.3.5.1 Open source SC analysers . 18
5.3.5.2 Sandbox testing . 18
5.3.5.3 Three passes . 18
5.3.6 Validation . 19
5.3.7 User experience testing . 19
5.3.8 Consumer protection . 19
5.4 Deployment and execution phase . 19
5.4.1 Deployment. 19
5.4.2 Execution . 19
5.4.3 Termination. 19
6 Architectural requirements for Smart Contracts . 19
6.1 Introduction . 19
6.2 Architectural requirements . 20
6.2.1 Reusability . 20
6.2.2 Self-destruction . 20
6.2.3 Data ownership . 20
6.3 Reference architecture . 20
6.3.1 Introduction. 20
6.3.2 Data retrieval in Smart Contracts . 21
6.3.3 Transactions and transaction dependencies . 21
6.3.4 Smart Contract architecture - Without Smart Contract chaining . 21
6.3.5 Smart Contract architecture - with contracts chaining . 22
7 Smart Contracts - applications, solutions and needs . 22
7.1 Introduction . 22
7.2 Applications . 23
7.2.1 Introduction. 23
7.2.2 ICT Sector . 23
7.2.3 Automated machines/sensors . 23
7.2.4 Automated auctions/sales . 23
7.2.5 Mechanism for access control/certification authority . 23
7.3 Solutions . 25
7.3.1 Introduction. 25
7.3.2 Scalability . 25
7.3.3 Check-point. 25
7.3.4 Extensibility . 25
7.4 Security of contracts . 25
7.5 Example: Smart Contracts with QoS monitoring . 25
7.6 Needs - Requirements to build a viable system with Smart Contracts . 27
7.6.1 Regulatory aspects . 27
7.6.2 Security of the contracts . 27
7.6.3 Secure data feed (oracles) . 27
7.6.4 Enforceability . 27
7.6.5 Availability . 27
7.6.6 Attacks . 28
7.6.6.1 Re-entrancy . 28
7.6.6.2 Free option problem . 28
7.6.6.3 Denial of capacity attack . 28
8 Threats and limitations of Smart Contracts . 28
8.1 Introduction . 28
8.2 Inter and intra system threats . 28
8.2.1 Introduction. 28
8.2.2 Absence of termination clause/self-destruction . 29
8.2.3 Admission control . 29
8.2.4 Off-chain and side-chain contracts handling. 29
8.2.5 Poor exception handling . 29
8.2.6 Transparency of a PDL . 29
8.2.7 External libraries . 30
8.3 Limitations . 30
8.3.1 Introduction. 30
ETSI

---------------------- Page: 4 ----------------------
5 ETSI GR PDL 004 V1.1.1 (2021-02)
8.3.2 Occupancy . 30
8.3.3 Latency . 30
8.3.4 Underlying and Relying ledgers in permissioned context . 30
8.3.5 Not every term can be translated to a Smart Contract . 31
8.3.6 Legal uncertainty . 31
8.3.7 Intellectual property rights . 31
8.3.8 Accountability in smart contracts . 31
Annex A: Change History . 32
History . 33


ETSI

---------------------- Page: 5 ----------------------
6 ETSI GR PDL 004 V1.1.1 (2021-02)
Intellectual Property Rights
Essential patents
IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information
pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found
in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web
server (https://ipr.etsi.org/).
Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee
can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web
server) which are, or may be, or may become, essential to the present document.
Trademarks
The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no
right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does
not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.
Foreword
This Group Report (GR) has been produced by ETSI Industry Specification Group (ISG) Permissioned Distributed
Ledger (PDL).
Modal verbs terminology
In the present document "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be
interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions).
"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.
Executive summary
The present document specifies a high-level functional abstraction of PDL Smart Contract System Architecture. In
particular, basic building blocks for designing, coding and testing Smart Contracts for the PDLs. This includes
describing how different classes of systems interact with Smart Contracts. Processes, models, and detailed information
are beyond the scope of the present document.
Introduction
The present document defines a high-level functional abstraction of policies to design and code Smart Contract
components. Smart Contracts are mere codes, and if not well planned, designed, coded and tested can leave the system
vulnerable to external attacks and internal errors.

ETSI

---------------------- Page: 6 ----------------------
7 ETSI GR PDL 004 V1.1.1 (2021-02)
1 Scope
The present document specifies the functional components of Smart Contracts, their planning, coding and testing. This
includes:
a) reference architecture of the technology enabling Smart Contracts - the planning, designing and programming
frameworks;
b) specify how to engage using this architecture - the methods and frameworks the Smart Contracts building
blocks possibly communicate;
c) point out possible threats and limitations.
2 References
2.1 Normative references
Normative references are not applicable in the present document.
2.2 Informative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long term validity.
The following referenced documents are not necessary for the application of the present document but they assist the
user with regard to a particular subject area.
[i.1] ACM Digital Library: "Securify: Practical Security Analysis of Smart Contracts".
NOTE: Available at https://dl.acm.org/doi/pdf/10.1145/3243734.3243780.
[i.2] ACM Digital Library: "SmartCheck: Static Analysis of Ethereum Smart Contracts".
NOTE: Available at https://dl.acm.org/doi/pdf/10.1145/3194113.3194115.
[i.3] ITU-T Report: "Distributed Ledger Technologies and Financial inclusion".
NOTE: Available at https://www.itu.int/en/ITU-T/focusgroups/dfs/Documents/201703/ITU_FGDFS_Report-on-
DLT-and-Financial-Inclusion.pdf.
[i.4] ETSI GR PDL 003: "Permissioned Distributed Ledger (PDL); Application Scenarios".
NOTE: Available at https://portal.etsi.org/webapp/WorkProgram/Report_WorkItem.asp?WKI_ID=57511
[i.5] United Nations Commission on International Trade Law.
NOTE: Available at https://uncitral.un.org/
[i.6] Decentralized Public Key Infrastructure.
NOTE: Available at https://medium.com/hackergirl/decentralized-public-key-infrastructure-4e7ea9173bac
ETSI

---------------------- Page: 7 ----------------------
8 ETSI GR PDL 004 V1.1.1 (2021-02)
3 Definition of terms, symbols and abbreviations
3.1 Terms
For the purposes of the present document, the following terms apply:
coin: implementation using a unique ledger and usually used for financial transactions (e.g. Ether, Bitcoin)
eternal contracts: contracts which are active for infinite time
mainnet: ledger in-production
NOTE: The contracts and transactions on a mainnet are ultimate.
master-chain: primary chain where the executions of the Smart Contract are recorded
off-chain smart contract: smart contracts stored away from the ledger (i.e. trusted database or side-chain) and their
execution may depend on on-chain contracts (i.e. on-chain contract can initiate off-chain contracts) and later the state
can be updated
on-chain smart contract: contract that resides in the master-chain and on side-chain, that is executed directly without
the instantiation of any other contract
NOTE: The beneficiaries get rewarded as soon as the contract is executed without the involvement of any other
contract.
participants: participants are the members of the PDL which keep the copy of the ledger and take part in the consensus
Ricardian contract: single contract document which is both easily readable by human and machines and not
self-executable
NOTE 1: It is formatted as a text file and digitally signed by the issuer of the contract.
NOTE 2: The security of a Ricardian contract is achieved by OpenPGP and all the signing keys are included within
the contract so eliminates the use of external certificate authority, in other words a Ricardian contract
carries its own PKI with them.
NOTE 3: The Difference between Ricardian contract and Smart Contract: The major difference between the Smart
Contract and the Ricardian contracts is that Smart Contracts are executable code but Ricardian contracts
are the agreements recorded in a single file and not executable on their own. A Smart Contract does not
have to be a Ricardian contract and a Ricardian contract is not a Smart Contract, but a Smart Contract can
execute a Ricardian contract.
side-chain: chain(s) which work as a secondary chain to the main-chain/ledger
NOTE: It can be used to off-load some of the computations for scalability or privacy.
Smart Contract (SC): computer program stored in a distributed ledger system, wherein the outcome of any execution
of the program is recorded on the distributed ledger
NOTE:
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.