KR20200065662A - P2p energy transaction platform using hyperledger - Google Patents

P2p energy transaction platform using hyperledger Download PDF

Info

Publication number
KR20200065662A
KR20200065662A KR1020180152338A KR20180152338A KR20200065662A KR 20200065662 A KR20200065662 A KR 20200065662A KR 1020180152338 A KR1020180152338 A KR 1020180152338A KR 20180152338 A KR20180152338 A KR 20180152338A KR 20200065662 A KR20200065662 A KR 20200065662A
Authority
KR
South Korea
Prior art keywords
transaction
energy
peer
hyperledger
chaincode
Prior art date
Application number
KR1020180152338A
Other languages
Korean (ko)
Inventor
임창균
장지원
Original Assignee
주식회사 로그인서광
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 로그인서광 filed Critical 주식회사 로그인서광
Priority to KR1020180152338A priority Critical patent/KR20200065662A/en
Publication of KR20200065662A publication Critical patent/KR20200065662A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E40/00Technologies for an efficient electrical power generation, transmission or distribution
    • Y02E40/70Smart grids as climate change mitigation technology in the energy generation sector
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S50/00Market activities related to the operation of systems integrating technologies related to power network operation or related to communication or information technologies
    • Y04S50/10Energy trading, including energy flowing from end-user application to grid

Landscapes

  • Business, Economics & Management (AREA)
  • Economics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Public Health (AREA)
  • Tourism & Hospitality (AREA)
  • Primary Health Care (AREA)
  • Human Resources & Organizations (AREA)
  • General Health & Medical Sciences (AREA)
  • Water Supply & Treatment (AREA)
  • Development Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention relates to a P2P energy transaction platform using hyperledger. An objective of the present invention is to propose the energy transaction platform adopting blockchain, which is a transparent, distributed, and secure transaction log recording method.

Description

하이퍼레저를 이용한 P2P 에너지 거래 플랫폼{P2P ENERGY TRANSACTION PLATFORM USING HYPERLEDGER}P2P energy trading platform using hyper leisure {P2P ENERGY TRANSACTION PLATFORM USING HYPERLEDGER}

본 발명은 P2P 에너지 거래 플랫폼에 관한 것이다.The present invention relates to a P2P energy trading platform.

최근 신 기후체제 합의에 따라 온실가스 배출량을 감축해야 함과 동시에 정부는 탈 원전정책을 시행함으로서 신재생에너지 사업이 발전이 필수적이며 개인이 태양광 등으로 전기를 스스로 생산 및 소비하는 프로슈머(Prosumer)가 증가하고 있다. In addition to the reduction of greenhouse gas emissions in accordance with the recent agreement on the new climate system, the government is implementing a de-nuclear power policy, so the development of a new and renewable energy business is essential, and an individual is a prosumer who produces and consumes electricity by itself, such as solar light. Is increasing.

본 발명은 신재생 에너지를 효율적으로 운용하기 위해 분산전원을 도입하며 동시에 개인의 입장에선 생산과 소비패턴에 따라 생산량이 남을 때 주변 소비자에 판매하고 부족한 경우엔 구매하는 에너지 효율적이며 대인에게 수익을 보장해주고 매우 작은 에너지 거래도 완전하고 지속적으로 추적할 수 있는 투명하고 분산되고 안전한 트랜잭션 로그 기록방식인 블록체인을 도입한 에너지 거래 플랫폼을 제안하는 것을 목적으로 한다.The present invention introduces a distributed power source to efficiently operate renewable energy, and at the same time, it is energy efficient to sell to neighboring consumers when the quantity of production remains according to the production and consumption patterns and purchase in case of shortage, and guarantee profits to the public. The goal is to propose an energy trading platform that introduces a blockchain that is a transparent, decentralized, and secure transaction log recording method that allows complete and continuous tracking of even very small energy transactions.

하이퍼레저를 이용한 P2P 에너지 거래 플랫폼.P2P energy trading platform using hyper leisure.

본 발명은 신재생 에너지를 효율적으로 운용하기 위해 분산전원을 도입하며 동시에 개인의 입장에선 생산과 소비패턴에 따라 생산량이 남을 때 주변 소비자에 판매하고 부족한 경우엔 구매하는 에너지 효율적이며 대인에게 수익을 보장해주고 매우 작은 에너지 거래도 완전하고 지속적으로 추적할 수 있는 투명하고 분산되고 안전한 트랜잭션 로그 기록방식인 블록체인을 도입한 에너지 거래 플랫폼을 제안할 수 있다. The present invention introduces a distributed power source to efficiently operate renewable energy, and at the same time, it is energy efficient to sell to neighboring consumers when the quantity of production remains according to the production and consumption patterns and purchase in case of shortage, and guarantee profits to the public. It is possible to propose an energy trading platform that introduces a blockchain that is a transparent, decentralized, and secure transaction log recording method that can fully and continuously track even small and very small energy transactions.

[도 1] 전형적인 하이퍼레저 네트워크 구조
[도 2] World state
[도 3] 에너지 거래 흐름도
[도 4] MSP와 채널과
[도 5] 체인코드 실행 예시
[도 6] invoke 함수 예시
[도 7] query 함수 예시
[도 8] 판매자 정보
[도 9] 구매자 정보
[도 10] 알고리즘 예시 코드
[도 11]은 판매자 입장에서의 알고리즘의 순서도이다.
[도 12] 간단한 블록 구조
[Figure 1] Typical hyperledger network structure
[Figure 2] World state
[Figure 3] Energy transaction flow chart
[Figure 4] MSP and channel
[Figure 5] Chain code execution example
[Figure 6] Example invoke function
[Figure 7] Example query function
[Fig 8] Seller Information
[Fig 9] Buyer Information
[Figure 10] Algorithm example code
11 is a flowchart of the algorithm from the seller's point of view.
[Figure 12] Simple block structure

Ⅰ. IntroductionⅠ. Introduction

최근 신 기후체제 합의에 따라 온실가스 배출량을 감축해야 함과 동시에 정부는 탈 원전정책을 시행함으로서 신재생에너지 사업이 발전이 필수적이며 개인이 태양광 등으로 전기를 스스로 생산 및 소비하는 프로슈머(Prosumer)가 증가하고 있다. 그러나 전력 생산과 소비 패턴이 다른 경우가 많아 저장 문제가 발생하며 한전을 중심으로 중앙 집중형 거래 및 발전은 송전에서 발생하는 에너지 손실 등 에너지 효율의 관점에서도 좋지 못하다.In addition to the reduction of greenhouse gas emissions in accordance with the recent agreement on the new climate system, the government is implementing a de-nuclear power policy, so the development of a new and renewable energy business is essential, and an individual is a prosumer who produces and consumes electricity by itself, such as solar light. Is increasing. However, the power generation and consumption patterns are often different, resulting in storage problems, and centralized transactions and power generation centering on KEPCO are also not good in terms of energy efficiency, such as energy loss in power transmission.

신재생 에너지를 효율적으로 운용하기 위해 분산전원을 도입하며 동시에 개인의 입장에선 생산과 소비패턴에 따라 생산량이 남을 때 주변 소비자에 판매하고 부족한 경우엔 구매하는 에너지 효율적이며 대인에게 수익을 보장해주고 매우 작은 에너지 거래도 완전하고 지속적으로 추적할 수 있는 투명하고 분산되고 안전한 트랜잭션 로그 기록방식인 블록체인을 도입한 에너지 거래 플랫폼을 제안한다. In order to efficiently operate renewable energy, a distributed power source is introduced, and at the same time, it is energy efficient to sell to neighboring consumers when the quantity of production remains according to the production and consumption patterns and purchase in the case of shortage. We propose an energy trading platform that introduces a blockchain that is a transparent, distributed, and secure transaction log recording method that can fully and continuously track energy transactions.

에너지생산 및 소비패턴을 분석함과 동시에 발전기, 송전/수전 데이터를 포함한 전력 생산, 송수신 및 거래 디바이스를 등록하고 해당 기기들로부터 데이터를 받아 AWS에서 지원하는 Hyperledger Fabric Magic용 AWS Blockchain Template를 활용해 처리 속도가 빠르며 효율적인 탈중앙화 P2P거래를 제안한다. Analyze energy production and consumption patterns, register power generation, transmission and reception and transaction devices including generators and transmission/reception data, receive data from the devices, and process it using AWS Blockchain Template for Hyperledger Fabric Magic supported by AWS We propose fast and efficient decentralized P2P transactions.

하이퍼레저는 분산 소프트웨어 아키텍쳐를 제공해 매우 작은 에너지 거래도 완전하고 지속적으로 추적할 수 있는 투명하고 분산되고 안전한 트랜잭션 로그를 기록하므로 기존의 중앙 대규모 집중 방식보다 훨씬 효율적으로 소규모 에너지 거래가 포함된 에너지 시장을 위한 플랫폼에 적절히 대응할 것으로 기대된다. Hyperledger provides a distributed software architecture that records transparent, decentralized, and secure transaction logs that enable complete and continuous tracking of very small energy transactions, making it much more efficient for energy markets with smaller energy transactions than traditional centralized and large-scale methods. It is expected to respond appropriately to the platform.

Ⅱ. Hyperledger FabricⅡ. Hyperledger Fabric

일반적으로 블록체인하면 가장 널리 알려진 응용 프로그램인 비트코인(Bitcoin)과 대안인 이더리움(Ethereum)은 공개형(public), 무허가형(permissionless) 블록체인 기술로 참가자의 신원을 요구하기가 어려워 금융거래의 경우 KYC(Know-Your-Customer)이나 AML(Anti- Money Laundering) 규정을 준수하기 어렵다. In general, Bitcoin, which is the most widely known application, and Ethereum, which is an alternative to blockchain, is a public and permissionless blockchain technology that makes it difficult to request the identity of the participants. In the case of KYC (Know-Your-Customer) or AML (Anti-Money Laundering), it is difficult to comply.

Hyperledger Fabric은 이러한 점을 개선해 처음부터 엔터프라이즈용으로 설계되어 사설(private)이면서 허가형(permissioned)으로 참가자는 인증되어 식별 가능하고 네트워크 관리가 가능하며 트랜잭션 처리량이 높지만 트랜잭션 지연이 낮고 거래와 거래관련 데이터의 기밀성이 유지된다. 또한 고도의 기밀성, 탄력성, 유연성 및 확장성을 제공하는 모듈러 아키텍쳐를 기반으로 하고 있어 MSP(Membership Service Provider)를 통해 사용자와 각 노드들을 등록해 신원 관리를 하며 거래 내용인 원장 데이터는 다양한 DB 모듈을 사용해 다양한 형태로 저장이 가능하며 합의 매커니즘도 모듈화 되어 다양한 알고리즘을 지원한다. 분산 원장 솔루션을 위한 플랫폼으로 모듈형 블록체인 아키텍처에서 엔터프라이즈 급 네트워크 보안, 확장성, 기밀성 및 성능을 제공하는 분산 원장 기술(DLT)의 고유한 구현으로 신원관리, 개인 정보 보호 및 기밀 유지, 효율적인 처리, 체인 코드 기능, 모듈식 디자인을 지원한다. Hyperledger Fabric improves this and is designed for the enterprise from the ground up, making it private and permissive, allowing participants to be authenticated, identifiable, network manageable, high transaction throughput, low transaction latency, low transaction and transaction related data. Confidentiality is maintained. In addition, it is based on a modular architecture that provides a high level of confidentiality, resilience, flexibility, and scalability. It registers users and each node through MSP (Membership Service Provider) to manage identities. It can be used to store in various forms, and the consensus mechanism is modularized to support various algorithms. A unique implementation of Distributed Ledger Technology (DLT) that provides enterprise-class network security, scalability, confidentiality, and performance in a modular blockchain architecture as a platform for distributed ledger solutions. Identity management, privacy and confidentiality, and efficient processing , Chaincode function, modular design support.

Ⅲ. Hyperledger ArchitectureⅢ. Hyperledger Architecture

하이퍼레저의 구조는 사용자는 어플리케이션을 통해 피어로서 채널에 접속해 지정된 체인코드를 통해 다른 피어들과 채널 상에서 트랜잭션을 진행하며 각각의 채널은 각각의 정책을 가지고 있다. 각 피어들 사이에서 이루어진 트랜잭션은 오더링 서비스에서 네트워크 정책에 따라 순서를 정하고 블록을 생성해 모든 피어들에게 배포한다. MSP에서는 관리자를 포함해 모든 노드와 채널, 네트워크와 각 트랜잭션의 CA역할을 한다. [도 1]은 전형적인 하이퍼레저 네트워크 구조를 보여주고 있다. Hyperledger's structure allows users to access channels as peers through applications, and conduct transactions on channels with other peers through designated chaincodes, and each channel has its own policy. Transactions made between each peer are ordered according to the network policy in the ordering service, and blocks are created and distributed to all peers. In MSP, it plays the role of CA for all nodes, channels, networks, and each transaction, including administrators. Figure 1 shows a typical hyper-leisure network structure.

Ⅳ. 하이퍼레저에서 사용하는 용어들Ⅳ. Terms used in Hyper Leisure

하이퍼레저에서 사용되는 용어들은 다음 [표 1]과 같다. The terms used in hyper leisure are as follows [Table 1].

피어(Peer)Peer 원장(Ledger)를 유지하고 체인코드(Chaincode)를 실행하며 디지털 원장, 태른잭션(Transactions), 스마트계약(Smart contract)를 관리한다. 거래를 확정(Commit)하는 역할을 하며 정책(Policy)에 따라 보증(Endorsing)역할을 수행함.
원장에 블록 형태로 거래 정보를 저장(Persist)하고 거래 실행 결과에 따른 상태 정보를 저장하는 상태저장소(State store)로 구성되는 블록체인을 유지한다.
Maintain Ledger, execute Chaincode, and manage digital ledger, transactions, and smart contract. It acts to commit the transaction and plays the role of endorsing according to the policy.
Maintain a blockchain consisting of a state store that stores transaction information in the form of a block in the ledger (persist) and stores state information according to the result of the transaction execution.
원장(Ledger)Ledger 순차적이고 변조 불가능한 데이터들을 체인 형태로 구성한 개념으로 트랜잭션과 World state를 포함한 암호화된 블록체인이다. 체인코드로 World state를 변경함.This is a concept that consists of sequential and non-tamperable data in the form of a chain, and is an encrypted blockchain including transactions and world state. Changed world state with chaincode. World stateWorld state 특정 시점의 원장의 데이터로 트랜잭션에 의해 체인코드가 호출될 때 상태 및 데이터 저장을 위한 Key-Value 기반의 데이터 베이스라 할 수 있다. 현재 LevelDB나 CouchDB 등 지원한다. ([도 2] 참고)It can be said to be a key-value-based database for storing state and data when the chain code is called by a transaction with data of the ledger at a specific point in time. Currently, it supports LevelDB and CouchDB. (See [Figure 2]) Transaction logTransaction log World state의 업데이트 이력을 유지하고 있다.It maintains a history of updating the world state. 체인코드(Chaincode)Chaincode 하이퍼레저에서는 스마트계약(Smart Contract)를 체인코드라고 하며 다양한 트랜잭션 유형을 구현한 로직 코드로 블록체인에서 배포되고 수행된다. 각 노드(Peer 혹은 Orderer 등)가 실행의 주체이며 트랜잭션이 실행되고 유효성이 확인되면 공유원장에 추가하고 World state에서 Key-Value쌍에 접근과 수정. 배포(Deploy), 호출(Invoke), 조회(Query) 등의 기능을 수행함. (6장 체인코드에서 더욱 구체적으로 설명)In Hyperledger, smart contracts are called chain codes, and logic codes that implement various transaction types are distributed and executed on the blockchain. Each node (Peer or Orderer, etc.) is the subject of execution, and when the transaction is executed and validated, it is added to the shared ledger and access and modification of key-value pairs in the world state. It performs functions such as deployment, invoke, and query. (More details in Chapter 6 Chaincode) 보증(Endorsing)Endorsing 클라이언트의 보증 요청에 따라 해당 체인코드를 실행하고 결과를 보증하는 역할을 수행함. 보증 노드와 보증 방법은 체인코드와 연계된 보증 정책에 의해 결정되고 보증 정책은 체인코드와 함께 작성해 체인 코드가 블록에 배치될 때 함께 배치한다.It executes the corresponding chaincode according to the client's warranty request and guarantees the result. The guarantee node and the guarantee method are determined by the guarantee policy associated with the chaincode, and the guarantee policy is written together with the chaincode and placed together when the chaincode is placed in a block. MSP(Membership Service Provider)Membership Service Provider (MSP) 사용자의 ID를 등록, 관리하며 하이퍼레저 패브릭에 접속하는 모든 노드(관리자, 일반 사용자를 포함한 모든 Peer)의 신원을 확인 후 네트워크 접속 권한(Credentials)(=인증서)을 발급함. 공개키 기반의 인증기관(CA)을 통해 공개키 인증서와 개인키를 자격 증명으로 발급, 검증가능성(Auditability)을 확보할 수 있다.
다른 모든 인증서를 파생시켜 해당 조직의 구성원임을 검증(Root CA)하고 Org의 구성단위, 관리자, 노드 ID, 개인키용 키 저장소를 역할을 하며 신원 확인을 위해 장기적으로 E-Cert(Enrollment Certificate), 각 트랜잭션마다 단기적으로 T-Cert(Transaction Certificate), 통신 채널단위에서 TLS(전송계층보안, SLS도 포함)를 관리한다.
It registers and manages the user's ID and verifies the identity of all nodes (administrators, general peers, etc.) accessing the hyperledger fabric and issues network access credentials (=certificates). Public key certificates and private keys can be issued as credentials through a public key-based certification authority (CA) to ensure auditability.
It derives all other certificates and verifies that it is a member of the organization (Root CA), acts as a key store for Org's constituent units, administrators, node IDs, and private keys, and provides long-term E-Cert (Enrollment Certificate) In the short term, each transaction manages T-Cert (Transaction Certificate) and TLS (including transport layer security and SLS) at the communication channel level.
Orderer(Ordering service node)Orderer (Ordering service node) 합의(Consensus) 알고리즘에 따라 클라이언트들로부터 제안되는 거래를 순서화 시켜 피어 노드에 전달하는 역할을 하며 거래 메시지들을 순서화 시켜 채널에 연결된 모든 피어들에게 블록 형태로 전달한다. 각 피어에 전달되는 거래 메시지들이 동일한 순서로, 안전하게 전달되는 것을 보장한다.It serves to order the proposed transactions from clients according to the consensus algorithm and deliver them to the peer node. It orders the transaction messages and delivers them in block form to all peers connected to the channel. It ensures that transaction messages delivered to each peer are delivered safely in the same order. Org(Organization)Org(Organization) 피어를 관리하는 (논리적)조직 단위(Logical) organizational unit that manages peers 채널(Channel)Channel 피어와 어플리케이션간 원장을 공유하기 위한 데이터 격리와 기밀성을 유지하는 프라이빗 블록체인 가상 네트워크로 한 채널당 하나의 원장이 있고 해당 채널의 모든 피어가 공유하며 거래 당사자는 상호작용 하기 위해 채널에 올바르게 인증 되어야함.A private blockchain virtual network that maintains data isolation and confidentiality to share ledgers between peers and applications, with one ledger per channel, shared by all peers on that channel, and trading parties must be properly authenticated to the channel to interact .

Ⅴ. 거래 흐름(Transaction Flow)Ⅴ. Transaction Flow

하이퍼레저에서 트랜잭션의 순서는 다음과 같이 진행된다. 먼저 클라이언트가 트랜잭션을 시작하면 원장에 데이터를 읽고 쓸 수 있도록 체인코드 함수를 호출(invoke)할 수 있는 거래 제안서를 작성하고 SDK는 트랜잭션 제안서를 패키징하고 사용자의 암호화 자격 증명을 사용해 트랜잭션 제안서에 고유한 서명을 생성한다. 그 후 보증 피어가 서명과 함께 구성, 유효성, 정책 등을 확인하고 현재 상태 DB에 대해 체인 코드를 실행하여 응답 트랜잭션을 생성, 실행한다(이 시점에선 원장이 업데이트 되지 않음). 응용프로그램(SDK)은 피어의 서명과 조건이 맞는지 확인하고 피어들로부터 받은 보증이 포함된 트랜잭션을 모아 오더 시스템에 보내고 트랜잭션 메시지를 오더 서비스에 브로드캐스팅한다. 오더 서비스는 거래 내용은 검사하지 않으며 단순히 모든 채널로부터 수신한 메시지를 정책에 따라 순서대로 배치하고 채널당 블록을 생성한다. 트랜잭션 블록은 모든 피어에 전달되고, 승인 정책과 유효성 등을 검사하고 트랜잭션으로 원장 상태가 변경되는지 확인 후 변경된다면 원장을 업데이트 한다. 각 피어는 블록을 채널 체인에 추가하고 유효한 트랜잭션은 현재 상태 DB에 커밋한다. In Hyperledger, the order of transactions proceeds as follows. First, when a client initiates a transaction, it creates a transaction proposal that can invoke a chaincode function to read and write data to the ledger, and the SDK packages the transaction proposal and uses the user's cryptographic credentials to make it unique to the transaction proposal. Generate a signature. After that, the assurance peer checks the configuration, validity, policy, etc. along with the signature and executes the chain code against the current state DB to generate and execute the response transaction (the ledger is not updated at this point). The application program (SDK) verifies that the peer's signature and conditions are met, collects the transaction containing the guarantees received from the peers, sends it to the order system, and broadcasts the transaction message to the order service. The order service does not check the transaction details, it simply places the messages received from all channels in order according to the policy and creates blocks per channel. The transaction block is delivered to all peers, checks the approval policy and validity, checks whether the status of the ledger is changed by the transaction, and updates the ledger if it is changed. Each peer adds a block to the channel chain and commits a valid transaction to the current state DB.

[도 3]은 피어 내에서의 동작도 포함해 이를 도식화 한 것으로 1. 사용자가 응용프로그램을 통해 피어에 연결하고 2. 피어에 invoke문을 포함한 거래요청 체인코드를 보내면 3. 피어는 체인코드를 호출하고 4 체인코드에서 현재 상태를 query로 읽어와 요청에 응답한다. 5. 피어는 사용자의 요청에 응답하고 6. 응용프로그램은 응답받은 보증과 트랜잭션을 오더러에 보내 7. 오더러는 받은 트랜잭션에 순서를 매기고 블록형태로 각 피어에 전달하면 8. 피어는 받은 내용을 통해 원장을 업데이트하는 순서를 나타내며 [도 4]는 MSP와 채널의 개념을 포함한 그림으로 사용자는 MSP로부터 거래 참여자 인증서를 발급받고 블록체인 가상 네트워크 채널에 가입한다. 판매, 구매를 결정하고 그에 맞게 값을 입력하면 Transaction Flow에 따라 각 피어에 거래를 요청하고 응답받는다. 모든 거래가 완료되면 오더링 서비스는 모든 피어에 트랜잭션을 블록으로 전송하고 이후 각 피어는 원장을 업데이트한다. [Figure 3] is a schematic diagram including the operation within the peer. 1. When the user connects to the peer through an application program 2. When the transaction request chain code including the invoke statement is sent to the peer 3. The peer sends the chain code Call and read the current status from the 4 chain code as a query and respond to the request. 5. The peer responds to the user's request 6. The application sends the received guarantee and transaction to the orderer 7. The orderer orders the received transaction and delivers it to each peer in block form 8. The peer receives the received content Fig. 4 shows the sequence of updating the ledger through the concept of the MSP and the channel, and the user receives the transaction participant certificate from the MSP and subscribes to the blockchain virtual network channel. If you decide to sell or purchase and enter values accordingly, each transaction is requested and replied to according to the transaction flow. When all transactions are completed, the ordering service sends a transaction to all peers in blocks, and each peer then updates the ledger.

Ⅵ. 체인 코드 (ChainCode)Ⅵ. Chain Code

체인코드는 고급 프로그래밍 언어인 Go, Node.js, Java로 작성이 가능하도록 지원되며 배포(Deploy), 호출(Invoke), 조회(Query)의 역할을 한다. Chaincode is supported to be written in high-level programming languages Go, Node.js, and Java, and serves as deployment, invoke, and query.

배포는 install(), instantiate() 등으로 피어의 파일 시스템에 체인 코드를 배치하고 특정 채널에서 체인 코드 응용 프로그램을 시작하고 초기화하는 역할이다. 인스턴스 생성 후 체인 코드가 설치된 피어는 호출을 받아들일 수 있으며 해당 내용은 블록에 기록된다. Distribution is the role of placing chaincode in the peer's file system with install(), instantiate(), etc. and starting and initializing the chaincode application on a specific channel. After instantiation, the peer with the chaincode installed can accept the call and its contents are recorded in the block.

호출은 invoke() 등으로 체인코드 함수를 호출하고 Client가 Peer에게 요청하거나 Peer가 Client에게 응답하는 등의 내용이며 블록에 기록된다. The call is the contents such as calling the chaincode function with invoke(), the Client requesting the Peer, or the Peer responding to the Client, etc. and recorded in the block.

조회는 query() 등으로 체인코드를 통해 KVS에서 데이터를 읽으며 블록에 기록되지 않는다. Query is read from KVS through chaincode with query(), etc. and is not recorded in the block.

체인코드의 실행 예시는 [도 5]의 첫 번째 줄부터 각각 체인코드를 설치하고 인스턴스화, 버전 업데이트, 업그레이드, 데이터 조회, 거래를 호출하는 코드이며 [도 6]은 invoke 함수 구조의 예시이며 [도 7]은 query 함수의 예시이다. The execution example of the chaincode is the code that installs the chaincode from the first line of [Figure 5] and calls instantiation, version update, upgrade, data inquiry, transaction, and [Figure 6] is an example of the invoke function structure and [Figure 7] is an example of the query function.

Ⅶ. 에너지 거래 시스템Ⅶ. Energy trading system

거래 시스템은 원장의 자산을 query하고 update하는 과정이며 어플리케이션과 네트워크 간 연동으로 어플리케이션이 API를 통해 스마트계약(=체인코드)을 호출하면 [표 2]와 같은 형식의 체인코드 컨테이너로 구성되어 동작한다. The transaction system is a process of querying and updating the assets of the ledger, and when the application calls the smart contract (=chain code) through the API through interworking between the application and the network, it consists of a chain code container of the form shown in [Table 2] and operates. .

이름name fabcarfabcar 버전version 1.01.0 실행 피어Running peer dev-peer0.org1.example.comdev-peer0.org1.example.com

사용자는 구매 할 것인지 판매 할 것인지 선택 후 판매라면 즉시 판매가(kWh/원), 최소판매가(kWh/원), 판매량(kWh), 경매시간(hour)을 등록하고 구매라면 구매 가격(kWh/원)과 구매량(kWh)을 입력한다. 판매자의 (즉시 판매가)가 (구매가)보다 작다면 바로 거래가 이루어지며 (최소 판매가)보다 작다면 거래가 이루어지지 않는다. 구매자가 등록한 (구매가)가 (즉시 판매가)와 (최소 판매가)사이의 가격인 경우 등록한 경매시간동안 가장 높은 가격을 제시한 구매자의 (구매가)로 거래가 이루어진다. (판매량)이 (구매량)보다 큰 경우 (구매량)만큼 거래 후 (판매량 - 구매량)만큼 판매 코드가 다시 작동한다. (구매량)이 (판매량)보다 큰 경우 (판매량)만큼 거래 후 (구매량 - 판매량)만큼 구매 코드가 다시 작동한다. 최소 판매가를 입력하지 않은 경우 즉시 판매가로 정찰 거래가 이루어지며 경매시스템은 동작하지 않는다. After selecting whether to buy or sell, the user immediately registers the selling price (kWh/won), the minimum selling price (kWh/won), the sales volume (kWh), and the auction time (hour) if it is sold. Enter the purchase amount (kWh). If the seller's (immediate selling price) is less than (purchase price), the transaction is made immediately, and if it is less than (minimum selling price), the transaction is not made. If the (purchase price) registered by the buyer is the price between (immediate selling price) and (minimum selling price), the transaction is made with the (purchasing price) of the buyer who presented the highest price during the registered auction time. If (Sales Volume) is greater than (Purchase Amount), after the transaction (Purchase Amount), the sales code works again as (Sales Volume-Purchase Amount). If (Purchase Amount) is greater than (Sales Amount), the purchase code will work again after (Purchase Amount) after trading for (Sales Volume). If the minimum selling price is not entered, a reconnaissance transaction is made immediately at the selling price and the auction system does not work.

다음 [도 8], [도 9], [도 10]은 코드의 예시로 각각 판매자 정보와 구매자 정보를 구성하는 방법과 경매가 포함된 거래 시스템의 알고리즘의 예시이다. The following [FIG. 8], [FIG. 9], and [FIG. 10] are examples of codes and methods of constructing seller information and buyer information, and examples of algorithms of a transaction system including auction.

[도 11]은 판매자 입장에서의 알고리즘의 순서도이다. 11 is a flowchart of the algorithm from the seller's point of view.

Ⅷ. BlockⅧ. Block

블록에는 번호, 이전 해쉬, 데이터 해쉬로 이루어진 블록 헤더와 버전, 블록 생성 시간(Timestamp), 채널 ID, TXID(Transaction ID),와 체인코드 경로, 체인코드 이름, 체인코드 버전, 생성자 ID, 인증서, 체인코드 타입, 1~n 보증 피어의 보증과 인증서, 공개키 등과 함께 이전 블록의 해쉬값(512bits), 합의 과정의 메타데이터(선택가능), 현재 상태의 데이터인 KVS(Key -Value Store)의 해쉬값, 이하 트랜잭션들의 해쉬값이 포함되어 구성된다. The block contains the number, previous hash, block header and version of the data hash, block creation time (Timestamp), channel ID, TXID (Transaction ID), and chaincode path, chaincode name, chaincode version, creator ID, certificate, Chain code type, 1~n guarantee Peer's guarantee and certificate, public key, hash value of the previous block (512 bits), metadata of the consensus process (selectable), and current state data of KVS (Key-Value Store) It consists of a hash value and a hash value of the following transactions.

Claims (1)

하이퍼레저를 이용한 P2P 에너지 거래 플랫폼.P2P energy trading platform using hyper leisure.
KR1020180152338A 2018-11-30 2018-11-30 P2p energy transaction platform using hyperledger KR20200065662A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180152338A KR20200065662A (en) 2018-11-30 2018-11-30 P2p energy transaction platform using hyperledger

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180152338A KR20200065662A (en) 2018-11-30 2018-11-30 P2p energy transaction platform using hyperledger

Publications (1)

Publication Number Publication Date
KR20200065662A true KR20200065662A (en) 2020-06-09

Family

ID=71082154

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180152338A KR20200065662A (en) 2018-11-30 2018-11-30 P2p energy transaction platform using hyperledger

Country Status (1)

Country Link
KR (1) KR20200065662A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220106400A (en) 2021-01-22 2022-07-29 서강대학교산학협력단 P2P energy transaction system based on hyperledger blockchain network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220106400A (en) 2021-01-22 2022-07-29 서강대학교산학협력단 P2P energy transaction system based on hyperledger blockchain network

Similar Documents

Publication Publication Date Title
Yang et al. A survey on blockchain-based internet service architecture: requirements, challenges, trends, and future
Maroufi et al. On the convergence of blockchain and internet of things (iot) technologies
Thakur et al. Peer to peer energy trade among microgrids using blockchain based distributed coalition formation method
CN112434343B (en) Virtual power plant safety scheduling and trading method based on dual block chain technology
Shahidehpour et al. Blockchain for peer-to-peer transactive energy trading in networked microgrids: Providing an effective and decentralized strategy
Kaynak et al. Cloud manufacturing architecture based on public blockchain technology
US12002045B2 (en) Resource management system and method of operation thereof
CN113438084A (en) Green power source tracing method and system based on R-PBFT consensus algorithm and timestamp
EP3736760A1 (en) Automated transaction protocol linking renewable energy generation assets to energy power consumers applying distributed digital ledger technology and iot energy meters
CN114971625A (en) Microgrid green electricity transaction system based on block chain technology and data storage and settlement method
Jiang et al. A cross-chain solution to integration of iot tangle for data access management
US20210326984A1 (en) Power transaction data storage system based on private blockchain platform and method for verifying and distributedly storing power transaction data using the same
CN115705571A (en) Protecting privacy of auditable accounts
Liang et al. Investigating the adoption of hybrid encrypted cloud data deduplication with game theory
Gu et al. Autonomous resource request transaction framework based on blockchain in social network
Nguyen et al. Analysis of distributed ledger technologies for industrial manufacturing
Wen et al. Application of blockchain technology in data management: advantages and solutions
Lian Blockchain‐Based Secure and Trusted Distributed International Trade Big Data Management System
Bilal et al. Blockchain technology: Opportunities & challenges
Cai et al. Introduction to blockchain basics
KR20200065662A (en) P2p energy transaction platform using hyperledger
CN111861117A (en) Musical instrument evaluation data sharing method and system based on alliance chain
Kramer et al. A blockchain-based micro economy platform for distributed infrastructure initiatives
Taherdoost The role of smart contract blockchain in 6G wireless communication system
Kazmi et al. Is blockchain overrated?

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application