簡易檢索 / 詳目顯示

研究生: 潘俊廷
Pan, Chun-Ting
論文名稱: 基於以太坊區塊鏈與智能合約之農產品溯源系統研製
Agricultural Product Traceability System Based on Ethereum Blockchain and Smart Contract
指導教授: 黃能富
Huang, Nen-Fu
口試委員: 許健平
Sheu, Jang-Ping
陳俊良
Chen, Jiann-Liang
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊系統與應用研究所
Institute of Information Systems and Applications
論文出版年: 2019
畢業學年度: 107
語文別: 英文
論文頁數: 82
中文關鍵詞: 農業供應鏈Android區塊鏈以太坊物聯網近距離無線通訊智能合約可追溯性
外文關鍵詞: Agriculture supply chain, Android, Blockchain, Ethereum, Internet of Things (IoT), Near Field Communication (NFC), Smart contract, Traceability
相關次數: 點閱:3下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 在食安問題方面,農產品的產銷履歷一直是消費者最關心的重點之一。近年來,將物聯網技術應用於農業發展的趨勢日益盛行,並也在許多方面達到相當不錯的績效。有了物聯網技術的協助,不僅農作物在種植期間能夠透過各種感測器更精確地掌握溫度、濕度、土壤電解質等重要環境數據,以及時提供更精確的灌溉或施肥等照護措施,農產品在貨運時亦可持續監控,確保溫溼度維持在其最適合的狀態。除了輔助食品生產階段外,有了物聯網數據資訊,產銷履歷亦將變得更詳細且更可靠。
    為了創造更可信的種植與貨運過程的產銷履歷,資訊安全便成為了處理來自物聯網感測器大量數據的關鍵議題‧我們透過將區塊鏈技術應用於資料儲存,利用其永久保存與不可竄改的特性確保了資料的公正性與可靠度。除此之外,在處理食品生產鏈上眾多業者(製造商、加工廠、物流運輸……等)之間的互動時,區塊鏈的關鍵應用—智能合約亦可連結各單位,迫使餐與生產鏈的成員們遵循一定的規範。
    本篇論文主要分為三大層面。第一為使用以太坊區塊鏈系統架設平台備份系統,用以達成農場或物流相關的物聯網平台之數據備份與錯誤驗證,並結合智能合約確保資料安全性與預防竄改。第二為包裹即時追蹤系統的研製,其中使用NFC標籤定義農產品包裹,並以手機應用程式讀取,使資料與區塊鏈及時相接。最後,提供食品生產鏈上各單位間之虛擬貨幣轉帳功能,以對應生產鏈上業者間的各式行為與交易。


    The traceability of agricultural products has always been one of the most important things that customers care about when it comes to food safety problems. For the past decades. The trend of applying Internet of Things (IoT) technology to agriculture has been on an exponential rise and had also shown great success in different aspects. Not only but crops can be irrigated and taken care of more precisely according to data-wise observation to the farming environment, the delivery process of the products can also be carefully monitored with the help of IoT devices and sensors. As a result, more detailed and reliable production history can also be generated.
    To achieve a more trustable traceability for agricultural production and logistic process, data security becomes a major factor after massive data has been collected via IoT. By using blockchain technology for data storing, integrity and reliability can be ensured due to its immutability. Furthermore, when dealing with several components (producer, processor, distributor…etc.) on a food production chain, blockchain also has the ability to connect untrusted nodes and restrict them in following certain protocols.
    Our study is mainly composed of three aspects. Firstly, an Ethereum blockchain system to implement data verification for IoT sensor based platform that collects environmental data of agricultural products during their production and delivery lifecycle, using smart contract deployments to support tampering-proof data storing. Second, a real-time logistic tracking solution, using NFC tags to identify product packages, and an Android application serving as a package scanner, to connect product delivery record with the blockchain. Lastly, provide possibility to execute and track reliable financial transactions between components, which may happen throughout the entire food production chain during product delivery.

    Abstract I 中文摘要 III Table of Contents IV List of Figures VI List of Tables VIII Chapter 1 Introduction 1 Chapter 2 Related Works 5 2.1 Blockchain 5 2.1.1 Block hash and mining 5 2.1.2 Structure of Blockchain network 6 2.2 Ethereum 7 2.2.1 Private Chain and Public Chain 7 2.2.2 Genesis block 8 2.2.3 Transactions 10 2.2.4 Web3 11 2.2.5 Smart contract 11 2.2.6 Remix and Solidity 12 2.2.7 Metamask 13 2.2.8 Light Nodes and Full Nodes 13 2.3 Related Studies 14 Chapter 3 System Design 17 3.1 System Architecture Overview 17 3.2 Data Verification System 18 3.2.1 Data Collecting Layer 19 3.2.2 Blockchain Layer 20 3.2.3 Application Layer 20 3.3 Package Delivery System 21 3.3.1 Package Interactions 23 3.3.2 Package Prototype 24 3.3.3 History Record 26 3.3.4 Package Data Retrieval 26 3.3.5 User Scenario 27 3.4 Transaction System 29 3.4.1 Importing Wallets 31 3.4.2 Executing Transactions 33 3.4.3 Design Difference between Package Delivery System 34 Chapter 4 System Implementation 36 4.1 Data Verification System 36 4.1.1 Crontab 36 4.1.2 API Calling 37 4.1.3 Secured Hash Algorithms 38 4.1.4 Merkle Tree 38 4.1.5 Data Storage using Transactions 41 4.1.6 Data Retrieval using Smart Contract 43 4.1.7 Data Verification 45 4.1.8 Security Analysis 46 4.2 Package Delivery System 48 4.2.1 Smart Contract Designs for Package History 48 4.2.2 Socket.IO 50 4.2.3 Interactive Android APP 52 4.3 Transaction System 65 4.3.3 Metamask Setup 65 4.3.2 Smart Contract Function 66 4.3.3 Transaction Related APP pages 67 4.4 Servers and Mining Machines 72 Chapter 5 Conclusion and Future Works 74 References 77

    [1] Seong-Hoon Lee, Dong-Woo Lee, “Review on Current Situations for Internet of Things,” in 7th International Conference on Multimedia, Computer Graphics and Broadcasting, Jeju, South Korea, Nov. 2015, pp. 19-21.
    [2] Manishkumar Dholu, Mrs. K. A. Ghodinde, “Internet of Things (IoT) for Precision Agriculture Application,” in 2nd International Conference on Trends in Electronics and Informatics, Tirunelveli, India, May 2018, pp. 339-342.
    [3] Bhabendu Kumar Mohanta, Soumyashree S Panda, Debasish Jena, “An Overview of Smart Contract and Use Cases in Blockchain Technology,” in 9th International Conference on Computing, Communication and Networking Technologies, Bangalore, India, July 2018, pp. 1-4.
    [4] “Nonce,” Bitcoin Wiki. [Online]. Available: https://en.bitcoin.it/wiki/Nonce [Accessed: July 2019].
    [5] “Ethereum,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/Ethereum/ [Accessed: July 2019].
    [6] “Public vs Private Blockchains: What’s the Difference?”, BMC Software, Inc. [Online]. Available: https://www.bmc.com/blogs/public-vs-private-blockchain/ [Accessed: July 2019].
    [7] “Beginners guide to Ethereum (3) — explain the genesis file and use it to customize your blockchain,” Taipei Ethereum Meetup. [Online]. Available: https://medium.com/taipei-ethereum-meetup/beginners-guide-to-ethereum-3-explain-the-genesis-file-and-use-it-to-customize-your-blockchain-552eb6265145 [Accessed: July 2019].
    [8] “Inside an Eth transaction,” A Medium Corporation [US]. [Online]. Available: https://medium.com/@codetractio/inside-an-ethereum-transaction-fa94ffca912f [Accessed: June 2019].
    [9] “Ethereum/web3.js,” GitHub, Inc. [Online]. Available: https://github.com/ethereum/web3.js/ [Accessed: June 2019].
    [10] “Smart Contracts,” blockchainhub.net. [Online]. Available: https://blockchainhub.net/smart-contracts/ [Accessed: June 2019].
    [11] “Remix – Solidity IDE,” Remix.ethereum.org. [Online]. Available: http://remix.ethereum.org/ [Accessed: June 2019].
    [12] “Metamask” [Online]. Available: https://metamask.io/ [Accessed: July 2019].
    [13] “What is a light client and why you should care?”, 2019 Parity Technologies. [Online]. Available: https://www.parity.io/what-is-a-light-client/ [Accessed: July 2019].
    [14] Pallavi S., Jayashree D. Mallapur, Kirankumar Y. Bendigeri, “Remote Sensing and Controlling of Greenhouse Agriculture Parameters based on IoT,” in International Conference on Big Data, IoT and Data Science, Pune, India, Dec. 2017, pp. 44-48.
    [15] Danco Davcev, Kosta Mitreski, Stefan Trajkovic, Viktor Nikolovski, Nikola Koteli, “IoT agriculture system based on LoRaWAN,” in 14th IEEE International Workshop on Factory Communication Systems (WFCS), Imperia, Italy, June 2018, pp. 1-4.
    [16] Ali Dorri, Salil S. Kanhere, Raja Jurdak, Praveen Gauravaram, “Blockchain for IoT Security and Privacy: The Case Study of a Smart Home,” in IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops), Kona, HI, USA, March 2017, pp. 618-623.
    [17] Chao Xie, Yan Sun, Hong Luo, “Secured Data Storage Scheme based on Block Chain for Agricultural Products Tracking,” in 3rd International Conference on Big Data Computing and Communications, Chengdu, China, Aug. 2017, pp. 45-50.
    [18] Johannes Hinckeldeyn, Jochen Kreutzfeldt, “Developing a smart storage container for a Blockchain-based supply chain application,” Crypto Valley Conference on Blockchain Technology (CVCBT), Zug, Switzerland, June 2018, pp. 97-100.
    [19] Miguel Pincheira Caro, Muhammad Salek Ali, Massimo Vecchio, Raffaele Giaffreda, “Blockchain-based traceability in Agri-Food supply chain management: A practical implementation,” IoT Vertical and Topical Summit on Agriculture - Tuscany (IOT Tuscany), Tuscany, Italy, June. 2018.
    [20] Mark Kim, Brian Hilton, Zach Burks, Jordan Reyes, “Integrating Blockchain, Smart Contract-Tokens, and IoT to Design a Food Traceability Solution,” IEEE 9th Annual Information Technology, Electronics and Mobile Communication Conference (IEMCON), Vancouver, BC, Canada, January 2019.
    [21] Khaled Salah, Nishara Nizamuddin, Raja Jayaraman, Mohammad Omar, “Blockchain-Based Soybean Traceability in Agricultural Supply Chain,“ IEEE Access, May 2019, pp. 73295-73305.
    [22] “Near-field communication,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/Near-field_communication/ [Accessed: July 2019].
    [23] “Schedule Tasks on Linux Using Crontab,” Kevin van Zonneveld. [Online]. Available: https://kvz.io/blog/2007/07/29/schedule-tasks-on-linux-using-crontab/ [Accessed: July 2019].
    [24] “A Beginners Guide To Cron Jobs,” OSTechNix. [Online]. Available: https://www.ostechnix.com/a-beginners-guide-to-cron-jobs/ [Accessed: July 2019].
    [25] “Representational state transfer,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/Representational_state_transfer/ [Accessed: July 2019].
    [26] “Tsing Hua Agriculture IoT Platform,” National Tsing Hua University High Speed Network Lab. [Online]. Available: http://nthu-smart-farming.kits.tw:8080/ [Accessed: July 2019].
    [27] “Secure Hash Algorithms,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms/ [Accessed: July 2019].
    [28] “Pigeonhole principle,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/Pigeonhole_principle/ [Accessed: July 2019].
    [29] “Hash Collision” ScienceDirect. [Online]. Available: https://www.sciencedirect.com/topics/computer-science/hash-collision [Accessed: July 2019].
    [30] “How likely are hash collisions?”, Bitcache – Distriubuted, content-addressable data storage. [Online]. Available: http://web.archive.org/web/20110725085124/http:/bitcache.org/faq/hash-collision-probabilities [Accessed: July 2019].
    [31] “Announcing the first SHA1 collision, ” Google Security Blog. [Online]. Available: https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html [Accessed: July 2019].
    [32] “Merkle tree,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/Merkle_tree/ [Accessed: June 2019].
    [33] “web3.js - Ethereum JavaScript API,” Ethereum community. [Online]. Available: https://web3js.readthedocs.io/en/1.0/ [Accessed: July 2019].
    [34] “Time complexity,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/ Time_complexity/ [Accessed: July 2019].
    [35] “ASCII, decimal, hexadecimal, octal, and binary conversion table,” IBM Knowledge Center. [Online]. Available: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/network/conversion_table.html [Accessed: July 2019].
    [36] “Using Merkle trees to detect inconsistencies in data,” [Online]. Available: https://distributeddatastore.blogspot.com/2013/07/cassandra-using-merkle-trees-to-detect.html?fbclid=IwAR1hmcnXCNfEZbJmFiohmq/ [Accessed: June 2019].
    [37] N. Komninos, E. Philippou, and A. Pitsillides, “Survey in smart grid and smart home security: Issues, challenges and countermeasures,” IEEE Communications Surveys & Tutorials, Vol. 16, No. 4, 2014, pp. 1933–1954.
    [38] “Confidentiality, Integrity, and Availability,” MDN. [Online]. Available:https://developer.mozilla.org/en-US/docs/Web/Security/Information_Security_Basics/Confidentiality,_Integrity,_and_Availability [Accessed: June 2019].
    [39] “Blockchain: how a 51% attack works (double spend attack),” A Medium Corporation [US]. [Online]. Available: https://medium.com/coinmonks/what-is-a-51-attack-or-double-spend-attack-aa108db63474 [Accessed: June 2019].
    [40] “Socket.io” [Online]. Available: https://socket.io/ [Accessed: July 2019].
    [41] “Node.js,” [Online]. Available: https://nodejs.org/en/ [Accessed: July 2019].
    [42] “Connecting MyEtherWallet, Mist, and MetaMask to Your Private Blockchain,” Bitfalls. [Online]. Available: https://bitfalls.com/2018/03/26/connecting-myetherwallet-mist-metamask-private-blockchain/ [Accessed: July 2019].
    [43] “Ether,” Ethereum community [Online]. Available: http://ethdocs.org/en/latest/ether.html [Accessed: July 2019].
    [44] “Google Cloud,” [Online]. Available: https://cloud.google.com/ [Accessed: July 2019].
    [45] “ERC-20,” En.wikipedia.org. [Online]. Available: https://en.wikipedia.org/wiki/ERC-20 [Accessed: July 2019].
    [46] “How to create an ERC20 token?” Hackernoon. [Online]. Available: https://hackernoon.com/how-to-create-an-erc20-token-b9e935353ac [Accessed: July 2019].
    [47] “Draw.io” [Online]. Available: https://www.draw.io/ [Accessed: July 2019].

    QR CODE