Python in Chains: Running Python Code for IoT Projects on a custom-built Blockchain Network

슬라이드


https://www.slideshare.net/DanielHong64/pycon-korea-2018-python-in-chains-running-python-code-for-iot-projects-on-a-custombuilt-blockchain-network-110606011

발표 동영상


https://www.youtube.com/watch?v=g6d53szoIIs

설명



(This session is an English presentation; however, a description for this session is provided in both English and Korean below. A detailed description is only available through Google Docs in English.)

(이 세션은 영어로 진행되는 세션입니다. 하지만, 이 세션에 관한 설명은 아래에 영어와 한국어 모두로 제공됩니다. 보다 자세한 설명은 하단의 Google Docs 링크를 통해 영어로만 제공됩니다.)


English / 영어


    This talk covers the journey of running Python code as a blockchain (Ethereum) Smart Contract by implementing a modified Python runtime environment / Ethereum Virtual Machine software, and building a blockchain based home device network with the modified runtime and Smart Contract code written in Python.


This session will cover: (i) An Overview of the Python Runtime/Interpreter & Modifying it to run Python code on a distributed blockchain network (creating a blockchain-based Python runtime); (ii) Building a custom blockchain network based on PyEthereum & other blockchain projects written in Python; (iii) Creating a truly serverless, peer-to-peer IoT network system prototype that is secure & responds to user actions without a separate control server.


Additionally, this session will also cover the following topics as an introduction: (i) Writing a simple Smart Contract with the Solidity language; (ii) Building & Deploying the Smart Contract on a sample Ethereum blockchain using the Populus framework, a toolkit for building Ethereum smart contracts with the Python language; (iii) Using this technique to build an Ethereum-based IoT network with smart contracts using the Python language.


In a nutshell, this session covers my experience of creating a blockchain-based IoT network using the Python language, starting from the version built on Populus and Solidity. Then, I will expand the topic to my attempt of modifying the Python runtime to produce EVM bytecode instead of standard Python bytecode to take advantage of Python’s language features while building a smart contract that powers my own home network (to code in Python full-stack). Finally, I present my implementation of the Python-EVM runtime mentioned above and show an unfinished prototype of my home IoT network based on this modified framework.


To better understand this session, participants need a basic understanding of: (i) The fundamentals of Python’s Runtime & Interpreter structure; (ii) The basics of Python’s compilation & the Python bytecode (executed by the Python Interpreter); (iii) The fundamentals of blockchain, EVM and Ethereum’s Smart Contracts system.


By attending this session, participants will be able to better understand Python and Ethereum’s internal structure and be introduced to a possible application of Python running on the now-trending blockchain technology. Also, participants will be able to migrate their existing Python code to an Ethereum Smart Contract, which is expected to have a tremendous impact in the near future.


More detailed information about this talk / session is available on: https://docs.google.com/document/d/1e4RY6Jzqe61zWMeUGWkeoJ05CoXtfAWHwVjqh-v5Cg0/edit


한국어 / Korean


    (세션 제목) 블록체인에 감긴 파이썬: 커스텀 제작된 블록체인 네트워크 상 IoT 프로젝트를 위한 파이썬 코드의 분산 실행


    본 발표는 파이썬 코드를 Ethereum 블록체인에서 구동될 수 있는 Smart Contract로 구동할 수 있도록 하는 삽질의 여정을 다룹니다. 보다 상세하게는, 상기의 목적에 맞도록 수정된 파이썬 런타임과 Ethereum Virtual Machine (EVM) 소프트웨어를 구현하고, 이를 사용하여 블록체인 기반의 가정 IoT 네트워크 위에서 파이썬 언어로 작성된 Smart Contract 코드를 작성하는 것에 관하여 다룹니다.


    본 세션은 다음의 내용을 다룰 것입니다: (i) 파이썬 런타임 및 인터프리터의 구조론적 개요와, 블록체인 위에서 파이썬 코드를 구동하는 일이 가능하도록 이를 수정하는 작업 과정; (ii) PyEthereum 및 기타 다른 블록체인 프로젝트의 소스 코드를 사용하여 커스텀 블록체인 네트워크를 구축하는 작업 과정; (iii) 상기의 작업 결과를 활용하여 진정한 '서버리스' (Serverless) 환경에서 구축되었으며, 중앙 서버 없이도 안전하고 사용자 동작에 반응하는 피어-투-피어 (P2P) IoT 네트워크 시스템 프로토타입의 제작 과정.


    추가적으로, 본 세션은 다음의 내용을 블록체인 기술에 관한 간략한 소개로서 다룰 것입니다: (i) Solidity 언어로 간단한 Smart Contract 작성하기; (ii) 앞서 작성된 Smart Contract를 Populus 프레임워크 (파이썬 언어와 연동하여 Ethereum Smart Contract를 개발할 수 있도록 하는 툴킷) 를 사용해 개발하고 배포하기; (iii) 상기의 기술들을 활용하여 파이썬 언어와 연동 가능한 Smart Contract를 구동하는 Ethereum 기반의 IoT 네트워크 구축.


    요약하자면, 이 세션은 Populus와 Solidity로 제작된 버전부터 시작하여 파이썬 언어를 이용해 블록체인 기반의 IoT 네트워크를 구축하는 저의 여정을 다룹니다. 또한, 파이썬 언어만을 사용하는 Full-Stack 개발이 가능하도록 하기 위하여, 파이썬 코드 빌드 시 표준 파이썬 바이트코드 대신 EVM 바이트코드를 생성하도록 파이썬 런타임을 개조함으로써 파이썬의 언어 특성을 모두 활용하면서도 저의 가정 네트워크를 구동시킬 수 있는 Smart Contract를 개발할 수 있도록 한 저의 시도까지 주제를 확장할 것입니다. 마지막으로, 상기 언급된 파이썬-EVM 런타임의 개인적인 구현 및 그 구조를 설명하고, 이 개조된 프레임워크를 이용해 개발 중인 제 가정 IoT 네트워크의 프로토타입을 소개합니다.


    이 세션을 보다 잘 이해하기 위해서, 참석자들은 다음과 같은 기본 지식을 갖출 것이 권장됩니다: (i) 파이썬의 런타임 및 인터프리터 구조론의 기초; (ii) 파이썬의 컴파일 과정과 (파이썬 인터프리터에 의해 실행되는) 파이썬 바이트코드의 구조에 관한 이해; (iii) 블록체인 기술과 EVM, 그리고 Ethereum의 Smart Contracts 시스템에 관한 기초 지식.


    이 세션에 참여함으로써, 참석자들은 파이썬과 Ethereum의 내부 구조에 관하여 더 잘 이해하고, 현재 트렌드인 블록체인 기술을 이용하여 실행되는 파이썬의 (새로운) 활용 예시를 소개받을 수 있습니다. 또한, 참석자들은 가까운 미래에 커다란 영향을 미칠 것으로 예상되는 Ethereum Smart Contract 실행코드로 이미 작성된 파이썬 코드를 이전하는 법을 배울 수 있습니다.


댓글

blog comments powered by Disqus

후원사 목록

다이아몬드

사파이어

플래티넘

골드

실버

커뮤니티

미디어