idnits 2.17.1 draft-urien-core-blockchain-transaction-protocol-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 4, 2019) is 1879 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CORE Working Group P. Urien 3 Internet Draft Telecom ParisTech 4 Intended status: Experimental 6 March 4, 2019 7 Expires: September 2019 9 Blockchain Transaction Protocol for Constraint Nodes 10 draft-urien-core-blockchain-transaction-protocol-02.txt 12 Abstract 14 The goal of the blockchain transaction protocol for constraint nodes 15 is to enable the generation of blockchain transactions by constraint 16 nodes, according to the following principles : 17 - transactions are triggered by Provisioning-Messages that include 18 the needed blockchain parameters. 19 - binary encoded transactions are returned in Transaction-Messages, 20 which include sensors/actuators data. Constraint nodes, associated 21 with blockchain addresses, compute the transaction signature. 23 Requirements Language 25 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 26 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 27 document are to be interpreted as described in RFC 2119. 29 Status of this Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six 40 months and may be updated, replaced, or obsoleted by other documents 41 at any time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on September 2019. 46 . 48 Copyright Notice 50 Copyright (c) 2019 IETF Trust and the persons identified as the 51 document authors. All rights reserved. 53 This document is subject to BCP 78 and the IETF Trust's Legal 54 Provisions Relating to IETF Documents 55 (http://trustee.ietf.org/license-info) in effect on the date of 56 publication of this document. Please review these documents 57 carefully, as they describe your rights and restrictions with 58 respect to this document. Code Components extracted from this 59 document must include Simplified BSD License text as described in 60 Section 4.e of the Trust Legal Provisions and are provided without 61 warranty as described in the Simplified BSD License. 63 Table of Contents 64 Abstract........................................................... 1 65 Requirements Language.............................................. 1 66 Status of this Memo................................................ 1 67 Copyright Notice................................................... 2 68 1 Overview......................................................... 4 69 2 Overview of the Blockchain Transaction Protocol for Constraint 70 Nodes.............................................................. 4 71 2.1 Architecture................................................ 4 72 2.2 An Ethereum Use Case........................................ 5 73 3 Blockchain Transaction Protocol Messages Definition.............. 6 74 3.1 Provisioning Message........................................ 6 75 3.1.1 Encoding example in JSON syntax ...................... 6 76 3.2 Transaction Message......................................... 6 77 3.2.1 Encoding example in JSON syntax ...................... 6 78 4. Blockchain Transaction Protocol Messages Binary Encoding........ 7 79 4.1 CoAP messages............................................... 7 80 4.2 HTTP Messages............................................... 7 81 5 IANA Considerations.............................................. 7 82 6 Security Considerations.......................................... 7 83 6 References....................................................... 7 84 6.1 Normative References........................................ 7 85 6.2 Informative References...................................... 7 86 7 Authors' Addresses............................................... 7 87 1 Overview 89 In the context of this draft sensors/actuators are powered by micro- 90 controllers comprising about 10KB of RAM and 100KB of non volatile 91 memory. The node electronic board may include a radio SoC (System On 92 Chip) or the micro-controller can be part of the SoC. The radio chip 93 manages IP connectivity with another device, typically acting as a 94 controller, which provides a full internet access with standard 95 computing resources. 97 A constraint node driving sensors and/or actuators may deliver 98 critical data dealing with safety (fire detection,...) or legacy 99 (pollution measurement,...) information. 101 Blockchain infrastructure provides two important features in an 102 Internet of Things (IoT) context: 104 - Authentication of data in P2P context. Blockchain signed 105 transactions are checked by numerous nodes. 106 - Information publication. Transactions are stored in duplicated and 107 distributed databases. 108 - Dating information. Transactions are dated during the mining 109 process. 111 The goal of the blockchain transaction protocol for constraint nodes 112 is to enable the generation of blockchain transactions by constraint 113 nodes, according to the following principles: 114 - transactions are triggered by controllers. Needed blockchain 115 parameters are included in provisioning messages. 116 - binary encoded transaction messages are returned by constraint 117 nodes. A node has the ability to compute the transaction signature. 119 2 Overview of the Blockchain Transaction Protocol for Constraint Nodes 121 2.1 Architecture 123 <--Provisioning-Message 124 +--------------------+ IP +----------------------+ +------------+ 125 | Constraint Node | link | Controller | | Blockchain | 126 + Blockchain Address +------+ Full IP connectivity +--+ Network | 127 + Private Key | | Access to blockchain | | | 128 +--------------------+ +----------------------+ +------------+ 129 Transaction-Message--> 131 Figure 1. Functional architecture for the Blockchain Transaction 132 Protocol for Constraint Nodes 134 A constraint node holds a blockchain address (BA). The blockchain 135 address is computed from a private key (Pk). Most of today 136 blockchain infrastructures deal with ECDSA signatures, generated 137 over the Secp256k1 elliptic curve. The private key is a 32 bytes 138 number, stored in the constraint node. The computation of hash 139 procedures such a SHA2 or KECCAK-256 can be handled by 140 microcontrollers. Although ECDSA signature may be generated by a 141 microcontroller, a tamper resistant resource could be used, either 142 embedded in the CPU, or in a chip such as a secure element[ISO7816]. 143 As an illustration an architecture based on micro-controller, radio 144 SoC and secure element was demonstrated in [IEEE-CCNC2018]. 146 The controller is a device with full IP connectivity. It typically 147 communicates with the constraint node thanks to the CoAP [RFC7252] 148 protocol, or other legacy protocols such as HTTPS. The controller 149 has access to the blockchain infrastructure, to which it is able to 150 forward a binary encoded transaction, signed by the constraint node. 152 2.2 An Ethereum Use Case. 154 The following figure 2, illustrates an Ethereum transaction 155 generated by a constraint node, whose total length is 118 bytes. 157 F8 74 // RLP List, length= 116 bytes 158 0C // nonce 1 byte =12 decimal 159 85 06FC23AC00 // gasPrice = 30 GWei 160 83 013880 // gasLimit = 80000 gas 161 // recipient address 20 bytes 162 94 6BAC1B75185D9051AF740AB909F81C71BBB221A6 163 80 // Null Ether Value 164 // Data 15 bytes "Temperature=25C" 165 8F 54656D70657261747572653D323543 166 1B // recovery parameter, 1 byte 167 A0 // r, 32 bytes, ECDSA r parameter 168 A9B58980F76EE6284800B82A2B5DF13E456887EC0CF426A5E5D6A738EB1784ED 169 A0 // s, 32 bytes, ECDSA s parameter 170 629633C6A3ED5FEE0FB40E2D1CF251345B885D372857B1A6C4762C9BE914281F 172 Figure 2. Illustration of an Ethereum transaction, generated by a 173 constraint node. 175 The identifier (TxId) of this transaction (i.e. its KECCAK-256 176 digest) is: 178 0xd6904d832462ae17718c69e9caa0c3f3bed458382ac1f4e43b1aadd8e94744ad 180 Given this TxId, the transaction can be retrieved in any Ethereum 181 blockchain database, like for example: 183 https://etherscan.io/tx/0xd6904d832462ae17718c69e9caa0c3f3bed458382a 184 c1f4e43b1aadd8e94744ad 186 The transaction date (20-2018 09:52:42 PM +UTC) is published and 187 certified by the blockchain. 189 The binary encoded transaction comprises two parts, 190 - information relying on the Ethereum blockchain context, such as 191 the nonce, the gasPrice, the gasLimit, the recipient address, and an 192 Ether value. 193 - information delivered by the constraint node, data (a temperature 194 measurement), and the ECDSA signature computed from the 32 bytes 195 private key. 197 Parameters relying on the Ethereum blockchain context MUST be 198 included in the Provisioning-Message. 199 The signed transaction MUST be included in the Transaction-Message. 201 3 Blockchain Transaction Protocol Messages Definition 203 The Blockchain Transaction Protocol comprises two messages, to be 204 included in transport protocols, such as CoAP or HTTP. 206 3.1 Provisioning Message 208 This message includes the following attributes : 209 - A type, an integer value, specifying the message content. 210 - An ordered list of values, storing the parameters of the 211 blockchain context. 213 3.1.1 Encoding example in JSON syntax 215 Here is an illustration of the provisioning message associated to 216 the Ethereum blockchain. 218 { 219 "type": 1, 220 "nonce": 12, 221 "gasPrice": 30, 222 "gasLimit": 80000, 223 "address": "6BAC1B75185D9051AF740AB909F81C71BBB221A6", 224 "value": 0 225 } 227 3.2 Transaction Message 229 This message include the following attributes 230 - A type, an integer value, specifying the message content. The zero 231 value indicates an error. 232 - The binary encoded transaction, including the signature. 234 3.2.1 Encoding example in JSON syntax 236 Here is an illustration of the transaction message associated to the 237 Ethereum blockchain. 239 { 240 "type": 1, 241 "transaction": 242 "F8740C8506FC23AC0083013880946BAC1B75185D9051AF740AB909F81C71BBB221A 243 6808F54656D70657261747572653D3235431BA0A9B58980F76EE6284800B82A2B5DF 244 13E456887EC0CF426A5E5D6A738EB1784EDA0629633C6A3ED5FEE0FB40E2D1CF2513 245 45B885D372857B1A6C4762C9BE914281F" 246 } 248 4. Blockchain Transaction Protocol Messages Binary Encoding 250 4.1 CoAP messages 252 To be Done 254 4.2 HTTP Messages 256 To be Done 258 5 IANA Considerations 260 TODO 262 6 Security Considerations 264 TODO 266 6 References 268 6.1 Normative References 270 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 271 Application Protocol (CoAP)", RFC 7252, June 2014. 273 [ISO7816] ISO 7816, "Cards Identification - Integrated Circuit Cards 274 with Contacts", The International Organization for Standardization 275 (ISO). 277 6.2 Informative References 279 [IEEE-CCNC2018] Urien,P., "An Innovative Security Architecture for 280 Low Cost Low Power IoT Devices Based on Secure Elements", IEEE CCNC 281 2018 283 7 Authors' Addresses 285 Pascal Urien 286 Telecom ParisTech 287 23 avenue d'Italie 288 75013 Paris Phone: NA 289 France Email: Pascal.Urien@telecom-paristech.fr