TWI818171B - Multi-party loan consumption system based on blockchain and smart contract and method thereof - Google Patents

Multi-party loan consumption system based on blockchain and smart contract and method thereof Download PDF

Info

Publication number
TWI818171B
TWI818171B TW109112740A TW109112740A TWI818171B TW I818171 B TWI818171 B TW I818171B TW 109112740 A TW109112740 A TW 109112740A TW 109112740 A TW109112740 A TW 109112740A TW I818171 B TWI818171 B TW I818171B
Authority
TW
Taiwan
Prior art keywords
smart contract
host
relationship
lending
hash value
Prior art date
Application number
TW109112740A
Other languages
Chinese (zh)
Other versions
TW202141396A (en
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 TW109112740A priority Critical patent/TWI818171B/en
Publication of TW202141396A publication Critical patent/TW202141396A/en
Application granted granted Critical
Publication of TWI818171B publication Critical patent/TWI818171B/en

Links

Images

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A multi-party loan consumption system based on blockchain and smart contract and method thereof is disclosed. By providing a buyer host, lending host, seller host, and intermediary host on a blockchain network, wherein the buyer host and the seller host are in a delivery relationship, the buyer host and the lending host are in a loan relationship, and the lending-end host and the seller host are in a payment relationship. When the buyer host makes loan consumption, using at least one smart contract to escrow a plurality of digital currencies and tokens, and the lending host pays the seller host after detecting that the seller host delivers assets to the buyer host, and allows the intermediary host to arbitrate transactions. The mechanism is help to improve the transparency and authenticity of borrowing purpose.

Description

基於區塊鏈與智慧合約的多方借貸消費系統及其方法Multi-party lending and consumption system and method based on blockchain and smart contracts

本發明涉及一種借貸消費之系統及其方法,特別是基於區塊鏈與智慧合約的多方借貸消費系統及其方法。 The present invention relates to a loan consumption system and a method thereof, in particular to a multi-party loan consumption system and method based on blockchain and smart contracts.

近年來,隨著網路的普及與蓬勃發展,各種網路借貸平台便如雨後春筍般出現。然而,如何確保借貸款項能夠專款專用,一直以來都是各家廠商亟欲解決的問題之一。 In recent years, with the popularity and vigorous development of the Internet, various online lending platforms have sprung up. However, how to ensure that loan funds can be earmarked for specific purposes has always been one of the issues that manufacturers are eager to solve.

一般而言,傳統的網路借貸是指個體和個體之間透過網路借貸平台直接進行借貸,其相較於傳統金融機構能夠大幅節省人力成本及管理費用,所以能夠以低廉的手續費用吸引用戶。然而,傳統的網路借貸平台難以對放款資金流向進行追蹤或確認,所以無法有效避免借貸用途與實際用途不相符的情況,舉例來說,借貸用途是為了購買電腦,但是申貸者實際取得資金後,卻將資金挪作他用,如:購買奢侈品、旅遊等等,甚至是將借貸的資金提供給他人使用。因此,在無法保證借貸用途與實際用途相符的情況下,對放貸方而言, 具有借貸用途的透明性及真實性不佳的問題,不但可能影響金融秩序,同時也存在許多不確定的風險。 Generally speaking, traditional online lending refers to direct borrowing between individuals through online lending platforms. Compared with traditional financial institutions, it can significantly save labor costs and management fees, so it can attract users with low handling fees. . However, it is difficult for traditional online lending platforms to track or confirm the flow of loan funds, so they cannot effectively avoid situations where the purpose of the loan does not match the actual purpose. For example, the purpose of the loan is to purchase a computer, but the loan applicant actually obtains the funds. Later, they misappropriated the funds for other purposes, such as purchasing luxury goods, traveling, etc., or even providing the borrowed funds to others. Therefore, when there is no guarantee that the purpose of the loan is consistent with the actual purpose, for the lender, Problems with poor transparency and authenticity of lending purposes may not only affect the financial order, but also present many uncertain risks.

有鑑於此,便有廠商提出即時徵信的技術手段,其透過在撥貸後,主動偵測帳戶的資金流向及還款來源以判斷有無異常。然而,此方式需要經過申貸者授權以便正確獲取帳戶訊息,而且只根據資金流向及還款來源進行判斷仍然無法有效保證借貸用途與實際用途相符,故仍然無法有效解決借貸用途的透明性及真實性不佳的問題。 In view of this, some manufacturers have proposed real-time credit reporting technology, which actively detects the flow of funds and repayment sources in the account to determine whether there are any abnormalities after the loan is disbursed. However, this method requires authorization from the loan applicant in order to correctly obtain account information, and judging only based on the flow of funds and the source of repayment still cannot effectively ensure that the purpose of the loan is consistent with the actual purpose, so it still cannot effectively solve the problem of transparency and authenticity of the purpose of the loan. The problem of sexual inadequacy.

綜上所述,可知先前技術中長期以來一直存在借貸用途的透明性及真實性不佳之問題,因此實有必要提出改進的技術手段,來解決此一問題。 To sum up, it can be seen that the previous technology has long had problems with poor transparency and authenticity of lending purposes. Therefore, it is necessary to propose improved technical means to solve this problem.

本發明揭露一種基於區塊鏈與智慧合約的多方借貸消費系統及其方法。 The invention discloses a multi-party lending and consumption system and method based on blockchain and smart contracts.

首先,本發明揭露一種基於區塊鏈與智慧合約的多方借貸消費系統,應用在由多個節點主機組成的區塊鏈網路,此系統包含:買方端主機、借出端主機、賣方端主機及中介端主機。其中,買方端主機作為節點主機其中之一,所述買方端主機用以在包含借貸訊息的智慧合約成功發布於區塊鏈網路之後,允許將債權通證傳送至智慧合約以進行託管,並在智慧合約中設定第一雜湊值,其中第一雜湊值係由第一解鎖密語進行雜湊計算所生成;中介端主機作為節點主機其中之一,所述中介端主機用以允許直接觸發執行智慧合約的交付函式及退還函式,並且在已設定第一雜湊值的智慧合約中設定第二雜湊值,第二雜湊值係由第二解鎖密語進行雜湊計算所生成;賣方端主機作為節點主機其 中之一,所述賣方端主機在智慧合約成功發布後,將資產通證傳送至智慧合約以進行託管;以及借出端主機作為節點主機其中之一,所述借出端主機在智慧合約成功發布後,將數位貨幣或支付通證傳送至智慧合約以進行託管;其中,當資產通證以及數位貨幣或支付通證皆已託管於智慧合約時,在逾時時間內,允許買方端主機將第一解鎖密語傳送至智慧合約的交付函式或中介端主機將第二解鎖密語傳送至智慧合約的交付函式,此交付函式在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將資產通證轉移至買方端主機、將數位貨幣或支付通證轉移至賣方端主機,以及在借貸訊息中記錄為借貸已執行,或在智慧合約存在託管的債權通證時,將債權通證轉移至借出端主機,當交付函式執行結束後,買方端主機根據借貸訊息及借出端主機持有的債權通證或兩者任一計算還款數額,以便向借出端主機進行還款。 First, the present invention discloses a multi-party lending and consumption system based on blockchain and smart contracts, which is applied to a blockchain network composed of multiple node hosts. This system includes: a buyer-side host, a lending-side host, and a seller-side host. and intermediary host. Among them, the buyer-side host serves as one of the node hosts. The buyer-side host is used to allow the debt token to be transferred to the smart contract for custody after the smart contract containing the loan information is successfully published on the blockchain network, and A first hash value is set in the smart contract, where the first hash value is generated by hash calculation of the first unlocking password; the intermediary host serves as one of the node hosts, and the intermediary host is used to allow direct triggering of the execution of the smart contract The delivery function and return function, and set the second hash value in the smart contract that has set the first hash value. The second hash value is generated by hash calculation of the second unlocking password; the seller-side host serves as the node host. One of them, the seller-side host will transfer the asset token to the smart contract for custody after the smart contract is successfully released; and the lending-side host serves as one of the node hosts, and the lending-side host will be used after the smart contract is successfully released. After release, the digital currency or payment token is sent to the smart contract for custody; among them, when the asset token and the digital currency or payment token are both hosted in the smart contract, within the timeout period, the buyer's host is allowed to The first unlocking password is sent to the delivery function of the smart contract or the intermediary host sends the second unlocking password to the delivery function of the smart contract. This delivery function receives the first unlocking password that matches the first hash value or matches the first hash value. When the second unlocking password of the hash value is used, the asset token is transferred to the buyer's host, the digital currency or payment token is transferred to the seller's host, and it is recorded in the loan message as the loan has been executed, or there is custody in the smart contract When the debt token is issued, the debt token is transferred to the lending host. When the execution of the delivery function is completed, the buyer's host calculates the repayment based on the loan information and the debt token held by the lending host, or either of the two. Amount to repay to the lending host.

接著,本發明還揭露一種基於區塊鏈與智慧合約的多方借貸消費系統,應用在由多個節點主機組成的區塊鏈網路,此系統包含:買方端主機、借出端主機、賣方端主機及中介端主機。其中,買方端主機作為節點主機其中之一,所述買方端主機用以在借貸關係智慧合約發布於區塊鏈網路之後,允許在借貸關係智慧合約中設定第一雜湊值,其中第一雜湊值係由第一解鎖密語進行雜湊計算所生成;借出端主機作為節點主機其中之一,所述借出端主機用以在支付關係智慧合約發布於區塊鏈網路之後,允許在支付關係智慧合約設定第一雜湊值,並且將數位貨幣或支付通證傳送至支付關係智慧合約以進行託管;賣方端主機作為節點主機其中之一,所述賣方端主機用以在交付關係智慧合約發布於區塊鏈網路之後,允許在交付關係智慧合約設定第一雜湊值,並且將資產通證傳送至交付關係智慧合約以進行託管;以及中介端主機作為節點主機其 中之一,所述中介端主機用以在已設定第一雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約中設定第二雜湊值,此第二雜湊值係由第二解鎖密語進行雜湊計算所生成;其中,在買方端主機、借出端主機及賣方端主機之中,非最早設定第一雜湊值的二者,將第一雜湊值及第二雜湊值設定在尚未設定第一雜湊值及第二雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約之中,在進行設定時,借貸關係智慧合約允許託管來自買方端主機的債權通證,交付關係智慧合約同時託管來自賣方端主機的資產通證,支付關係智慧合約同時託管來自借出端主機的數位貨幣或支付通證;其中,在確定執行交易時,由最早設定第一雜湊值的買方端主機、賣方端主機或借出端主機將第一解鎖密語傳送至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,或由中介端主機傳送第二解鎖密語至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機、借出端主機或賣方端主機,並且公開接收到的第一解鎖密語或第二解鎖密語;其中,在買方端主機、借出端主機及賣方端主機之中,非最早設定第一雜湊值的二者,在偵測到公開的第一解鎖密語或第二解鎖密語時,允許將偵測到的第一解鎖密語或第二解鎖密語傳送至未公開第一解鎖密語或第二解鎖密語的交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使其在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機、借出端 主機或賣方端主機,以及當偵測到的第一解鎖密語或第二解鎖密語傳送至借貸關係智慧合約時,允許將借貸關係智慧合約的借貸狀態記錄為借貸已執行。 Next, the present invention also discloses a multi-party lending and consumption system based on blockchain and smart contracts, which is applied to a blockchain network composed of multiple node hosts. This system includes: a buyer-side host, a lending-side host, and a seller-side Host and intermediary host. Among them, the buyer-side host serves as one of the node hosts. The buyer-side host is used to allow the first hash value to be set in the loan-lending relationship smart contract after the loan-lending relationship smart contract is published on the blockchain network. The first hash value is The value is generated by hash calculation of the first unlocking password; the lending host serves as one of the node hosts. The lending host is used to allow the payment relationship to be entered after the payment relationship smart contract is published on the blockchain network. The smart contract sets the first hash value, and transmits the digital currency or payment token to the payment relationship smart contract for custody; the seller-side host serves as one of the node hosts, and the seller-side host is used to publish the delivery relationship smart contract on After the blockchain network, the first hash value is allowed to be set in the delivery relationship smart contract, and the asset token is sent to the delivery relationship smart contract for custody; and the intermediary host serves as the node host. One of them, the intermediary host is used to set a second hash value in the loan relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract that has set the first hash value. This second hash value is unlocked by the second The secret word is generated by hash calculation; among the buyer-side host, the lending-side host and the seller-side host, the two that are not the first to set the first hash value set the first hash value and the second hash value before they have been set. In the loan relationship smart contract, payment relationship smart contract or delivery relationship smart contract of the first hash value and the second hash value, when setting up, the loan relationship smart contract allows the custody of the debt token from the buyer's host, and the delivery relationship wisdom The contract also hosts the asset token from the seller's host, and the payment relationship smart contract also hosts the digital currency or payment token from the lending host; among them, when confirming the execution of the transaction, the buyer's host that first sets the first hash value , the seller-side host or the lending-side host sends the first unlocking secret word to the delivery relationship smart contract, the lending relationship smart contract or the payment relationship smart contract, or the intermediary-side host sends the second unlocking secret word to the delivery relationship smart contract, lending relationship smart contract The contract or the payment relationship smart contract enables the delivery relationship smart contract, the loan relationship smart contract or the payment relationship smart contract to be escrowd when it receives the first unlocking secret word matching the first hash value or the second unlocking secret word matching the second hash value. The asset token, debt token, digital currency or payment token is transmitted to the buyer-side host, lending-side host or seller-side host, and the first unlocking password or the second unlocking password received is disclosed; among them, on the buyer side Among the host, the lending host and the seller's host, the host that is not the first to set the first hash value is allowed to use the detected first unlocking password when detecting the first unlocking password or the second unlocking password. The secret word or the second unlocking secret word is transmitted to a delivery relationship smart contract, a lending relationship smart contract or a payment relationship smart contract that does not disclose the first unlocking secret word or the second unlocking secret word, so that it receives the first unlocking secret word matching the first hash value. Or when the second unlocking password of the second hash value is matched, the managed asset token, debt token, digital currency or payment token is transmitted to the buyer's host or the lending end. The host or the seller's host, and when the detected first unlocking password or the second unlocking password is transmitted to the lending relationship smart contract, allows the loan status of the lending relationship smart contract to be recorded as the loan has been executed.

另外,本發明揭露一種基於區塊鏈與智慧合約的多方借貸消費方法,應用在由多個節點主機組成的區塊鏈網路,其步驟包括:提供分別作為節點主機其中之一的買方端主機、借出端主機、賣方端主機及中介端主機,其中,中介端主機允許直接觸發執行智慧合約的交付函式及退還函式;在包含借貸訊息的智慧合約成功發布於區塊鏈網路之後,買方端主機將債權通證傳送至智慧合約以進行託管,並且在智慧合約中設定第一雜湊值,其中第一雜湊值係由第一解鎖密語進行雜湊計算所生成、中介端主機在已設定第一雜湊值的智慧合約中設定第二雜湊值,此第二雜湊值係由第二解鎖密語進行雜湊計算所生成、賣方端主機將資產通證傳送至已設定第二雜湊值的智慧合約以進行託管,以及借出端主機將數位貨幣或支付通證傳送至已設定第二雜湊值的智慧合約以進行託管;當債權通證及資產通證,以及數位貨幣或支付通證皆已託管於智慧合約時,在逾時時間內,允許買方端主機將第一解鎖密語傳送至智慧合約的交付函式或中介端主機將第二解鎖密語傳送至智慧合約的交付函式,此交付函式在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將資產通證轉移至買方端主機、將數位貨幣或支付通證轉移至賣方端主機,以及將債權通證轉移至借出端主機;以及在交付函式執行結束後,買方端主機根據借貸訊息及借出端主機持有的債權通證計算還款數額,以便向借出端主機進行還款。 In addition, the present invention discloses a multi-party lending and consumption method based on blockchain and smart contracts, which is applied to a blockchain network composed of multiple node hosts. The steps include: providing a buyer-side host as one of the node hosts. , the lending host, the seller host and the intermediary host. Among them, the intermediary host allows to directly trigger the delivery function and return function of the smart contract; after the smart contract containing the loan information is successfully published on the blockchain network , the buyer-side host transmits the debt token to the smart contract for custody, and sets the first hash value in the smart contract, where the first hash value is generated by the hash calculation of the first unlocking password, and the intermediary-side host has set The second hash value is set in the smart contract with the first hash value. This second hash value is generated by the hash calculation of the second unlocking password. The seller's host transmits the asset token to the smart contract with the second hash value set. Custody is performed, and the lending host transmits the digital currency or payment token to the smart contract that has set the second hash value for custody; when the debt token, asset token, and digital currency or payment token have all been escrowd in When entering a smart contract, within the timeout period, the buyer-side host is allowed to send the first unlocking secret word to the smart contract's delivery function or the intermediary-side host is allowed to send the second unlocking secret word to the smart contract's delivery function. This delivery function is When receiving the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value, transfer the asset token to the buyer-side host, transfer the digital currency or payment token to the seller-side host, and transfer The debt token is transferred to the lending host; and after the delivery function is executed, the buyer's host calculates the repayment amount based on the loan information and the debt token held by the lending host in order to repay the lending host .

另外,本發明還揭露一種基於區塊鏈與智慧合約的多方借貸消費方法,應用在由多個節點主機組成的區塊鏈網路,其步驟包括:提供買方端主機、借出端主機、賣方端主機及中介端主機以分別作為節點主機其中之一;買 方端主機或賣方端主機在區塊鏈網路發布交付關係智慧合約、買方端主機或借出端主機在區塊鏈網路發布借貸關係智慧合約,借出端主機或賣方端主機在區塊鏈網路發布支付關係智慧合約;在交付關係智慧合約、借貸關係智慧合約及支付關係智慧合約皆成功發布後,由所述買方端主機在借貸關係智慧合約中設定第一雜湊值,或由借出端主機在支付關係智慧合約中設定第一雜湊值,或由賣方端主機在交付關係智慧合約中設定第一雜湊值,其中第一雜湊值係由第一解鎖密語進行雜湊計算所生成;中介端主機在已設定第一雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約中設定第二雜湊值,所述第二雜湊值係由第二解鎖密語進行雜湊計算所生成;在買方端主機、借出端主機及賣方端主機之中,非最早設定第一雜湊值的二者,將第一雜湊值及第二雜湊值設定在尚未設定第一雜湊值及第二雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約之中,其中,在進行設定時,借貸關係智慧合約允許託管來自買方端主機的債權通證,交付關係智慧合約同時託管來自賣方端主機的資產通證,支付關係智慧合約同時託管來自借出端主機的數位貨幣或支付通證;在確定執行交易時,由最早設定第一雜湊值的買方端主機、賣方端主機或借出端主機將第一解鎖密語傳送至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,或由中介端主機傳送第二解鎖密語至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機、借出端主機或賣方端主機,並且公開接收到的第一解鎖密語或第二解鎖密語;在買方端主機、借出端主機及賣方端主機之中,非最早設 定第一雜湊值的二者,在偵測到公開的第一解鎖密語或第二解鎖密語時,允許將偵測到的第一解鎖密語或第二解鎖密語傳送至未公開第一解鎖密語或第二解鎖密語的交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使其在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機、借出端主機或賣方端主機,以及當偵測到的第一解鎖密語或第二解鎖密語傳送至借貸關係智慧合約時,允許將借貸關係智慧合約的借貸狀態記錄為借貸已執行。 In addition, the present invention also discloses a multi-party lending and consumption method based on blockchain and smart contracts, which is applied to a blockchain network composed of multiple node hosts. The steps include: providing a buyer-side host, a lending-side host, a seller The end host and the intermediary end host can be used as one of the node hosts respectively; buy The party-side host or the seller-side host publishes the delivery relationship smart contract on the blockchain network, the buyer-side host or the lending-side host publishes the lending relationship smart contract on the blockchain network, and the lending-side host or the seller-side host publishes the smart contract on the block chain. The chain network publishes the payment relationship smart contract; after the delivery relationship smart contract, the loan relationship smart contract and the payment relationship smart contract are all successfully released, the buyer-side host sets the first hash value in the loan relationship smart contract, or by borrowing The outgoing host sets the first hash value in the payment relationship smart contract, or the seller-side host sets the first hash value in the delivery relationship smart contract, where the first hash value is generated by hash calculation of the first unlocking secret word; intermediary The end host sets a second hash value in the loan relationship smart contract, payment relationship smart contract or delivery relationship smart contract that has set the first hash value, and the second hash value is generated by hash calculation of the second unlocking password; in Among the buyer-side host, the lending-side host, and the seller-side host, whichever is not the first to set the first hash value, sets the first hash value and the second hash value to the host that has not yet set the first hash value and the second hash value. Among the lending relationship smart contracts, payment relationship smart contracts or delivery relationship smart contracts, when setting up, the lending relationship smart contract allows the hosting of debt tokens from the buyer-side host, and the delivery relationship smart contract also hosts the debt tokens from the seller-side host. Asset tokens and payment relationship smart contracts also host digital currency or payment tokens from the lending host; when it is determined to execute the transaction, the buyer's host, the seller's host or the lending host that sets the first hash value at the earliest will The first unlocking password is sent to the delivery relationship smart contract, the lending relationship smart contract or the payment relationship smart contract, or the intermediary host sends the second unlocking password to the delivery relationship smart contract, lending relationship smart contract or payment relationship smart contract, so that the delivery relationship When a smart contract, lending relationship smart contract or payment relationship smart contract receives the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value, it will transfer the managed asset token, debt token, digital The currency or payment token is transmitted to the buyer-side host, the lending-side host or the seller-side host, and the first unlocking password or the second unlocking password received is disclosed; among the buyer-side host, the lending-side host and the seller-side host , not the earliest assumption The two that determine the first hash value allow the detected first unlocking password or the second unlocking password to be transmitted to the undisclosed first unlocking password or the undisclosed first unlocking password or the second unlocking password. The delivery relationship smart contract, loan relationship smart contract or payment relationship smart contract of the second unlocking secret word is such that when it receives the first unlocking secret word matching the first hash value or the second unlocking secret word matching the second hash value, it will be escrowd The asset token, debt token, digital currency or payment token is transmitted to the buyer-end host, lending-end host or seller-end host, and when the first unlocking password or the second unlocking password is detected, it is transmitted to the lending relationship intelligence When contracting, the loan status of the loan relationship smart contract is allowed to be recorded as the loan has been executed.

本發明所揭露之系統與方法如上,與先前技術的差異在於本發明是透過在區塊鏈網路提供買方端主機、借出端主機、賣方端主機及中介端主機,其中買方端主機與賣方端主機為交付關係,買方端主機與借出端主機為借貸關係,借出端主機與賣方端主機為支付關係,接著當買方端主機進行借貸消費時,使用智慧合約託管數位貨幣及通證,並且在偵測到賣方端主機交付資產給買方端主機後,再由借出端主機向賣方端主機進行支付,以及允許中介端主機仲裁交易。 The system and method disclosed by the present invention are as above. The difference from the prior art is that the present invention provides the buyer-side host, the lending-side host, the seller-side host and the intermediary-side host in the blockchain network, where the buyer-side host and the seller The end host is in a delivery relationship, the buyer-end host and the lending-end host are in a lending relationship, and the lending-end host and the seller-end host are in a payment relationship. Then when the buyer-end host performs loan consumption, a smart contract is used to host the digital currency and tokens. And after detecting that the seller's host delivers assets to the buyer's host, the lending host pays the seller's host and allows the intermediary host to arbitrate the transaction.

透過上述的技術手段,本發明可以達成提高借貸用途的透明性及真實性之技術功效。 Through the above technical means, the present invention can achieve the technical effect of improving the transparency and authenticity of lending purposes.

100,300:區塊鏈網路 100,300: Blockchain network

110,310:買方端主機 110,310: Buyer-side host

120,320:借出端主機 120,320: Lending host

130,330:賣方端主機 130,330: Seller-side host

140,340:中介端主機 140,340: Intermediary host

600:設定視窗 600: Setting window

611~613:輸入區塊 611~613: Input block

621~623:借貸消費輸入區塊 621~623: Loan and consumption input block

630:確認元件 630:Confirm component

步驟210:提供分別作為節點主機其中之一的一買方端主機、一借出端主機、一賣方端主機及一中介端主機,其中,該中介端主機允許直接觸發執行該智慧合約的一交付函式及一退還函式 Step 210: Provide a buyer-side host, a lending-side host, a seller-side host and an intermediary-side host respectively as one of the node hosts, wherein the intermediary-side host allows to directly trigger the execution of a delivery letter of the smart contract formula and a return function

步驟220:在包含一借貸訊息的一智慧合約成功發布於區塊鏈網路之後,允許該買方端主機將至少一債權通證傳送至該智慧合約以進行託管、該賣方端主機將至少一資產通證傳送至該智慧合約以進行託管,以及該借出端主機將至少一數位貨幣或至少一支付通證傳送至該智慧合約以進行託管 Step 220: After a smart contract containing a loan message is successfully published on the blockchain network, the buyer-side host is allowed to transmit at least one debt token to the smart contract for custody, and the seller-side host is allowed to send at least one asset The token is sent to the smart contract for custody, and the lending host sends at least one digital currency or at least one payment token to the smart contract for custody

步驟230:當所述債權通證及所述資產通證,以及所述數位貨幣或所述支付通證皆已託管於該智慧合約時,允許該買方端主機、該借出端主機、該賣方端主機及該中介端主機其中之一觸發執行該智慧合約的該交付函式,使該智慧合約將所述資產通證轉移至該買方端主機、將所述數位貨幣或所述支付通證轉移至該賣方端主機,以及 在該借貸訊息中記錄為借貸已執行,或在該智慧合約存在託管的所述債權通證時,將所述債權通證轉移至該借出端主機 Step 230: When the debt token and the asset token, as well as the digital currency or the payment token are all hosted in the smart contract, allow the buyer-side host, the lending-side host, and the seller One of the end host and the intermediary end host triggers the execution of the delivery function of the smart contract, causing the smart contract to transfer the asset token to the buyer-end host, transfer the digital currency or the payment token to the seller's end host, and Record in the loan message that the loan has been executed, or when the smart contract has the debt token in custody, transfer the debt token to the lending host

步驟240:在該交付函式執行結束後,該買方端主機根據該借貸訊息及該借出端主機持有的所述債權通證或兩者任一計算還款數額,以便向該借出端主機進行還款 Step 240: After the execution of the delivery function is completed, the buyer-side host calculates the repayment amount based on the loan information and the debt token held by the lender-side host, or both, in order to provide the loan to the lender. Host makes repayment

步驟250:當超過逾時時間未執行該交付函式時,由該智慧合約觸發執行一退還函式,或由該買方端主機、該借出端主機、該賣方端主機或該中介端主機觸發執行該退還函式,用以允許該買方端主機取回託管的所述債權通證、允許該賣方端主機取回託管的所述資產通證,以及允許該借出端主機取回託管的所述數位貨幣或所述支付通證 Step 250: When the delivery function is not executed after the timeout period, a return function is triggered by the smart contract, or triggered by the buyer-side host, the lending-side host, the seller-side host or the intermediary-side host Execute the return function to allow the buyer-side host to retrieve the debt tokens in custody, allow the seller-side host to retrieve the asset tokens in custody, and allow the lending-side host to retrieve all the custody tokens. The above-mentioned digital currency or the above-mentioned payment token

步驟410:提供一買方端主機、一借出端主機、一賣方端主機及一中介端主機以分別作為所述節點主機其中之一 Step 410: Provide a buyer-side host, a lending-side host, a seller-side host and an intermediary-side host as one of the node hosts respectively.

步驟420:該買方端主機或該賣方端主機在該區塊鏈網路發布一交付關係智慧合約,該買方端主機或該借出端主機在該區塊鏈網路發布一借貸關係智慧合約,該借出端主機或該賣方端主機在該區塊鏈網路發布一支付關係智慧合約 Step 420: The buyer-side host or the seller-side host publishes a delivery relationship smart contract on the blockchain network, and the buyer-side host or the lending host publishes a lending relationship smart contract on the blockchain network, The lending host or the seller host publishes a payment relationship smart contract on the blockchain network

步驟430:在該交付關係智慧合約、該借貸關係智慧合約及該支付關係智慧合約皆成功發布後,由該買方端主機在該借貸關係智慧合約中設定一第一雜湊值,或由該借出端主機在該支付關係智慧合約中設定該第一雜湊值,或由該賣方端主機在該交付關係智慧合約中設 定該第一雜湊值,其中該第一雜湊值係由一第一解鎖密語進行雜湊計算所生成 Step 430: After the delivery relationship smart contract, the loan relationship smart contract and the payment relationship smart contract are all successfully released, the buyer-side host sets a first hash value in the loan relationship smart contract, or the lending relationship smart contract The end host sets the first hash value in the payment relationship smart contract, or the seller-side host sets the first hash value in the delivery relationship smart contract. Determine the first hash value, wherein the first hash value is generated by hash calculation using a first unlocking password

步驟440:該中介端主機在已設定該第一雜湊值的該借貸關係智慧合約、該支付關係智慧合約或該交付關係智慧合約中設定一第二雜湊值,該第二雜湊值係由一第二解鎖密語進行雜湊計算所生成 Step 440: The intermediary host sets a second hash value in the loan relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract that has set the first hash value. The second hash value is determined by a first hash value. Two unlocking passwords are generated by hash calculation.

步驟450:在該買方端主機、該借出端主機及該賣方端主機之中,非最早設定該第一雜湊值的二者,將該第一雜湊值及該第二雜湊值設定在尚未設定該第一雜湊值及該第二雜湊值的該借貸關係智慧合約、該支付關係智慧合約或該交付關係智慧合約之中,其中,在設定時,該借貸關係智慧合約允許託管來自該買方端主機的至少一債權通證,該交付關係智慧合約同時託管來自該賣方端主機的至少一資產通證,該支付關係智慧合約同時託管來自該借出端主機的至少一數位貨幣或至少一支付通證 Step 450: Among the buyer-side host, the lending-side host and the seller-side host, the two that are not the first to set the first hash value set the first hash value and the second hash value to a value that has not yet been set. The first hash value and the second hash value are in the lending relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract, wherein, at the time of setting, the lending relationship smart contract allows hosting from the buyer-side host At least one debt token, the delivery relationship smart contract also hosts at least one asset token from the seller's host, and the payment relationship smart contract also hosts at least one digital currency or at least one payment token from the lender's host

步驟460:在確定執行交易時,由最早設定該第一雜湊值的該買方端主機、該借出端主機或該賣方端主機將該第一解鎖密語傳送至該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,或由該中介端主機傳送該第二解鎖密語至該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,使該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述資產通證、所述債權通證、所述數位貨 幣或至少一支付通證傳送至該買方端主機、該借出端主機或該賣方端主機,並且公開接收到的該第一解鎖密語或該第二解鎖密語 Step 460: When it is determined to execute the transaction, the buyer-side host, the lending-side host or the seller-side host that first sets the first hash value transmits the first unlocking password to the delivery relationship smart contract and the lending relationship. The smart contract or the payment relationship smart contract, or the intermediary host sends the second unlocking password to the delivery relationship smart contract, the loan relationship smart contract or the payment relationship smart contract, so that the delivery relationship smart contract, the loan relationship When the smart contract or the payment relationship smart contract receives the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value, it will transfer the custody of the asset token and the claim to Tokens and digital goods Coin or at least one payment token is transmitted to the buyer-end host, the lending-end host or the seller-end host, and the received first unlocking password or the second unlocking password is disclosed

步驟470:在該買方端主機、該借出端主機及該賣方端主機之中,非最早設定該第一雜湊值的二者,在偵測到公開的該第一解鎖密語或該第二解鎖密語時,允許將偵測到的該第一解鎖密語或該第二解鎖密語傳送至未公開該第一解鎖密語或該第二解鎖密語的該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,使其在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述資產通證、所述債權通證、所述數位貨幣或所述支付通證傳送至該買方端主機、該借出端主機或該賣方端主機,以及當偵測到的該第一解鎖密語或該第二解鎖密語傳送至該借貸關係智慧合約時,允許將該借貸關係智慧合約的一借貸狀態記錄為借貸已執行 Step 470: Among the buyer-side host, the lending-side host and the seller-side host, the one that is not the first to set the first hash value detects the first unlocking password or the second unlocking that is disclosed. When the password is used, the detected first unlocking password or the second unlocking password is allowed to be transmitted to the delivery relationship smart contract, the lending relationship smart contract or the payment that does not disclose the first unlocking password or the second unlocking password. The relationship smart contract allows it to transfer the custody of the asset token and the debt token when it receives the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value. , the digital currency or the payment token is transmitted to the buyer-side host, the lending-side host or the seller-side host, and when the first unlocking password or the second unlocking password is detected, it is sent to the lending When entering into a smart contract, a loan status of the loan relationship smart contract is allowed to be recorded as the loan has been executed.

步驟480:在該借貸關係智慧合約、該支付關係智慧合約及該交付關係智慧合約中分別設定一逾時時間,當未在該逾時時間內接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,允許該賣方端主機取回託管的所述資產通證、允許買方端主機取回託管的所述債權通證,以及允許該借出端主機取回託管的所述數位貨幣或所述支付通證 Step 480: Set a timeout time in the loan relationship smart contract, the payment relationship smart contract and the delivery relationship smart contract respectively. When the first unlock matching the first hash value is not received within the timeout time, When the password or the second unlocking password matches the second hash value, the seller-side host is allowed to retrieve the asset token in custody, the buyer-side host is allowed to retrieve the debt token in custody, and the lending is allowed. The end host retrieves the hosted digital currency or payment token

第1圖為本發明基於區塊鏈與智慧合約的多方借貸消費系統的第一實施例之系統方塊圖。 Figure 1 is a system block diagram of the first embodiment of the multi-party lending and consumption system based on blockchain and smart contracts of the present invention.

第2圖為本發明基於區塊鏈與智慧合約的多方借貸消費方法的第一實施例之方法流程圖。 Figure 2 is a method flow chart of the first embodiment of the multi-party lending and consumption method based on blockchain and smart contracts according to the present invention.

第3圖為本發明基於區塊鏈與智慧合約的多方借貸消費系統的第二實施例之系統方塊圖。 Figure 3 is a system block diagram of the second embodiment of the multi-party lending and consumption system based on blockchain and smart contracts of the present invention.

第4A圖及第4B圖為本發明基於區塊鏈與智慧合約的多方借貸消費方法的第二實施例之方法流程圖。 Figures 4A and 4B are method flow charts of the second embodiment of the multi-party lending and consumption method based on blockchain and smart contracts according to the present invention.

第5圖為應用本發明進行借貸消費之示意圖。 Figure 5 is a schematic diagram of applying the present invention for loan consumption.

第6圖為應用本發明設定智慧合約之示意圖。 Figure 6 is a schematic diagram of setting up a smart contract using the present invention.

以下將配合圖式及實施例來詳細說明本發明之實施方式,藉此對本發明如何應用技術手段來解決技術問題並達成技術功效的實現過程能充分理解並據以實施。 The embodiments of the present invention will be described in detail below with reference to the drawings and examples, so that the implementation process of how to apply technical means to solve technical problems and achieve technical effects of the present invention can be fully understood and implemented accordingly.

在說明本發明所揭露之基於區塊鏈與智慧合約的多方借貸消費系統及其方法之前,先對本發明所自行定義的名詞作說明,本發明所述的「智慧合約」、「借貸關係智慧合約」、「交付關係智慧合約」及「支付關係智慧合約」均是指發布(Deploy)在區塊鏈網路上的智慧合約(Smart Contract)。實際上,所述智慧合約是指依據既定的條件及傳輸的資訊來驅動執行指令的電腦程式,具體而言,所述智慧合約係透過程式語言,例如:Solidity、Serpent、LLL、EtherScript、Sidechain等等來撰寫,其可包含各種不同的函式(Function)、事件(Event)、參數狀態等等,以「Ethereum」的環境為例,其智慧合約是經編譯後得到二進位編碼及應用二進位介面(Application Binary Interface,ABI), 以便將智慧合約廣播至區塊鏈網路,等候礦工(Miner)或驗證者(Validator)將智慧合約放上區塊鏈並得到相應的地址(或稱為合約地址),至此即透過區塊鏈交易完成智慧合約的發布。之後,各節點主機便可根據此地址執行相應的智慧合約,並且藉由不同的指令來改變智慧合約在區塊鏈上的狀態以及偵測事件是否被觸發。另外,所述「債權通證」、「支付通證」及「資產通證」等等,均是指運行在區塊鏈網路上的「通證」(Token)。在實際實施上,這些通證可透過各種標準,如:「ERC20」、「ERC721」等等來實現,也就是說,以智慧合約建立運行在區塊鏈,並且能夠透過區塊鏈交易進行轉移的通證。 Before describing the multi-party lending and consumption system and method based on blockchain and smart contracts disclosed in the present invention, the terms defined by the present invention are first explained. The "smart contract" and "lending relationship smart contract" mentioned in the present invention ", "Delivery relationship smart contract" and "Payment relationship smart contract" all refer to smart contracts (Smart Contracts) published (Deploy) on the blockchain network. In fact, the smart contract refers to a computer program that drives the execution of instructions based on established conditions and transmitted information. Specifically, the smart contract is programmed through programming languages, such as: Solidity, Serpent, LLL, EtherScript, Sidechain, etc. It can include various functions, events, parameter states, etc. Taking the "Ethereum" environment as an example, its smart contract is compiled to obtain binary encoding and application binary Interface (Application Binary Interface,ABI), In order to broadcast the smart contract to the blockchain network, wait for the miner or validator to put the smart contract on the blockchain and obtain the corresponding address (or contract address). At this point, through the blockchain The transaction completes the release of the smart contract. After that, each node host can execute the corresponding smart contract based on this address, and use different instructions to change the status of the smart contract on the blockchain and detect whether the event is triggered. In addition, the "debt tokens", "payment tokens" and "asset tokens" mentioned above all refer to "Tokens" running on the blockchain network. In actual implementation, these tokens can be implemented through various standards, such as "ERC20", "ERC721", etc. In other words, they are built and run on the blockchain with smart contracts and can be transferred through blockchain transactions. of the pass.

以下配合圖式對本發明基於區塊鏈與智慧合約的多方借貸消費系統及其方法做進一步說明,請先參閱「第1圖」,「第1圖」為本發明基於區塊鏈與智慧合約的多方借貸消費系統的第一實施例之系統方塊圖,應用在多個節點主機組成的區塊鏈網路100,此系統包含:買方端主機110、借出端主機120、賣方端主機130及中介端主機140。其中,買方端主機110作為節點主機其中之一,所述買方端主機110用以在包含借貸訊息的智慧合約成功發布於區塊鏈網路100之後,允許將債權通證傳送至智慧合約以進行託管。在實際實施上,所述節點主機可為具有網路功能的計算機裝置,如:個人電腦、筆記型電腦、伺服器等等,而且彼此之間透過點對點(Peer to Peer,P2P)方式相互連線以組成區塊鏈網路100。因此,買方端主機110即是位於買方(或稱為申貸方)的計算機裝置,買方依照其消費應支付的量而與借出方(或稱為放貸方)成立借貸關係。另外,所述智慧合約可由買方端主機110、借出端主機120、賣方端主機130及中介端主機140中的任一方建立並發布在區塊鏈網路100,至於判斷智慧合約是否 成功發布可以透過偵測其智慧合約的合約地址是否存在來實現,倘若存在代表成功發布,反之則代表尚未成功發布。 The following diagrams are used to further explain the multi-party lending and consumption system and its method based on blockchain and smart contracts of the present invention. Please refer to "Figure 1" first. "Figure 1" shows the multi-party lending and consumption system and method based on blockchain and smart contracts of the present invention. The system block diagram of the first embodiment of the multi-party lending and consumption system is applied to a blockchain network 100 composed of multiple node hosts. This system includes: a buyer-side host 110, a lending-side host 120, a seller-side host 130 and an intermediary. End host 140. Among them, the buyer-side host 110 serves as one of the node hosts. The buyer-side host 110 is used to allow the debt token to be transferred to the smart contract for processing after the smart contract containing the loan information is successfully published on the blockchain network 100. Hosting. In actual implementation, the node hosts can be computer devices with network functions, such as personal computers, laptops, servers, etc., and are connected to each other through a peer-to-peer (Peer to Peer, P2P) method. To form a blockchain network 100. Therefore, the buyer-side host 110 is a computer device located at the buyer (also known as the lender), and the buyer establishes a lending relationship with the lender (also known as the lender) according to the amount that the buyer should pay for consumption. In addition, the smart contract can be established and published on the blockchain network 100 by any one of the buyer-side host 110, the lending-side host 120, the seller-side host 130, and the intermediary-side host 140. As for determining whether the smart contract is Successful release can be achieved by detecting whether the contract address of its smart contract exists. If it exists, it means that it has been successfully released, otherwise it means that it has not yet been successfully released.

借出端主機120作為節點主機其中之一,所述借出端主機120在智慧合約成功發布後,將數位貨幣或支付通證傳送至智慧合約以進行託管。實際上,借出端主機120是位於借出方的計算機裝置,能夠依照借貸關係的量交付數位貨幣或通證給賣方。 The lending host 120 serves as one of the node hosts. After the smart contract is successfully released, the lending host 120 transmits the digital currency or payment token to the smart contract for custody. In fact, the lending host 120 is a computer device located on the lender's side and can deliver digital currency or tokens to the seller according to the amount of the lending relationship.

賣方端主機130作為節點主機其中之一,所述賣方端主機130在智慧合約成功發布後,將資產通證傳送至智慧合約以進行託管。實際上,賣方端主機130是位於賣方的計算機裝置,此賣方會將應交付的商品/服務交付給買方。 The seller-side host 130 serves as one of the node hosts. After the smart contract is successfully released, the seller-side host 130 transmits the asset token to the smart contract for custody. In fact, the seller-side host 130 is a computer device located at the seller, who will deliver the goods/services to be delivered to the buyer.

中介端主機140作為節點主機其中之一,所述中介端主機140用以允許直接觸發執行智慧合約的交付函式及退還函式。換句話說,中介端主機140是位於中介方的計算機裝置,其作為監督角色,用以在發生交易糾紛時進行仲裁,假設仲裁結果為「需交付」則直接執行智慧合約的交付函式,反之,假設仲裁結果為「取消交易」,則將直接執行智慧合約的退還函式。 The intermediary host 140 serves as one of the node hosts. The intermediary host 140 is used to allow direct triggering of execution of the delivery function and return function of the smart contract. In other words, the intermediary host 140 is a computer device located at the intermediary. It serves as a supervisor to conduct arbitration when a transaction dispute occurs. If the arbitration result is "delivery required", the delivery function of the smart contract will be directly executed. Otherwise, the delivery function of the smart contract will be directly executed. , assuming the arbitration result is "cancel transaction", the return function of the smart contract will be executed directly.

承上所述,當資產通證以及數位貨幣或支付通證皆已託管於智慧合約時,允許買方端主機110、借出端主機120、賣方端主機130及中介端主機140其中之一觸發執行智慧合約的交付函式,使智慧合約將資產通證轉移至買方端主機110、將數位貨幣或支付通證轉移至賣方端主機130,以及在借貸訊息中記錄為借貸已執行,或是在智慧合約存在託管的債權通證時,將債權通證轉移至借出端主機120,當交付函式執行結束後,買方端主機110根據借貸訊息及借出 端主機120持有的債權通證或兩者任一計算還款數額,以便向借出端主機120進行還款。 As mentioned above, when the asset token and digital currency or payment token are all hosted in the smart contract, one of the buyer-side host 110, the lending-side host 120, the seller-side host 130 and the intermediary-side host 140 is allowed to trigger execution. The delivery function of the smart contract enables the smart contract to transfer the asset token to the buyer's host 110, transfer the digital currency or payment token to the seller's host 130, and record it in the loan message as the loan has been executed, or in the smart contract When there is an escrowd debt token in the contract, the debt token is transferred to the lending host 120. When the execution of the delivery function is completed, the buyer's host 110 The debt token held by the end host 120 or either of the two is used to calculate the repayment amount in order to repay the loan to the lending end host 120.

請參閱「第2圖」,「第2圖」為本發明基於區塊鏈與智慧合約的多方借貸消費方法的第一實施例之方法流程圖,應用在由多個節點主機組成的區塊鏈網路100,其步驟包括:提供分別作為節點主機其中之一的買方端主機110、借出端主機120、賣方端主機130及中介端主機140,其中,中介端主機140允許直接觸發執行智慧合約的交付函式及退還函式(步驟210);在包含借貸訊息的智慧合約成功發布於區塊鏈網路100之後,允許買方端主機110將債權通證傳送至智慧合約以進行託管、賣方端主機130將資產通證傳送至智慧合約以進行託管,以及借出端主機120將數位貨幣或支付通證傳送至智慧合約以進行託管(步驟220);當債權通證及資產通證,以及數位貨幣或支付通證皆已託管於智慧合約時,允許買方端主機110、借出端主機120、賣方端主機130及中介端主機140其中之一觸發執行智慧合約的交付函式,使智慧合約將資產通證轉移至買方端主機110、將數位貨幣或支付通證轉移至賣方端主機130,以及在借貸訊息中記錄為借貸已執行,或在智慧合約存在託管的所述債權通證時,將債權通證轉移至借出端主機120(步驟230);以及在交付函式執行結束後,買方端主機110根據借貸訊息及借出端主機120持有的債權通證或兩者任一計算還款數額,以便向借出端主機120進行還款(步驟240)。透過上述步驟,即可透過在區塊鏈網路100提供買方端主機110、借出端主機120、賣方端主機130及中介端主機140,其中買方端主機110與賣方端主機130為交付關係,買方端主機110與借出端主機120為借貸關係,借出端主機120與賣方端主機130為支付關係,接著當買方端主機110進行借貸消費時,使用智慧合約託管數位貨幣及通證,並且在偵測到賣方 端主機130交付資產給買方端主機110後,再由借出端主機120向賣方端主機130進行支付,以及允許中介端主機140仲裁交易。 Please refer to "Figure 2". "Figure 2" is a method flow chart of the first embodiment of the multi-party loan consumption method based on blockchain and smart contracts of the present invention, which is applied to a blockchain composed of multiple node hosts. The steps of the network 100 include: providing a buyer-side host 110, a lending-side host 120, a seller-side host 130 and an intermediary-side host 140 respectively as one of the node hosts. The intermediary-side host 140 allows direct triggering of smart contract execution. The delivery function and return function (step 210); after the smart contract containing the loan information is successfully published on the blockchain network 100, the buyer-side host 110 is allowed to transmit the debt token to the smart contract for custody, and the seller-side The host 130 transmits the asset token to the smart contract for custody, and the lending host 120 transmits the digital currency or payment token to the smart contract for custody (step 220); when the debt token and asset token, and the digital When the currency or payment token has been hosted in the smart contract, one of the buyer-side host 110, the lending-side host 120, the seller-side host 130 and the intermediary-side host 140 is allowed to trigger the execution of the delivery function of the smart contract, so that the smart contract will The asset token is transferred to the buyer-side host 110, the digital currency or payment token is transferred to the seller-side host 130, and is recorded in the loan message as the loan has been executed, or when the smart contract has the debt token in custody, The debt token is transferred to the lending host 120 (step 230); and after the execution of the delivery function is completed, the buyer's host 110 calculates the repayment according to the loan information and the debt token held by the lending host 120 or both. The amount of the loan is determined in order to repay the loan to the lending host 120 (step 240). Through the above steps, the buyer-side host 110, the lending-side host 120, the seller-side host 130 and the intermediary-side host 140 can be provided on the blockchain network 100, where the buyer-side host 110 and the seller-side host 130 are in a delivery relationship. The buyer-side host 110 and the lending-side host 120 are in a lending relationship, and the lending-side host 120 and the seller-side host 130 are in a payment relationship. Then when the buyer-side host 110 performs loan consumption, the smart contract is used to host the digital currency and tokens, and Seller detected After the end host 130 delivers the assets to the buyer end host 110, the lending end host 120 pays the seller end host 130 and allows the intermediary end host 140 to arbitrate the transaction.

另外,在步驟240之後,當超過逾時時間未執行交付函式時,由智慧合約觸發執行退還函式,或由買方端主機110、借出端主機120、賣方端主機130或中介端主機140觸發執行此退還函式,用以允許買方端主機110取回託管的債權通證、允許賣方端主機130取回託管的資產通證,以及允許借出端主機120取回託管的數位貨幣或支付通證(步驟250)。 In addition, after step 240, when the delivery function is not executed after the timeout period, the smart contract triggers the execution of the return function, or the buyer-side host 110, the lending-side host 120, the seller-side host 130 or the intermediary-side host 140 Trigger the execution of this return function to allow the buyer-side host 110 to retrieve the custody of the debt token, allow the seller-side host 130 to retrieve the custody of the asset token, and allow the lending-side host 120 to retrieve the custody of digital currency or payment Token (step 250).

接著,請參閱「第3圖」,「第3圖」為本發明基於區塊鏈與智慧合約的多方借貸消費系統的第二實施例之系統方塊圖,應用在多個節點主機組成的區塊鏈網路300,此系統包含:買方端主機310、借出端主機320、賣方端主機330及中介端主機340。其中,買方端主機310作為節點主機其中之一,所述買方端主機310用以在借貸關係智慧合約發布於區塊鏈網路300之後,允許在借貸關係智慧合約中設定第一雜湊值,其中第一雜湊值係由第一解鎖密語進行雜湊計算所生成。舉例來說,假設第一解鎖密語為「abc」,那麼可透過雜湊函式(如:MD5、SHA1、SHA256等等)對第一解鎖密語進行雜湊計算,用以生成相應的第一雜湊值。在實際實施上,借貸關係智慧合約中需記錄使用的雜湊函式、借出端主機地址、欲借款量及賣方端主機地址等等,而且所述借貸關係智慧合約可以由買方端主機310或借出端主機320建立並發布在區塊鏈網路300。另外,除了買方端主機310可設定第一雜湊值之外,借出端主機320及賣方端主機330同樣也可以設定第一雜湊值,只不過差異在於借出端主機320是在支付關係智慧合約中設定第一雜湊值,而賣方端主機330則是在交付關係智慧合約中設定第一雜湊值。特別要說明的是,當買方端主機310、借出端主機320及賣方端主機330其中 之一成為最早在智慧合約中設定第一雜湊值的一方,而且中介端主機340也在同一個智慧合約設定第二雜湊值之後,其餘二方會使尚未設定第一雜湊值及第二雜湊值的另外二個智慧合約跟隨相同的設定,換句話說,三個智慧合約中的第一雜湊值及第二雜湊值均會相同。稍後將分別以買方端主機310、借出端主機320及賣方端主機330成為最早設定第一雜湊值的一方為例來做進一步說明。 Next, please refer to "Figure 3". "Figure 3" is a system block diagram of the second embodiment of the multi-party lending and consumption system based on blockchain and smart contracts of the present invention, which is applied to a block composed of multiple node hosts. Link network 300, this system includes: buyer-side host 310, lending-side host 320, seller-side host 330 and intermediary-side host 340. Among them, the buyer-side host 310 serves as one of the node hosts. The buyer-side host 310 is used to allow the first hash value to be set in the loan-lending relationship smart contract after the loan-lending relationship smart contract is published on the blockchain network 300, where The first hash value is generated by performing hash calculation on the first unlocking password. For example, assuming that the first unlocking password is "abc", the first unlocking password can be hashed using a hash function (such as MD5, SHA1, SHA256, etc.) to generate the corresponding first hash value. In actual implementation, the lending relationship smart contract needs to record the used hash function, the lending host address, the amount to be borrowed, the seller's host address, etc., and the lending relationship smart contract can be controlled by the buyer's host 310 or the lending host. The outgoing host 320 is established and published on the blockchain network 300. In addition, in addition to the buyer's host 310 being able to set the first hash value, the lender's host 320 and the seller's host 330 can also be setting the first hash value, but the difference is that the lender's host 320 is paying the relationship smart contract. The first hash value is set in the delivery relationship smart contract, and the seller-side host 330 sets the first hash value in the delivery relationship smart contract. It should be noted in particular that when the buyer-side host 310, the lending-side host 320 and the seller-side host 330 One of the parties becomes the first party to set the first hash value in the smart contract, and after the intermediary host 340 also sets the second hash value in the same smart contract, the other two parties will not set the first hash value and the second hash value. The other two smart contracts follow the same settings. In other words, the first hash value and the second hash value in the three smart contracts will be the same. Further explanation will be given later by taking the buyer-side host 310, the lending-side host 320 and the seller-side host 330 as the first party to set the first hash value respectively as an example.

借出端主機320作為節點主機其中之一,此借出端主機320用以在支付關係智慧合約發布於區塊鏈網路300之後,允許在支付關係智慧合約設定第一雜湊值,並且將數位貨幣或支付通證傳送至支付關係智慧合約以進行託管。在實際實施上,支付關係智慧合約包含賣方端主機地址及欲支付量,而且所述支付關係智慧合約可由借出端主機320或賣方端主機330建立並發布在區塊鏈網路300。 The lending host 320 serves as one of the node hosts. This lending host 320 is used to allow the payment relationship smart contract to set the first hash value in the payment relationship smart contract after it is published on the blockchain network 300, and convert the digital Currency or payment tokens are sent to the payment relationship smart contract for escrow. In actual implementation, the payment relationship smart contract includes the seller's host address and the amount to be paid, and the payment relationship smart contract can be established by the lending host 320 or the seller's host 330 and published on the blockchain network 300.

賣方端主機330作為節點主機其中之一,所述賣方端主機330用以在交付關係智慧合約發布於區塊鏈網路300之後,允許在交付關係智慧合約設定第一雜湊值,並且將資產通證傳送至交付關係智慧合約以進行託管。在實際實施上,所述交付關係智慧合約可由買方端主機310或賣方端主機330建立並發布在區塊鏈網路300,假設交付關係智慧合約是由賣方端主機330建立並發布的情況下,此交付關係智慧合約可包含買方端主機地址、欲購買資產及應支付量,反之,假設所述交付關係智慧合約是由買方端主機310建立並發布的情況下,則前述交付關係智慧合約所包含的買方端主機地址則需改為賣方端主機地址,換句話說,交付關係智慧合約若由賣方建立則需在其中指定買方,反之若由買方建立則需在其中指定賣方。 The seller-side host 330 serves as one of the node hosts. The seller-side host 330 is used to allow the first hash value to be set in the delivery relationship smart contract after the delivery relationship smart contract is published on the blockchain network 300, and to pass the assets through The certificate is sent to the delivery relationship smart contract for escrow. In actual implementation, the delivery relationship smart contract can be established and published on the blockchain network 300 by the buyer-side host 310 or the seller-side host 330. Assuming that the delivery relationship smart contract is established and published by the seller-side host 330, This delivery relationship smart contract may include the buyer's host address, the asset to be purchased and the amount to be paid. On the contrary, assuming that the delivery relationship smart contract is established and published by the buyer's host 310, the aforementioned delivery relationship smart contract includes The buyer-side host address needs to be changed to the seller-side host address. In other words, if the delivery relationship smart contract is established by the seller, the buyer needs to be specified in it; otherwise, if it is established by the buyer, the seller needs to be specified in it.

中介端主機340作為節點主機其中之一,所述中介端主機340用以在已設定第一雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約中設定第二雜湊值,此第二雜湊值係由第二解鎖密語進行雜湊計算所生成。假設第二解鎖密語為「123」,那麼可透過雜湊函式對第二解鎖密語進行雜湊計算,用以生成相應的第二雜湊值,而借貸關係智慧合約中也會記錄第二雜湊值透過哪一種雜湊函式所生成。在實際實施上,中介端主機340可以透過提供第二解鎖密語來使交付關係智慧合約執行交付流程,以及使支付關係智慧合約執行支付流程,除此之外,當借貸關係智慧合約、交付關係智慧合約及支付關係智慧合約分別具有一個逾時時間時,例如:借貸關係智慧合約具有第一逾時時間、交付關係智慧合約具有第二逾時時間及支付關係智慧合約具有第三逾時時間,中介端主機340也可在買方端主機310不提供第一解鎖密語的情況下,同樣不提供第二解鎖密語,進而使交付關係智慧合約無法在第二逾時時間內接收到第一解鎖密語及第二解鎖密語,導致賣方端主機330能夠取回託管的資產通證,以及使支付關係智慧合約無法在第三逾時時間內接收到第一解鎖密語及第二解鎖密語,導致借出端主機320能夠取回託管的數位貨幣或支付通證,甚至在已託管債權通證的情況下,使借貸關係智慧合約無法在第一逾時時間內接收到第一解鎖密語及第二解鎖密語,導致買方端主機310能夠從借貸關係智慧合約取回託管的債權通證。 The intermediary host 340 serves as one of the node hosts. The intermediary host 340 is used to set the second hash value in the loan relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract that has set the first hash value. The second hash value is generated by hash calculation of the second unlocking password. Assume that the second unlocking password is "123", then the hash function can be used to perform hash calculation on the second unlocking password to generate the corresponding second hash value, and the lending relationship smart contract will also record where the second hash value is passed. Generated by a hash function. In actual implementation, the intermediary host 340 can make the delivery relationship smart contract execute the delivery process and the payment relationship smart contract execute the payment process by providing the second unlocking password. In addition, when the loan relationship smart contract and the delivery relationship smart contract When the contract and the payment relationship smart contract each have a timeout time, for example: the loan relationship smart contract has a first timeout time, the delivery relationship smart contract has a second timeout time, and the payment relationship smart contract has a third timeout time, the intermediary The end host 340 may also not provide the second unlocking password when the buyer's host 310 does not provide the first unlocking password, so that the delivery relationship smart contract cannot receive the first unlocking password and the third unlocking password within the second timeout period. The second unlocking password causes the seller-side host 330 to retrieve the managed asset token, and the payment relationship smart contract cannot receive the first unlocking password and the second unlocking password within the third timeout period, causing the lending-side host 320 to Being able to retrieve custody of digital currency or payment tokens, even when debt tokens have been custody, makes the lending relationship smart contract unable to receive the first unlocking password and the second unlocking password within the first timeout period, causing the buyer to The end host 310 can retrieve the managed debt token from the lending relationship smart contract.

承上所述,在買方端主機310、借出端主機320及賣方端主機330之中,非最早設定第一雜湊值的二者會從已設定第一雜湊值及第二雜湊值的智慧合約中獲得第一雜湊值及第二雜湊值,再將獲得的第一雜湊值及第二雜湊值設定在尚未設定第一雜湊值及第二雜湊值的借貸關係智慧合約、支付關係智慧 合約或交付關係智慧合約之中,在進行設定時,借貸關係智慧合約允許託管來自買方端主機310的債權通證,交付關係智慧合約同時託管來自賣方端主機330的資產通證,支付關係智慧合約同時託管來自借出端主機320的數位貨幣或支付通證。接著,在確定執行交易時,由最早設定第一雜湊值的買方端主機310、賣方端主機330或借出端主機320將第一解鎖密語傳送至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,或由中介端主機340傳送第二解鎖密語至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機310、借出端主機320或賣方端主機330,並且公開接收到的第一解鎖密語或第二解鎖密語。接下來,在買方端主機310、借出端主機320及賣方端主機330之中,非最早設定第一雜湊值的二者,在偵測到公開的第一解鎖密語或第二解鎖密語時,允許將偵測到的第一解鎖密語或第二解鎖密語傳送至未公開第一解鎖密語或第二解鎖密語的交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使其在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機310、借出端主機320或賣方端主機330,以及當偵測到的第一解鎖密語或第二解鎖密語傳送至借貸關係智慧合約時,允許將借貸關係智慧合約的借貸狀態記錄為借貸已執行或將託管的債權通證傳送至借出端主機320。 Based on the above, among the buyer-side host 310, the lending-side host 320 and the seller-side host 330, the two that are not the first to set the first hash value will start from the smart contract that has set the first hash value and the second hash value. Obtain the first hash value and the second hash value, and then set the first hash value and the second hash value obtained in the loan relationship smart contract and the payment relationship smart contract where the first hash value and the second hash value have not been set. In the contract or delivery relationship smart contract, when setting up, the lending relationship smart contract allows the custody of debt tokens from the buyer-side host 310, the delivery relationship smart contract also hosts the asset tokens from the seller-side host 330, and the payment relationship smart contract At the same time, the digital currency or payment token from the lending host 320 is hosted. Then, when it is determined to execute the transaction, the buyer-side host 310, the seller-side host 330, or the lending-side host 320 that sets the first hash value at the earliest sends the first unlocking password to the delivery relationship smart contract, the lending relationship smart contract, or the payment relationship. The smart contract, or the intermediary host 340 sends the second unlocking password to the delivery relationship smart contract, the lending relationship smart contract, or the payment relationship smart contract, so that the delivery relationship smart contract, the lending relationship smart contract, or the payment relationship smart contract receives the matching first When the first unlocking password of a hash value or the second unlocking password of the second hash value is matched, the managed asset token, debt token, digital currency or payment token is transmitted to the buyer-side host 310 and the lending-side host 320 Or the seller end host 330, and discloses the received first unlocking password or the second unlocking password. Next, among the buyer-side host 310, the lending-side host 320, and the seller-side host 330, the two that are not the first to set the first hash value detect the first unlocking password or the second unlocking password that is disclosed, Allows the detected first unlocking secret word or second unlocking secret word to be transmitted to a delivery relationship smart contract, lending relationship smart contract or payment relationship smart contract that does not disclose the first unlocking secret word or second unlocking secret word, so that it can receive a matching When the first unlocking password of the first hash value or the second unlocking password of the second hash value matches, the managed asset token, debt token, digital currency or payment token is transmitted to the buyer-end host 310 and the lending-end host 320 or the seller's host 330, and when the detected first unlocking password or the second unlocking password is transmitted to the lending relationship smart contract, the lending status of the lending relationship smart contract is allowed to be recorded as the loan has been executed or the creditor's rights pass will be managed. The certificate is sent to the lending host 320.

以下分別以買方端主機310、借出端主機320及賣方端主機330成為最早設定第一雜湊值的一方為例,進一步說明多方(即:買方端主機310、借出端主機320、賣方端主機330及中介端340)之間的處理流程: The following takes the buyer-side host 310, the lending-side host 320, and the seller-side host 330 as the first party to set the first hash value as an example to further illustrate the multiple parties (i.e., the buyer-side host 310, the lending-side host 320, and the seller-side host). The processing flow between 330 and intermediary 340):

首先,以買方端主機310先在借貸關係智慧合約中設定第一雜湊值為例,中介端主機340會在同一個智慧合約中設定第二雜湊值,當進行交易時,買方端主機310會將第一解鎖密語傳送至交付關係智慧合約,以便對第一解鎖密語進行雜湊運算,用以與交付關係智慧合約中的第一雜湊值進行比對,當比對相符便在交付關係智慧合約公開第一解鎖密語,同時交付託管的資產通證。當借出端主機320及賣方端主機330偵測到交付關係智慧合約公開的第一解鎖密語時,借出端主機320會取得此第一解鎖密語以提交至借貸關係智慧合約解鎖,以便獲得借貸關係智慧合約託管的債權通證或將借貸關係智慧合約的借貸狀態記錄為借貸已執行;賣方端主機330則會取得此第一解鎖密語以提交至支付關係智慧合約解鎖,以便獲得支付關係智慧合約託管的數位貨幣或支付通證。此處所述的解鎖是指解開雜湊鎖定(Hash-locking),使智慧合約交付/支付其託管的資產、通證或數位貨幣以完成交易。 First, for example, the buyer-side host 310 first sets the first hash value in the loan relationship smart contract. The intermediary-side host 340 will set the second hash value in the same smart contract. When the transaction is performed, the buyer-side host 310 will The first unlocking password is sent to the delivery relationship smart contract so that the first unlocking password can be hashed and compared with the first hash value in the delivery relationship smart contract. When the comparison matches, the first hash value will be disclosed in the delivery relationship smart contract. Once the password is unlocked, the managed asset token will be delivered at the same time. When the lending host 320 and the seller host 330 detect the first unlocking password disclosed by the delivery relationship smart contract, the lending host 320 will obtain the first unlocking password and submit it to the lending relationship smart contract for unlocking in order to obtain the loan. The debt token hosted by the relationship smart contract may record the loan status of the loan relationship smart contract as the loan has been executed; the seller's host 330 will obtain this first unlocking password and submit it to the payment relationship smart contract for unlocking, in order to obtain the payment relationship smart contract Custodial digital currency or payment token. The unlocking described here refers to unlocking the hash-locking (Hash-locking), allowing the smart contract to deliver/pay the assets, tokens or digital currencies in its custody to complete the transaction.

接著,以借出端主機320先在支付關係智慧合約中設定第一雜湊值為例,中介端主機340會在此支付關係智慧合約中設定第二雜湊值,當進行交易時,借出端主機320會將第一解鎖密語傳送至借貸關係智慧合約,以便對第一解鎖密語進行雜湊運算,用以與借貸關係智慧合約中的第一雜湊值進行比對,當比對相符便在借貸關係智慧合約公開第一解鎖密語,同時獲得借貸關係智慧合約託管的債權通證或將借貸關係智慧合約的借貸狀態記錄為借貸已執行。當買方端主機310及賣方端主機330偵測到借貸關係智慧合約公開的第一解鎖密語 時,買方端主機310會取得此第一解鎖密語以提交至交付關係智慧合約解鎖,以便獲得交付關係智慧合約託管的資產通證;賣方端主機330則會取得此第一解鎖密語以提交至支付關係智慧合約解鎖,以便獲得支付關係智慧合約託管的數位貨幣或支付通證。 Next, for example, the lending host 320 first sets the first hash value in the payment relationship smart contract. The intermediary host 340 will set the second hash value in the payment relationship smart contract. When the transaction is performed, the lending host 340 sets the second hash value in the payment relationship smart contract. 320 will transmit the first unlocking password to the loan relationship smart contract in order to perform a hash operation on the first unlocking password to compare it with the first hash value in the loan relationship smart contract. When the comparison matches, it will be in the loan relationship smart contract. The contract discloses the first unlocking password, and at the same time obtains the debt certificate hosted by the lending relationship smart contract or records the lending status of the lending relationship smart contract as the loan has been executed. When the buyer-side host 310 and the seller-side host 330 detect the first unlocking password disclosed by the lending relationship smart contract At this time, the buyer-side host 310 will obtain the first unlocking password and submit it to the delivery relationship smart contract for unlocking in order to obtain the asset token hosted by the delivery relationship smart contract; the seller-side host 330 will obtain the first unlocking password and submit it to the payment Unlock the relationship smart contract in order to obtain the digital currency or payment token hosted by the payment relationship smart contract.

最後,以賣方端主機330先在交付關係智慧合約中設定第一雜湊值為例,中介端主機340會在此交付關係智慧合約中設定第二雜湊值,當進行交易時,賣方端主機330會將第一解鎖密語傳送至支付關係智慧合約,以便對第一解鎖密語進行雜湊運算,用以與支付關係智慧合約中的第一雜湊值進行比對,當比對相符便在支付關係智慧合約公開第一解鎖密語,同時獲得支付關係智慧合約託管的數位貨幣或支付通證。當借出端主機320及買方端主機310偵測到支付關係智慧合約公開的第一解鎖密語時,借出端主機320會取得此第一解鎖密語以提交至借貸關係智慧合約解鎖,以便獲得借貸關係智慧合約託管的債權通證或將借貸關係智慧合約的借貸狀態記錄為借貸已執行;買方端主機310則會取得此第一解鎖密語以提交至交付關係智慧合約解鎖,以便獲得交付關係智慧合約託管的資產通證。 Finally, for example, the seller-side host 330 first sets the first hash value in the delivery relationship smart contract. The intermediary-side host 340 will set the second hash value in the delivery relationship smart contract. When the transaction is performed, the seller-side host 330 will Send the first unlocking password to the payment relationship smart contract so that the first unlocking password can be hashed and compared with the first hash value in the payment relationship smart contract. When the comparison matches, it will be made public in the payment relationship smart contract. Be the first to unlock the password and at the same time obtain the digital currency or payment token hosted by the smart contract of the payment relationship. When the lending host 320 and the buyer host 310 detect the first unlocking password disclosed by the payment relationship smart contract, the lending host 320 will obtain the first unlocking password and submit it to the lending relationship smart contract for unlocking in order to obtain the loan. The debt token hosted by the relationship smart contract may record the loan status of the loan relationship smart contract as the loan has been executed; the buyer's host 310 will obtain this first unlocking password and submit it to the delivery relationship smart contract for unlocking, in order to obtain the delivery relationship smart contract Custodial asset tokens.

請參閱「第4A圖」及「第4B圖」,「第4A圖」及「第4B圖」為本發明基於區塊鏈與智慧合約的多方借貸消費方法的第二實施例之方法流程圖,應用在由多個節點主機組成的區塊鏈網路300,其步驟包括:提供買方端主機310、借出端主機320、賣方端主機330及中介端主機340以分別作為節點主機其中之一(步驟410);買方端主機310或賣方端主機330在區塊鏈網路300發布交付關係智慧合約、買方端主機310或借出端主機320在區塊鏈網路300發布借貸關係智慧合約,借出端主機320或賣方端主機330在區塊鏈網路300發布支付關係 智慧合約(步驟420);在交付關係智慧合約、借貸關係智慧合約及支付關係智慧合約皆成功發布後,由所述買方端主機310在借貸關係智慧合約中設定第一雜湊值,或由借出端主機320在支付關係智慧合約中設定第一雜湊值,或由賣方端主機330在交付關係智慧合約中設定第一雜湊值,其中第一雜湊值係由第一解鎖密語進行雜湊計算所生成(步驟430);中介端主機340在已設定第一雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約中設定第二雜湊值,所述第二雜湊值係由第二解鎖密語進行雜湊計算所生成(步驟440);在買方端主機310、借出端主機320及賣方端主機330之中,非最早設定第一雜湊值的二者,將第一雜湊值及第二雜湊值設定在尚未設定第一雜湊值及第二雜湊值的借貸關係智慧合約、支付關係智慧合約或交付關係智慧合約之中,其中,在進行設定時,借貸關係智慧合約允許託管來自買方端主機310的債權通證,交付關係智慧合約同時託管來自賣方端主機330的資產通證,支付關係智慧合約同時託管來自借出端主機320的數位貨幣或支付通證(步驟450);在確定執行交易時,由最早設定第一雜湊值的買方端主機310、賣方端主機330或借出端主機320將第一解鎖密語傳送至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,或由中介端主機340傳送第二解鎖密語至交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機310、借出端主機320或賣方端主機330,並且公開接收到的第一解鎖密語或第二解鎖密語(步驟460);在買方端主機310、借出端主機320及賣方端主機330之中,非最早設定第一雜湊值的二者,在偵測到公開的第一解鎖密語或第二 解鎖密語時,允許將偵測到的第一解鎖密語或第二解鎖密語傳送至未公開第一解鎖密語或第二解鎖密語的交付關係智慧合約、借貸關係智慧合約或支付關係智慧合約,使其在接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的資產通證、債權通證、數位貨幣或支付通證傳送至買方端主機310、借出端主機320或賣方端主機330,以及當偵測到的第一解鎖密語或第二解鎖密語傳送至借貸關係智慧合約時,允許以將借貸關係智慧合約的借貸狀態記錄為借貸已執行(步驟470)。透過上述步驟,即可透過在區塊鏈網路300提供買方端主機310、借出端主機320、賣方端主機330及中介端主機340,其中買方端主機310與賣方端主機330為交付關係,買方端主機310與借出端主機320為借貸關係,借出端主機320與賣方端主機330為支付關係,接著當買方端主機310進行借貸消費時,使用智慧合約託管數位貨幣及通證,並且在偵測到賣方端主機330交付資產給買方端主機310後,再由借出端主機320向賣方端主機330進行支付,以及允許中介端主機340仲裁交易。 Please refer to "Figure 4A" and "Figure 4B". "Figure 4A" and "Figure 4B" are method flow charts of the second embodiment of the multi-party lending and consumption method based on blockchain and smart contracts of the present invention. When applied to a blockchain network 300 composed of multiple node hosts, the steps include: providing a buyer-side host 310, a lending-side host 320, a seller-side host 330 and an intermediary-side host 340 as one of the node hosts respectively ( Step 410); The buyer-side host 310 or the seller-side host 330 publishes the delivery relationship smart contract on the blockchain network 300, and the buyer-side host 310 or the lending host 320 publishes the lending relationship smart contract on the blockchain network 300. The outgoing host 320 or the seller host 330 publishes the payment relationship on the blockchain network 300 Smart contract (step 420); after the delivery relationship smart contract, the lending relationship smart contract and the payment relationship smart contract are all successfully released, the buyer-side host 310 sets the first hash value in the lending relationship smart contract, or by lending The end host 320 sets the first hash value in the payment relationship smart contract, or the seller end host 330 sets the first hash value in the delivery relationship smart contract, where the first hash value is generated by hash calculation using the first unlocking password ( Step 430); The intermediary host 340 sets a second hash value in the loan relationship smart contract, payment relationship smart contract or delivery relationship smart contract that has set the first hash value, and the second hash value is determined by the second unlocking password. Generated by hash calculation (step 440); among the buyer-side host 310, the lending-side host 320, and the seller-side host 330, the one that is not the first to set the first hash value sets the first hash value and the second hash value. In the lending relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract in which the first hash value and the second hash value have not been set, the lending relationship smart contract allows the custody of claims from the buyer-side host 310 when setting. Token, the smart contract of the delivery relationship also hosts the asset token from the seller's host 330, and the smart contract of the payment relationship also hosts the digital currency or payment token from the lending host 320 (step 450); when it is determined to execute the transaction, The buyer-side host 310, the seller-side host 330, or the lending-side host 320 that sets the first hash value at the earliest sends the first unlocking password to the delivery relationship smart contract, the lending relationship smart contract, or the payment relationship smart contract, or by the intermediary-side host 340 Send the second unlocking password to the delivery relationship smart contract, lending relationship smart contract or payment relationship smart contract, so that the delivery relationship smart contract, lending relationship smart contract or payment relationship smart contract receives the first unlocking password matching the first hash value or When the second unlocking password of the second hash value is matched, the managed asset token, debt token, digital currency or payment token is transmitted to the buyer-side host 310, the lending-side host 320 or the seller-side host 330, and is publicly received The first unlocking password or the second unlocking password is obtained (step 460); among the buyer-side host 310, the lending-side host 320, and the seller-side host 330, the two that are not the first to set the first hash value are detected. Revealed first unlocking secret word or second When unlocking the secret word, the detected first unlocking secret word or second unlocking secret word is allowed to be transmitted to the delivery relationship smart contract, lending relationship smart contract or payment relationship smart contract that does not disclose the first unlocking secret word or second unlocking secret word, so that it can When receiving the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value, transmit the managed asset token, debt token, digital currency or payment token to the buyer-end host 310, The lending host 320 or the seller host 330, and when the detected first unlocking password or the second unlocking password is transmitted to the lending relationship smart contract, is allowed to record the lending status of the lending relationship smart contract as the loan has been executed ( Step 470). Through the above steps, the buyer-side host 310, the lending-side host 320, the seller-side host 330 and the intermediary-side host 340 can be provided on the blockchain network 300, where the buyer-side host 310 and the seller-side host 330 are in a delivery relationship. The buyer-side host 310 and the lending-side host 320 are in a lending relationship, and the lending-side host 320 and the seller-side host 330 are in a payment relationship. Then when the buyer-side host 310 performs loan consumption, the smart contract is used to host the digital currency and tokens, and After detecting that the seller-side host 330 delivers assets to the buyer-side host 310, the lending-side host 320 pays the seller-side host 330 and allows the intermediary-side host 340 to arbitrate the transaction.

另外,在步驟470之後,倘若在借貸關係智慧合約、支付關係智慧合約及交付關係智慧合約中分別設定有一個逾時時間,當未在此逾時時間內接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,允許賣方端主機330取回託管的資產通證、允許買方端主機310取回託管的債權通證,以及允許借出端主機320取回託管的數位貨幣或支付通證(步驟480)。換句話說,當超過逾時時間未收到匹配的解鎖密語,則各智慧合約會退還其託管的資產、通證或數位貨幣。 In addition, after step 470, if there is a timeout time set in the lending relationship smart contract, the payment relationship smart contract and the delivery relationship smart contract respectively, when the first hash value matching the first hash value is not received within the timeout time, When the unlocking password or the second unlocking password matches the second hash value, the seller-side host 330 is allowed to retrieve the managed asset token, the buyer-side host 310 is allowed to retrieve the managed debt token, and the lending-side host 320 is allowed to retrieve it. Escrow digital currency or payment token (step 480). In other words, when the matching unlocking password is not received after the timeout period, each smart contract will return the assets, tokens or digital currencies in its custody.

特別要說明的是,在實際實施上,本發明所述的各種主機皆可利用各種方式來實現,包含軟體、硬體或其任意組合,例如,在某些實施方式中, 各主機可利用軟體(如:虛擬機器、容器等等)及硬體或其中之一來實現,除此之外,本發明亦可部分地或完全地基於硬體來實現,例如,系統中的一個或多個主機可以透過積體電路晶片、系統單晶片(System on Chip,SoC)、複雜可程式邏輯裝置(Complex Programmable Logic Device,CPLD)、現場可程式邏輯閘陣列(Field Programmable Gate Array,FPGA)等來實現。本發明可以是系統、方法及/或電腦程式。電腦程式可以包括電腦可讀儲存媒體,其上載有用於使處理器實現本發明的各個方面的電腦可讀程式指令,電腦可讀儲存媒體可以是可以保持和儲存由指令執行設備使用的指令的有形設備。電腦可讀儲存媒體可以是但不限於電儲存設備、磁儲存設備、光儲存設備、電磁儲存設備、半導體儲存設備或上述的任意合適的組合。電腦可讀儲存媒體的更具體的例子(非窮舉的列表)包括:硬碟、隨機存取記憶體、唯讀記憶體、快閃記憶體、光碟、軟碟以及上述的任意合適的組合。此處所使用的電腦可讀儲存媒體不被解釋為瞬時信號本身,諸如無線電波或者其它自由傳播的電磁波、通過波導或其它傳輸媒介傳播的電磁波(例如,通過光纖電纜的光信號)、或者通過電線傳輸的電信號。另外,此處所描述的電腦可讀程式指令可以從電腦可讀儲存媒體下載到各個計算/處理設備,或者通過網路,例如:網際網路、區域網路、廣域網路及/或無線網路下載到外部電腦設備或外部儲存設備。網路可以包括銅傳輸電纜、光纖傳輸、無線傳輸、路由器、防火牆、交換器、集線器及/或閘道器。每一個計算/處理設備中的網路卡或者網路介面從網路接收電腦可讀程式指令,並轉發此電腦可讀程式指令,以供儲存在各個計算/處理設備中的電腦可讀儲存媒體中。執行本發明操作的電腦程式指令可以是組合語言指令、指令集架構指令、機器指令、機器相關指令、微指令、韌體指令、或者以一種或多種 程式語言的任意組合編寫的原始碼或目的碼(Object Code),所述程式語言包括物件導向的程式語言,如:Common Lisp、Python、C++、Objective-C、Smalltalk、Delphi、Java、Swift、C#、Perl、Ruby與PHP等,以及常規的程序式(Procedural)程式語言,如:C語言或類似的程式語言。所述電腦程式指令可以完全地在電腦上執行、部分地在電腦上執行、作為一個獨立的軟體執行、部分在客戶端電腦上部分在遠端電腦上執行、或者完全在遠端電腦或伺服器上執行。 It should be noted that in actual implementation, various hosts described in the present invention can be implemented in various ways, including software, hardware or any combination thereof. For example, in some implementations, Each host can be implemented using software (such as virtual machines, containers, etc.) and hardware, or one of them. In addition, the present invention can also be implemented partially or completely based on hardware, for example, in the system One or more hosts can operate through integrated circuit chips, System on Chip (SoC), Complex Programmable Logic Device (CPLD), Field Programmable Gate Array (FPGA) ) and so on. The invention may be a system, method and/or computer program. The computer program may include a computer-readable storage medium having computer-readable program instructions for causing a processor to implement various aspects of the invention. The computer-readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. equipment. The computer-readable storage medium may be, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: hard disks, random access memory, read-only memory, flash memory, optical disks, floppy disks, and any suitable combination of the above. As used herein, computer-readable storage media is not to be construed as a reference to transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical signals through fiber optic cables), or through electrical wires. transmitted electrical signals. In addition, the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded through a network, such as the Internet, a local area network, a wide area network and/or a wireless network to an external computer device or external storage device. Networks may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, hubs and/or gateways. A network card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage on a computer-readable storage medium in each computing/processing device middle. The computer program instructions that perform the operations of the present invention may be combination language instructions, instruction set architecture instructions, machine instructions, machine-related instructions, micro-instructions, firmware instructions, or one or more Source code or object code written in any combination of programming languages, including object-oriented programming languages, such as: Common Lisp, Python, C++, Objective-C, Smalltalk, Delphi, Java, Swift, C# , Perl, Ruby and PHP, etc., as well as conventional procedural (Procedural) programming languages, such as: C language or similar programming languages. The computer program instructions may execute entirely on the computer, partly on the computer, as stand-alone software, partly on the client computer and partly on a remote computer, or entirely on the remote computer or server. execute on.

以下配合「第5圖」及「第6圖」以實施例的方式進行如下說明,請先參閱「第5圖」,「第5圖」為應用本發明進行借貸消費之示意圖。首先,買方端主機110(可簡稱為買方)、中介端主機140(可簡稱為中介方)、賣方端主機130(可簡稱為賣方)及借出端主機120(可簡稱為借出方)可以視為四方主機。在這四方主機中,買方端主機110與賣方端主機130之間為交付關係,即:賣方交付商品/服務給買方;買方端主機110與借出端主機120之間為借貸關係,即:買方向借出方申貸;賣方端主機130與借出端主機120之間為支付關係,即:借出方支付數位貨幣或支付通證給賣方,至於中介端主機140則是獨立於買方端主機110、賣方端主機130及借出端主機120之外的監督角色,用以在需要仲裁時決定執行交付或退還。在實際實施上,假設如第一實施例使用單一智慧合約來實現,並且使用債權通證來記錄借貸的債權債務關係的情況下,其整體借貸消費流程如下: The following description is given in the form of an embodiment in conjunction with "Figure 5" and "Figure 6". Please refer to "Figure 5" first. "Figure 5" is a schematic diagram of applying the present invention for loan consumption. First, the buyer-side host 110 (may be referred to as the buyer), the intermediary-side host 140 (may be referred to as the intermediary), the seller-side host 130 (may be referred to as the seller), and the lending-side host 120 (may be referred to as the lender) can Considered as a four-party host. Among these four hosts, the buyer-side host 110 and the seller-side host 130 have a delivery relationship, that is, the seller delivers goods/services to the buyer; the buyer-side host 110 and the lending-side host 120 have a loan relationship, that is, the buyer Apply for a loan to the lender; the seller's host 130 and the lender's host 120 have a payment relationship, that is, the lender pays digital currency or payment tokens to the seller, while the intermediary host 140 is independent of the buyer's host 110. A supervisory role other than the seller's host 130 and the lending host 120 to decide whether to deliver or return when arbitration is required. In actual implementation, assuming that a single smart contract is used to implement the first embodiment, and debt tokens are used to record the creditor-debt relationship of loans, the overall loan consumption process is as follows:

1.在初始時,可由四方中的任一方建立一個智慧合約,並且在此智慧合約中指定其餘三方,以及包含欲購買資產、應支付量(即:應借量)及逾時時間等等。 1. At the beginning, any one of the four parties can create a smart contract, and specify the other three parties in the smart contract, including the assets to be purchased, the amount to be paid (ie: the amount to be borrowed), the overtime time, etc.

2.依照智慧合約的指示內容,買方將債權通證託管給智慧合約;賣方將資產通證託管給智慧合約;借出方將數位貨幣或支付通證託管給智慧合約。 2. According to the instructions of the smart contract, the buyer will trust the debt certificate to the smart contract; the seller will trust the asset certificate to the smart contract; the lender will trust the digital currency or payment certificate to the smart contract.

3.倘若在逾時時間之前,買方、賣方及借出方皆已在智慧合約中託管相應此次交易的數位貨幣或通證(如:債權通證、資產通證及支付通證)。那麼,可由四方中的任一方執行智慧合約的交付函式,使智慧合約將本身託管的數位貨幣或通證轉移至相應的對象,例如:將資產通證轉移給買方、將數位貨幣或支付通證轉移給賣方,以及將債權通證轉移給借出方。 3. If before the timeout period, the buyer, seller and lender have all custody the digital currency or token (such as debt token, asset token and payment token) corresponding to this transaction in the smart contract. Then, any one of the four parties can execute the delivery function of the smart contract, allowing the smart contract to transfer the digital currency or token it has custody to the corresponding object, for example: transfer the asset token to the buyer, transfer the digital currency or payment token The certificate is transferred to the seller, and the debt certificate is transferred to the lender.

如此一來,後續買方可依照智慧合約中的借貸訊息與借出方持有的債權通證計算還款數額,以便向借出方進行還款。特別要說明的是,假設超過逾時時間,即代表交易未完成,故允許買方從智慧合約中取回託管的債權通證、允許賣方從智慧合約中取回託管的資產通證,以及允許借出方從智慧合約中取回託管的數位貨幣或支付通證。另外,除了上述使用債權通證之外,也可在智慧合約中的借貸訊息記錄為借貸已執行。 In this way, the subsequent buyer can calculate the repayment amount based on the loan information in the smart contract and the debt certificate held by the lender in order to repay the lender. In particular, if the timeout period exceeds, it means that the transaction has not been completed. Therefore, the buyer is allowed to retrieve the custody of the debt token from the smart contract, the seller is allowed to retrieve the custody asset token from the smart contract, and the loan is allowed. The outgoing party retrieves the escrow digital currency or payment token from the smart contract. In addition, in addition to the above-mentioned use of debt tokens, the loan information in the smart contract can also be recorded as the loan has been executed.

接著,假設如第二實施例使用多個智慧合約來實現,並且買方為最早設定第一雜湊值的情況下,其整體借貸消費流程如下: Next, assuming that multiple smart contracts are used to implement the second embodiment, and the buyer is the earliest to set the first hash value, the overall loan consumption process is as follows:

1.買方建立一個交付關係智慧合約,並且在其中指定賣方、欲購買資產、應支付量等等,再發布至區塊鏈網路100。在實際實施上,所述交付關係智慧合約亦可由賣方建立並指定買方。 1. The buyer establishes a delivery relationship smart contract, specifies the seller, the assets to be purchased, the amount to be paid, etc., and then publishes it to the blockchain network 100. In actual implementation, the delivery relationship smart contract can also be established by the seller and designate the buyer.

2.買方根據交付關係智慧合約的內容,發布一個借貸關係智慧合約,並且在其中指定借出方、欲借款量及賣方。在實際實施上,所述借貸關係智慧合約亦可由借出方建立,而原本指定借出方則需改為指定買方。 2. The buyer publishes a lending relationship smart contract based on the content of the delivery relationship smart contract, and specifies the lender, the desired loan amount, and the seller. In actual implementation, the lending relationship smart contract can also be established by the lender, and the originally designated lender needs to be changed to the designated buyer.

3.借出方根據交付關係智慧合約及借貸關係智慧合約的資訊發布一個支付關係智慧合約,並且在其中指定賣方及欲支付量。所述支付關係智慧合約亦可由賣方建立,而原本指定賣方則需改為指定借出方(也就是實際的支付方)。 3. The lender issues a payment relationship smart contract based on the information of the delivery relationship smart contract and the lending relationship smart contract, and specifies the seller and the amount to be paid. The payment relationship smart contract can also be established by the seller, and the originally designated seller needs to be changed to the designated lender (that is, the actual payer).

4.當上述三個智慧合約皆建立後,買方對借貸關係智慧合約設定第一雜湊值與第一逾時時間;中介方對借貸關係智慧合約設定第二雜湊值;賣方對交付關係智慧合約設定第一雜湊值、第二雜湊值及第二逾時時間;借出方對支付關係智慧合約設定第一雜湊值、第二雜湊值及第三逾時時間。之後,若任何人提供第一解鎖密語或第二解鎖密語給所述借貸關係智慧合約,則所述借貸關係智慧合約會記錄為借貸已執行,此時,債權及債務成立。特別要說明的是,為了使中介方能夠作為監督角色以避免交易糾紛(如:鏈外交付行為的糾紛),所以需要在借貸關係智慧合約中設定對應第二解鎖密語的第二雜湊值,如此一來,當發生交易糾紛導致買方不願提供第一解鎖密語時,能夠由中介方判斷是否應執行交易,並且在應執行交易時,提供第二解鎖密語來強制執行交易。 4. When the above three smart contracts are established, the buyer sets the first hash value and the first timeout time for the lending relationship smart contract; the intermediary sets the second hash value for the lending relationship smart contract; the seller sets the delivery relationship smart contract The first hash value, the second hash value and the second overtime time; the lender sets the first hash value, the second hash value and the third overtime time for the payment relationship smart contract. Afterwards, if anyone provides the first unlocking secret word or the second unlocking secret word to the loan relationship smart contract, the loan relationship smart contract will be recorded as the loan has been executed, and at this time, the creditor's rights and debts are established. In particular, in order for the intermediary to act as a supervisor to avoid transaction disputes (such as disputes over off-chain delivery), it is necessary to set a second hash value corresponding to the second unlocking password in the lending relationship smart contract, as follows First, when a transaction dispute occurs and the buyer is unwilling to provide the first unlocking password, the intermediary can determine whether the transaction should be executed, and when the transaction should be executed, provide the second unlocking password to enforce the transaction.

5.賣方對所述交付關係智慧合約託管要交付的資產通證,同時設置第一雜湊值、第二雜湊值及第二逾時時間於所述交付關係智慧合約中;借出方對所述支付關係智慧合約託管要支付的數位貨幣或支付通證,同時設置第一雜湊值、第二雜湊值及第三逾時時間於所述支付關係智慧合約中。 5. The seller entrusts the asset token to be delivered to the delivery relationship smart contract, and sets the first hash value, the second hash value and the second timeout time in the delivery relationship smart contract; the lender The payment relationship smart contract hosts the digital currency or payment token to be paid, and at the same time sets the first hash value, the second hash value and the third timeout time in the payment relationship smart contract.

6.在確定執行交易時,由買方傳送第一解鎖密語至交付關係智慧合約,或由中介方傳送第二解鎖密語至交付關係智慧合約,使交付關係智慧合約在第二逾時時間內,接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊 值的第二解鎖密語時,將託管的所述資產通證傳送至買方,並且公開接收到的第一解鎖密語或第二解鎖密語。 6. When confirming the execution of the transaction, the buyer sends the first unlocking password to the delivery relationship smart contract, or the intermediary sends the second unlocking password to the delivery relationship smart contract, so that the delivery relationship smart contract receives the payment within the second timeout period. to the first unlocking password that matches the first hash value or to match the second hash value When the value of the second unlocking password is determined, the asset token in custody is transferred to the buyer, and the received first unlocking password or the second unlocking password is disclosed.

7.當賣方及借出方在交付關係智慧合約中偵測到公開的第一解鎖密語或第二解鎖密語時,賣方將偵測到的第一解鎖密語或第二解鎖密語傳送至支付關係智慧合約,使支付關係智慧合約在第三逾時時間內,接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,將託管的數位貨幣或支付通證傳送至賣方,以及借出方將偵測到的第一解鎖密語或第二解鎖密語傳送至借貸關係智慧合約以將借貸關係智慧合約的借貸狀態記錄為借貸已執行。 7. When the seller and the lender detect the public first unlocking password or the second unlocking password in the delivery relationship smart contract, the seller will send the detected first unlocking password or second unlocking password to the payment relationship intelligence The contract enables the payment relationship smart contract to transmit the managed digital currency or payment token when it receives the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value within the third timeout period. to the seller, and the lender transmits the detected first unlocking password or the second unlocking password to the lending relationship smart contract to record the lending status of the lending relationship smart contract as the loan has been executed.

同樣地,後續買方可依照所述借貸關係智慧合約中的借貸狀態判斷是否需要向借出方進行還款。特別要說明的是,交付關係智慧合約未在第二逾時時間內或支付關係智慧合約未在第三逾時時間內接收到匹配第一雜湊值的第一解鎖密語或匹配第二雜湊值的第二解鎖密語時,允許賣方取回託管的資產通證,以及允許借出方取回託管的數位貨幣或支付通證,此時買方的債務不成立。 Similarly, subsequent buyers can determine whether they need to repay the lender based on the lending status in the lending relationship smart contract. It should be noted in particular that the delivery relationship smart contract does not receive the first unlocking password that matches the first hash value or the second hash value that matches the second timeout period. When the second password is unlocked, the seller is allowed to retrieve the escrow asset token, and the lender is allowed to retrieve the escrow digital currency or payment token. At this time, the buyer's debt is not established.

如「第6圖」所示意,「第6圖」為應用本發明設定智慧合約之示意圖。前面提到,智慧合約係由買方端主機110、中介端主機140、賣方端主機130及借出端主機120其中之一進行建立及發布,借貸訊息包含買方端主機110、賣方端主機130、借出端主機120及中介端主機140之中,並非建立及發布此智慧合約的其中三者的地址,以及欲購買資產、應支付量及逾時時間。在實際實施上,欲建立智慧合約的一方為買方端主機110,其可開啟設定視窗600,並且在其中的輸入區塊(611~613)分別鍵入指定的賣方端主機130、借出端主機120 及中介端主機140的地址。接著,再於借貸消費輸入區塊(621~623)鍵入欲購買資產、應支付量及逾時時間。最後,點選確認元件630建立並發布智慧合約於區塊鏈網路。另外,在多個智慧合約的情況下,各智慧合約的建立及發布方式也大同小異,其差異僅在於指定的內容有所不同,例如:由買方建立及發布智慧合約需指定借出方、欲借款量及賣方;由借出方建立及發布則需將原本指定的借出方改為指定買方。另外,由借出方建立及發布的智慧合約需在其中指定賣方及欲支付量,而改由賣方建立時,則原本指定賣方需改為指定借出方。 As shown in "Figure 6", "Figure 6" is a schematic diagram of setting up a smart contract using the present invention. As mentioned earlier, the smart contract is created and published by one of the buyer-side host 110, the intermediary-side host 140, the seller-side host 130, and the lending-side host 120. The loan message includes the buyer-side host 110, the seller-side host 130, the loan-side host 130, and the lending-side host 120. Among the outgoing host 120 and the intermediary host 140, there are the addresses of the three parties that created and issued this smart contract, as well as the assets to be purchased, the amount to be paid, and the timeout time. In actual implementation, the party that wants to establish a smart contract is the buyer-side host 110. It can open the setting window 600 and enter the specified seller-side host 130 and lending-side host 120 in the input blocks (611~613). and the address of the intermediary host 140. Then, enter the asset you want to purchase, the amount payable and the overtime time in the loan consumption input block (621~623). Finally, click the confirmation component 630 to create and publish the smart contract on the blockchain network. In addition, in the case of multiple smart contracts, the creation and release methods of each smart contract are also similar. The only difference lies in the specified content. For example: the buyer needs to specify the lender to create and release the smart contract, and the borrower needs to borrow money. quantity and seller; if it is created and published by the lender, the originally designated lender needs to be changed to the designated buyer. In addition, the smart contract created and issued by the lender needs to specify the seller and the amount to be paid. If it is created by the seller, the originally designated seller needs to be changed to the designated lender.

綜上所述,可知本發明與先前技術之間的差異在於透過在區塊鏈網路提供買方端主機、借出端主機、賣方端主機及中介端主機,其中買方端主機與賣方端主機為交付關係,買方端主機與借出端主機為借貸關係,借出端主機與賣方端主機為支付關係,接著當買方端主機進行借貸消費時,使用智慧合約託管數位貨幣及通證,並且在偵測到賣方端主機交付資產給買方端主機後,再由借出端主機向賣方端主機進行支付,以及允許中介端主機仲裁交易,藉由此一技術手段可以解決先前技術所存在的問題,進而達成提高借貸用途的透明性及真實性之技術功效。 In summary, it can be seen that the difference between the present invention and the prior art is that the buyer-side host, the lending-side host, the seller-side host and the intermediary-side host are provided in the blockchain network, where the buyer-side host and the seller-side host are The delivery relationship, the buyer-side host and the lending-side host are in a lending relationship, and the lending-side host and the seller-side host are in a payment relationship. Then when the buyer-side host performs loan consumption, the smart contract is used to host the digital currency and tokens, and during the detection After detecting that the seller's host delivers assets to the buyer's host, the lending host pays the seller's host, and allows the intermediary host to arbitrate the transaction. This technical means can solve the problems existing in the previous technology, and then Achieve the technical effect of improving the transparency and authenticity of lending purposes.

雖然本發明以前述之實施例揭露如上,然其並非用以限定本發明,任何熟習相像技藝者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之專利保護範圍須視本說明書所附之申請專利範圍所界定者為準。 Although the present invention has been disclosed in the foregoing embodiments, they are not intended to limit the present invention. Anyone skilled in the similar art can make some modifications and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention is The scope of patent protection shall be determined by the scope of the patent application attached to this specification.

100:區塊鏈網路100:Blockchain network

110:買方端主機110: Buyer-side host

120:借出端主機120: Lending host

130:賣方端主機130: Seller-side host

140:中介端主機140: Intermediary host

Claims (10)

一種基於區塊鏈與智慧合約的多方借貸消費系統,應用在多個節點主機組成的一區塊鏈網路中,該系統包含:一買方端主機,作為所述節點主機其中之一,該買方端主機用以在包含一借貸訊息的一智慧合約成功發布於該區塊鏈網路之後,允許將至少一債權通證傳送至該智慧合約以進行託管,並在該智慧合約中設定一第一雜湊值,其中該第一雜湊值係由一第一解鎖密語進行雜湊計算所生成;一借出端主機,作為所述節點主機其中之一,該借出端主機在該智慧合約成功發布後,將至少一數位貨幣或至少一支付通證傳送至該智慧合約以進行託管;一賣方端主機,作為所述節點主機其中之一,該賣方端主機在該智慧合約成功發布後,將至少一資產通證傳送至該智慧合約以進行託管;以及一中介端主機,作為所述節點主機其中之一,該中介端主機用以允許直接觸發執行該智慧合約的一交付函式及一退還函式,並且在已設定該第一雜湊值的該智慧合約中設定一第二雜湊值,該第二雜湊值係由一第二解鎖密語進行雜湊計算所生成;其中,當所述資產通證以及所述數位貨幣或所述支付通證皆已託管於該智慧合約時,在一逾時時間內,允許該買方端主機將該第一解鎖密語傳送至該智慧合約的該交付函式或該中介端主機將該第二解鎖密語傳送至該智慧合約的該交付函式,該 交付函式在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將所述資產通證轉移至該買方端主機、將所述數位貨幣或所述支付通證轉移至該賣方端主機,以及在該借貸訊息中記錄為借貸已執行,或在該智慧合約存在託管的所述債權通證時,將所述債權通證轉移至該借出端主機,當該交付函式執行結束後,該買方端主機根據該借貸訊息及該借出端主機持有的所述債權通證或兩者任一計算還款數額,以便向該借出端主機進行還款。 A multi-party lending and consumption system based on blockchain and smart contracts, applied in a blockchain network composed of multiple node hosts. The system includes: a buyer-side host, as one of the node hosts, the buyer The end host is used to allow at least one debt token to be sent to the smart contract for custody after a smart contract containing a loan message is successfully published on the blockchain network, and set a first priority in the smart contract. A hash value, where the first hash value is generated by hash calculation of a first unlocking password; a lending host, as one of the node hosts, after the smart contract is successfully released, the lending host Transmit at least one digital currency or at least one payment token to the smart contract for custody; a seller-side host, as one of the node hosts, the seller-side host transfers at least one asset after the smart contract is successfully released The token is sent to the smart contract for custody; and an intermediary host, as one of the node hosts, is used to allow direct triggering of a delivery function and a return function of the smart contract, And a second hash value is set in the smart contract that has set the first hash value. The second hash value is generated by hash calculation using a second unlocking password; wherein, when the asset token and the When the digital currency or the payment token has been hosted in the smart contract, the buyer-side host is allowed to send the first unlocking password to the delivery function of the smart contract or the intermediary-side host within a timeout period. transmit the second unlocking password to the delivery function of the smart contract, the When the delivery function receives the first unlocking password matching the first hash value or the second unlocking password matching the second hash value, the delivery function transfers the asset token to the buyer's host, transfers the digital The currency or the payment token is transferred to the seller's host, and is recorded in the loan message as the loan has been executed, or when the smart contract has the debt token in custody, the debt token is transferred to the smart contract. For the lender host, after the execution of the delivery function is completed, the buyer host calculates the repayment amount based on the loan information and the debt token held by the lender host, or both, in order to provide the borrower with Outgoing host for repayment. 如請求項1之基於區塊鏈與智慧合約的多方借貸消費系統,其中該智慧合約係由該買方端主機、該借出端主機、該賣方端主機及該中介端主機其中之一進行建立及發布,該借貸訊息包含該買方端主機、該賣方端主機、該借出端主機及該中介端主機之中,並非建立及發布該智慧合約的其中三者的地址,以及一欲購買資產、一應支付量及該逾時時間。 For example, the multi-party lending and consumption system based on blockchain and smart contract of claim 1, wherein the smart contract is established by one of the buyer-side host, the lending-side host, the seller-side host and the intermediary-side host, and Published, the loan message includes the addresses of three of the buyer-side host, the seller-side host, the lending-side host and the intermediary host that are not responsible for creating and publishing the smart contract, as well as an asset to be purchased, an asset to be purchased, and an The amount payable and the overdue time. 如請求項2之基於區塊鏈與智慧合約的多方借貸消費系統,其中該交付函式未執行且在該逾時時間內,允許該買方端主機將該第一解鎖密語傳送至該智慧合約的該退還函式或允許該中介端主機將該第二解鎖密語傳送至該智慧合約的該退還函式,該退還函式在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述債權通證交還給該買方端主機、託管的所述資產通證交還給該賣方端主機、託管的所述數位貨幣或支付通證交還給該借出端主機,以及該 交付函式未執行且超過該逾時時間時,該買方端主機、該賣方端主機、該借出端主機及該中介端主機直接觸發執行該智慧合約的該退還函式,用以允許該買方端主機取回託管的所述債權通證、允許該賣方端主機取回託管的所述資產通證,以及允許該借出端主機取回託管的所述數位貨幣或所述支付通證。 For example, in the multi-party lending and consumption system based on blockchain and smart contract in request item 2, the delivery function is not executed and within the timeout period, the buyer-side host is allowed to transmit the first unlocking password to the smart contract. The refund function may allow the intermediary host to transmit the second unlocking password to the refund function of the smart contract. The refund function may receive the first unlocking password matching the first hash value or match the third unlocking password. When the second unlocking password of the hash value is reached, the debt token in custody is returned to the buyer-side host, the asset token in custody is returned to the seller-side host, the digital currency or payment token in custody is returned returned to the lending host, and the When the delivery function is not executed and the timeout period exceeds, the buyer-side host, the seller-side host, the lending-side host and the intermediary-side host directly trigger the execution of the return function of the smart contract to allow the buyer to The end host retrieves the custody of the debt token, allows the seller-end host to retrieve the custody of the asset token, and allows the lending end host to retrieve the custody of the digital currency or the payment token. 一種基於區塊鏈與智慧合約的多方借貸消費系統,應用在多個節點主機組成的一區塊鏈網路中,該系統包含:一買方端主機,作為所述節點主機其中之一,該買方端主機用以在一借貸關係智慧合約發布於該區塊鏈網路之後,允許在該借貸關係智慧合約中設定一第一雜湊值,其中該第一雜湊值係由一第一解鎖密語進行雜湊計算所生成;一借出端主機,作為所述節點主機其中之一,該借出端主機用以在一支付關係智慧合約發布於該區塊鏈網路之後,允許在該支付關係智慧合約設定該第一雜湊值,並且將至少一數位貨幣或至少一支付通證傳送至該支付關係智慧合約以進行託管;一賣方端主機,作為所述節點主機其中之一,該賣方端主機用以在一交付關係智慧合約發布於該區塊鏈網路之後,允許在該交付關係智慧合約設定該第一雜湊值,並且將至少一資產通證傳送至該交付關係智慧合約以進行託管;以及一中介端主機,作為所述節點主機其中之一,該中介端主機用以在已設定該第一雜湊值的該借貸關係智慧合約、該支付 關係智慧合約或該交付關係智慧合約中設定一第二雜湊值,該第二雜湊值係由一第二解鎖密語進行雜湊計算所生成;其中,在該買方端主機、該借出端主機及該賣方端主機之中,非最早設定該第一雜湊值的二者,將該第一雜湊值及該第二雜湊值設定在尚未設定該第一雜湊值及該第二雜湊值的該借貸關係智慧合約、該支付關係智慧合約或該交付關係智慧合約之中,在進行設定時,該借貸關係智慧合約允許託管來自該買方端主機的至少一債權通證,該交付關係智慧合約同時託管來自該賣方端主機的至少一資產通證,該支付關係智慧合約同時託管來自該借出端主機的至少一數位貨幣或至少一支付通證;其中,在確定執行交易時,由最早設定該第一雜湊值的該買方端主機、該賣方端主機或該借出端主機將該第一解鎖密語傳送至該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,或由該中介端主機傳送該第二解鎖密語至該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,使該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述資產通證、所述債權通證、所述數位貨幣或至少一支付通證傳送至該買方端主機、該借出端主機或該賣方端主機,並且公開接收到的第一解鎖密語或第二解鎖密語;以及 其中,在該買方端主機、該借出端主機及該賣方端主機之中,非最早設定該第一雜湊值的二者,在偵測到公開的該第一解鎖密語或該第二解鎖密語時,允許將偵測到的該第一解鎖密語或該第二解鎖密語傳送至未公開該第一解鎖密語或該第二解鎖密語的該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,使其在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述資產通證、所述債權通證、所述數位貨幣或所述支付通證傳送至該買方端主機、該借出端主機或該賣方端主機,以及當偵測到的該第一解鎖密語或該第二解鎖密語傳送至該借貸關係智慧合約時,允許將該借貸關係智慧合約的一借貸狀態記錄為借貸已執行。 A multi-party lending and consumption system based on blockchain and smart contracts, applied in a blockchain network composed of multiple node hosts. The system includes: a buyer-side host, as one of the node hosts, the buyer The end host is used to allow a first hash value to be set in the loan relationship smart contract after a loan relationship smart contract is published on the blockchain network, wherein the first hash value is hashed by a first unlocking password Generated by calculation; a lending host, as one of the node hosts, the lending host is used to allow a payment relationship smart contract to be set after the payment relationship smart contract is published on the blockchain network The first hash value, and transmit at least one digital currency or at least one payment token to the payment relationship smart contract for custody; a seller-side host, as one of the node hosts, the seller-side host is used to After a delivery relationship smart contract is published on the blockchain network, it allows the first hash value to be set in the delivery relationship smart contract and transmits at least one asset token to the delivery relationship smart contract for custody; and an intermediary The end host, as one of the node hosts, the intermediary end host is used to set the first hash value in the loan relationship smart contract, the payment A second hash value is set in the relationship smart contract or the delivery relationship smart contract, and the second hash value is generated by a hash calculation using a second unlocking password; wherein, the buyer-side host, the lending-side host and the Among the seller's hosts, the two that are not the first to set the first hash value set the first hash value and the second hash value in the loan relationship intelligence where the first hash value and the second hash value have not been set. In the contract, the payment relationship smart contract or the delivery relationship smart contract, when setting up, the lending relationship smart contract allows hosting of at least one debt token from the buyer's host, and the delivery relationship smart contract also hosts the debt from the seller. At least one asset token from the end host, and the payment relationship smart contract also hosts at least one digital currency or at least one payment token from the lending end host; wherein, when determining to execute the transaction, the earliest hash value is set The buyer-side host, the seller-side host or the lending-side host sends the first unlocking password to the delivery relationship smart contract, the lending relationship smart contract or the payment relationship smart contract, or the intermediary-side host sends the first unlocking password to the delivery relationship smart contract, the lending relationship smart contract or the payment relationship smart contract. The second unlocking password is sent to the delivery relationship smart contract, the loan relationship smart contract or the payment relationship smart contract, so that the delivery relationship smart contract, the loan relationship smart contract or the payment relationship smart contract receives a matching first hash value. When the first unlocking password or the second unlocking password matching the second hash value, the escrowd asset token, the debt token, the digital currency or at least one payment token is transmitted to the buyer The end host, the lending end host, or the seller end host, and discloses the received first unlocking password or the second unlocking password; and Among the buyer-side host, the lending-side host and the seller-side host, the two that are not the first to set the first hash value will detect the first unlocking password or the second unlocking password that is disclosed. when the detected first unlocking password or the second unlocking password is allowed to be transmitted to the delivery relationship smart contract, the lending relationship smart contract or the payment relationship that does not disclose the first unlocking password or the second unlocking password The smart contract allows it to transfer the custody of the asset token, the debt token, The digital currency or the payment token is sent to the buyer-side host, the lender-side host or the seller-side host, and when the first unlocking password or the second unlocking password is detected, it is sent to the lending relationship When using a smart contract, a loan status of the loan relationship smart contract is allowed to be recorded as the loan has been executed. 如請求項4之基於區塊鏈與智慧合約的多方借貸消費系統,其中該借貸關係智慧合約、該支付關係智慧合約及該交付關係智慧合約更包含一逾時時間,當未在該逾時時間內接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,允許該賣方端主機取回託管的所述資產通證、允許買方端主機取回託管的所述債權通證,以及允許該借出端主機取回託管的所述數位貨幣或所述支付通證。 For example, the multi-party lending and consumption system based on blockchain and smart contracts in request item 4, wherein the lending relationship smart contract, the payment relationship smart contract and the delivery relationship smart contract further include a timeout time. If the timeout time is not reached, When the first unlocking password matching the first hash value or the second unlocking password matching the second hash value is received, the seller-side host is allowed to retrieve the managed asset token, and the buyer-side host is allowed to retrieve the asset token. Return the debt token in custody, and allow the lending host to retrieve the digital currency or payment token in custody. 一種基於區塊鏈與智慧合約的多方借貸消費方法,應用在由多個節點主機組成的一區塊鏈網路,其步驟包括: 提供分別作為所述節點主機其中之一的一買方端主機、一借出端主機、一賣方端主機及一中介端主機,其中,該中介端主機允許直接觸發執行該智慧合約的一交付函式及一退還函式;在包含一借貸訊息的一智慧合約成功發布於該區塊鏈網路之後,允許該買方端主機將至少一債權通證傳送至該智慧合約以進行託管,並且在該智慧合約中設定一第一雜湊值,其中該第一雜湊值係由一第一解鎖密語進行雜湊計算所生成、該中介端在已設定該第一雜湊值的該智慧合約中設定一第二雜湊值,該第二雜湊值係由一第二解鎖密語進行雜湊計算所生成、該賣方端主機將至少一資產通證傳送至已設定該第二雜湊值的該智慧合約以進行託管,以及該借出端主機將至少一數位貨幣或至少一支付通證傳送至已設定該第二雜湊值的該智慧合約以進行託管;當所述資產通證以及所述數位貨幣或所述支付通證皆已託管於該智慧合約時,在一逾時時間內,允許該買方端主機將該第一解鎖密語傳送至該智慧合約的該交付函式或該中介端主機將該第二解鎖密語傳送至該智慧合約的該交付函式,該交付函式在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將所述資產通證轉移至該買方端主機、將所述數位貨幣或所述支付通證轉移至該賣方端主機,以及在該借貸訊息中記錄為借貸已執行,或在該智慧合約存在 託管的所述債權通證時,將所述債權通證轉移至該借出端主機;以及在該交付函式執行結束後,該買方端主機根據該借貸訊息及該借出端主機持有的所述債權通證或兩者任一計算還款數額,以便向該借出端主機進行還款。 A multi-party lending and consumption method based on blockchain and smart contracts is applied to a blockchain network composed of multiple node hosts. The steps include: Provide a buyer-end host, a lending-end host, a seller-end host and an intermediary-end host respectively as one of the node hosts, wherein the intermediary-end host allows to directly trigger the execution of a delivery function of the smart contract and a return function; after a smart contract containing a loan message is successfully published on the blockchain network, the buyer-side host is allowed to transmit at least one debt token to the smart contract for custody, and in the smart contract A first hash value is set in the contract, where the first hash value is generated by a hash calculation of a first unlocking password, and the intermediary sets a second hash value in the smart contract that has set the first hash value. , the second hash value is generated by hash calculation of a second unlocking password, the seller-side host transmits at least one asset token to the smart contract that has set the second hash value for custody, and the lending The end host transmits at least one digital currency or at least one payment token to the smart contract that has set the second hash value for custody; when the asset token and the digital currency or the payment token have all been custody During the smart contract, within a timeout period, the buyer-side host is allowed to send the first unlocking secret word to the delivery function of the smart contract or the intermediary-side host is allowed to send the second unlocking secret word to the smart contract The delivery function, which transfers the asset token to the buyer when receiving the first unlocking password matching the first hash value or the second unlocking password matching the second hash value The end host, transfers the digital currency or the payment token to the seller end host, and records in the loan message that the loan has been executed, or in the existence of the smart contract When the debt token is in custody, the debt token is transferred to the lending host; and after the execution of the delivery function is completed, the buyer host holds the loan information based on the lending information and the lending host. The debt token or either of the two calculates the repayment amount in order to repay the loan host. 如請求項6之基於區塊鏈與智慧合約的多方借貸消費方法,其中該借貸訊息包含該買方端主機、該賣方端主機、該借出端主機及該中介端主機之中,並非建立及發布該智慧合約的其中三者的地址,以及一欲購買資產、一應支付量及該逾時時間。 For example, the multi-party lending and consumption method based on blockchain and smart contracts in request item 6, in which the lending information includes the buyer-side host, the seller-side host, the lending-side host and the intermediary-side host, is not created and published. The addresses of three of the smart contracts, as well as the asset to be purchased, the amount to be paid, and the timeout. 如請求項7之基於區塊鏈與智慧合約的多方借貸消費方法,其中該方法更包含下列步驟:該交付函式未執行且在該逾時時間內,允許該買方端主機將該第一解鎖密語傳送至該智慧合約的該退還函式或允許該中介端主機將該第二解鎖密語傳送至該智慧合約的該退還函式,該退還函式在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述債權通證交還給該買方端主機、託管的所述資產通證交還給該賣方端主機、託管的所述數位貨幣或支付通證交還給該借出端主機;以及當超過該逾時時間未執行該交付函式時,由該智慧合約觸發執行該退還函式,或由該買方端主機、該中介端主機、該賣方端主機或該借出端主機直接觸發執行該退還函式,用以允許 該買方端主機取回託管的所述債權通證、允許該賣方端主機取回託管的所述資產通證,以及允許該借出端主機取回託管的所述數位貨幣或所述支付通證。 For example, the multi-party loan consumption method based on blockchain and smart contract in request item 7, wherein the method further includes the following steps: the delivery function is not executed and within the timeout period, the buyer-side host is allowed to unlock the first The secret word is sent to the refund function of the smart contract or the intermediary host is allowed to send the second unlocking password to the refund function of the smart contract. The refund function receives the third hash value matching the first hash value. When the unlocking password or the second unlocking password matches the second hash value, the debt token in custody is returned to the buyer-side host, and the asset token in custody is returned to the seller-side host, and all the custody tokens are returned. The digital currency or payment token is returned to the lending host; and when the delivery function is not executed after the timeout period, the smart contract triggers the execution of the return function, or the buyer host or the intermediary The end host, the seller end host or the lending end host directly triggers the execution of the return function to allow The buyer-side host retrieves the custody of the debt token, allows the seller-side host to retrieve the custody of the asset token, and allows the lending-side host to retrieve the custody of the digital currency or the payment token . 一種基於區塊鏈與智慧合約的多方借貸消費方法,應用在由多個節點主機組成的一區塊鏈網路,其步驟包括:提供一買方端主機、一借出端主機、一賣方端主機及一中介端主機以分別作為所述節點主機其中之一;該買方端主機或該賣方端主機在該區塊鏈網路發布一交付關係智慧合約,該買方端主機或該借出端主機在該區塊鏈網路發布一借貸關係智慧合約,該借出端主機或該賣方端主機在該區塊鏈網路發布一支付關係智慧合約;在該交付關係智慧合約、該借貸關係智慧合約及該支付關係智慧合約皆成功發布後,由該買方端主機在該借貸關係智慧合約中設定一第一雜湊值,或由該借出端主機在該支付關係智慧合約中設定該第一雜湊值,或由該賣方端主機在該交付關係智慧合約中設定該第一雜湊值,其中該第一雜湊值係由一第一解鎖密語進行雜湊計算所生成;該中介端主機在已設定該第一雜湊值的該借貸關係智慧合約、該支付關係智慧合約或該交付關係智慧合約中設定一第二雜湊值,該第二雜湊值係由一第二解鎖密語進行雜湊計算所生成; 在該買方端主機、該借出端主機及該賣方端主機之中,非最早設定該第一雜湊值的二者,將該第一雜湊值及該第二雜湊值設定在尚未設定該第一雜湊值及該第二雜湊值的該借貸關係智慧合約、該支付關係智慧合約或該交付關係智慧合約之中,其中,在進行設定時,該借貸關係智慧合約允許託管來自該買方端主機的至少一債權通證,該交付關係智慧合約同時託管來自該賣方端主機的至少一資產通證,該支付關係智慧合約同時託管來自該借出端主機的至少一數位貨幣或至少一支付通證;在確定執行交易時,由最早設定該第一雜湊值的該買方端主機、該借出端主機或該賣方端主機將該第一解鎖密語傳送至該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,或由該中介端主機傳送該第二解鎖密語至該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,使該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述資產通證、所述債權通證、所述數位貨幣或至少一支付通證傳送至該買方端主機、該借出端主機或該賣方端主機,並且公開接收到的該第一解鎖密語或該第二解鎖密語;以及在該買方端主機、該借出端主機及該賣方端主機之中,非最早設定該第一雜湊值的二者,在偵測到公開的該第一解鎖密語或該第二解鎖密語時,允許將偵測到的該第一解鎖密語或該 第二解鎖密語傳送至未公開該第一解鎖密語或該第二解鎖密語的該交付關係智慧合約、該借貸關係智慧合約或該支付關係智慧合約,使其在接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,將託管的所述資產通證、所述債權通證、所述數位貨幣或所述支付通證傳送至該買方端主機、該借出端主機或該賣方端主機,以及當偵測到的該第一解鎖密語或該第二解鎖密語傳送至該借貸關係智慧合約時,允許將該借貸關係智慧合約的一借貸狀態記錄為借貸已執行。 A multi-party lending and consumption method based on blockchain and smart contracts is applied to a blockchain network composed of multiple node hosts. The steps include: providing a buyer-side host, a lending-side host, and a seller-side host. and an intermediary host respectively serving as one of the node hosts; the buyer-side host or the seller-side host publishes a delivery relationship smart contract on the blockchain network, and the buyer-side host or the lending-side host publishes a delivery relationship smart contract on the blockchain network. The blockchain network publishes a loan relationship smart contract, and the lender host or the seller host publishes a payment relationship smart contract on the blockchain network; in the delivery relationship smart contract, the loan relationship smart contract and After the payment relationship smart contract is successfully released, the buyer's host sets a first hash value in the loan relationship smart contract, or the lender's host sets the first hash value in the payment relationship smart contract, Or the seller-side host sets the first hash value in the delivery relationship smart contract, where the first hash value is generated by hash calculation using a first unlocking password; the intermediary-end host sets the first hash value after setting the first hash value A second hash value is set in the lending relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract, and the second hash value is generated by hash calculation using a second unlocking secret word; Among the buyer-side host, the lending-side host and the seller-side host, the two that are not the first to set the first hash value set the first hash value and the second hash value before the first hash value is set. The hash value and the second hash value are in the lending relationship smart contract, the payment relationship smart contract or the delivery relationship smart contract, wherein, when setting, the lending relationship smart contract allows hosting of at least A debt token, the delivery relationship smart contract also hosts at least one asset token from the seller's host, and the payment relationship smart contract also hosts at least one digital currency or at least one payment token from the lender's host; in When it is determined to execute the transaction, the buyer-side host, the lending-side host or the seller-side host that sets the first hash value at the earliest will send the first unlocking password to the delivery relationship smart contract, the lending relationship smart contract or the The payment relationship smart contract, or the intermediary host sends the second unlocking password to the delivery relationship smart contract, the loan relationship smart contract or the payment relationship smart contract, so that the delivery relationship smart contract, the loan relationship smart contract or the payment relationship smart contract When the payment relationship smart contract receives the first unlocking password that matches the first hash value or the second unlocking password that matches the second hash value, it will store the asset token, the debt token, and all the assets in custody. The digital currency or at least one payment token is transmitted to the buyer-side host, the lending-side host or the seller-side host, and the first unlocking password or the second unlocking password received is disclosed; and on the buyer-side host . Among the lending-side host and the seller-side host, the one that is not the first to set the first hash value is allowed to detect the first unlocking password or the second unlocking password that is disclosed. The first unlocking secret word or the The second unlocking secret word is sent to the delivery relationship smart contract, the lending relationship smart contract or the payment relationship smart contract that does not disclose the first unlocking secret word or the second unlocking secret word, so that when it receives the first hash value matching the When the first unlocking password or the second unlocking password matches the second hash value, the escrowd asset token, the debt token, the digital currency or the payment token is transmitted to the buyer. The host, the lending host or the seller host, and when the detected first unlocking password or the second unlocking password is transmitted to the lending relationship smart contract, a loan status of the lending relationship smart contract is allowed to be changed The loan is recorded as executed. 如請求項9之基於區塊鏈與智慧合約的多方借貸消費方法,其中該方法更包含在該借貸關係智慧合約、該支付關係智慧合約及該交付關係智慧合約中分別設定一逾時時間,當未在該逾時時間內接收到匹配該第一雜湊值的該第一解鎖密語或匹配該第二雜湊值的該第二解鎖密語時,允許該賣方端主機取回託管的所述資產通證、允許買方端主機取回託管的所述債權通證,以及允許該借出端主機取回託管的所述數位貨幣或所述支付通證的步驟。For example, the multi-party lending and consumption method based on blockchain and smart contract in request item 9, wherein the method further includes setting a timeout time in the lending relationship smart contract, the payment relationship smart contract and the delivery relationship smart contract, when When the first unlocking password matching the first hash value or the second unlocking password matching the second hash value is not received within the timeout period, the seller-side host is allowed to retrieve the managed asset token. , allowing the buyer-side host to retrieve the custody of the debt token, and allowing the lending-side host to retrieve the custody of the digital currency or the payment token.
TW109112740A 2020-04-16 2020-04-16 Multi-party loan consumption system based on blockchain and smart contract and method thereof TWI818171B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109112740A TWI818171B (en) 2020-04-16 2020-04-16 Multi-party loan consumption system based on blockchain and smart contract and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109112740A TWI818171B (en) 2020-04-16 2020-04-16 Multi-party loan consumption system based on blockchain and smart contract and method thereof

Publications (2)

Publication Number Publication Date
TW202141396A TW202141396A (en) 2021-11-01
TWI818171B true TWI818171B (en) 2023-10-11

Family

ID=80783207

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109112740A TWI818171B (en) 2020-04-16 2020-04-16 Multi-party loan consumption system based on blockchain and smart contract and method thereof

Country Status (1)

Country Link
TW (1) TWI818171B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025602A (en) * 2017-02-24 2017-08-08 杭州象链网络技术有限公司 A kind of financial asset transaction system construction method based on alliance's chain
TWI629658B (en) * 2017-05-08 2018-07-11 富邦金融控股股份有限公司 Know your customer (kyc) data sharing system based on smart contract on blockchain and method thereof
CN108648056A (en) * 2018-05-10 2018-10-12 中链科技有限公司 A kind of house lease contract processing method and system based on block chain
US20190215159A1 (en) * 2018-01-10 2019-07-11 Tmail Inc. System and computer program product for certified confidential data collaboration using blockchains
CN110223172A (en) * 2019-05-20 2019-09-10 阿里巴巴集团控股有限公司 The receipt storage method and node of conditional combination code mark and type dimension
CN110992007A (en) * 2019-11-22 2020-04-10 肖光昱 Asset digital voucher payment clearing method, device and medium based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025602A (en) * 2017-02-24 2017-08-08 杭州象链网络技术有限公司 A kind of financial asset transaction system construction method based on alliance's chain
TWI629658B (en) * 2017-05-08 2018-07-11 富邦金融控股股份有限公司 Know your customer (kyc) data sharing system based on smart contract on blockchain and method thereof
US20190215159A1 (en) * 2018-01-10 2019-07-11 Tmail Inc. System and computer program product for certified confidential data collaboration using blockchains
CN108648056A (en) * 2018-05-10 2018-10-12 中链科技有限公司 A kind of house lease contract processing method and system based on block chain
CN110223172A (en) * 2019-05-20 2019-09-10 阿里巴巴集团控股有限公司 The receipt storage method and node of conditional combination code mark and type dimension
CN110992007A (en) * 2019-11-22 2020-04-10 肖光昱 Asset digital voucher payment clearing method, device and medium based on block chain

Also Published As

Publication number Publication date
TW202141396A (en) 2021-11-01

Similar Documents

Publication Publication Date Title
TWI726468B (en) Asset rights management system based on blockchain and method thereof
US20200258159A1 (en) System and method of providing a contract-creator application
US11961141B2 (en) Global liquidity and settlement system
JP7112690B2 (en) Digital Wealth Management for Decentralized Transaction Consensus Network
KR20180101355A (en) Systems and methods for improving security in exchanges of block-chain assets
TWI772654B (en) Escrowing system for cross-blockchain third-party settlement and method thereof
TWI646487B (en) Smart contract executing system with permission rating and avoid duplication and method thereof
TWM566363U (en) Intermediary system for lending consumption based on blockchain
TWI716236B (en) Electronic receipt/invoice confirming and escrow system based on blockchain and method thereof
TWI818171B (en) Multi-party loan consumption system based on blockchain and smart contract and method thereof
TWM593602U (en) Cross-chain and non-custodial entity performance guarantee transaction system
US20230098169A1 (en) System and method for providing patent title insurance with centralized and distributed data architectures
CN113449340B (en) Stock house transaction fund supervision method and device based on alliance chain
US20220147993A1 (en) Secure peer-to-peer transctions using a blockchain network
US20220084128A1 (en) System and method for providing patent title insurance with centralized and distributed data architectures
JPWO2019246565A5 (en)
TWI702555B (en) Dividend distribution system based on security token and method thereof
TWI682347B (en) Crowdfunding system based on security token and method thereof
TWI794444B (en) Offering and trading system for security token and method thereof
TW202125368A (en) Shares transfer system based on security token and method thereof
TWI832119B (en) Creating and trading system for tokenized open-end funds and method thereof
TWI664596B (en) Intermediary system for lending consumption based on blockchain and method thereof
CN116882992A (en) Business transaction method and system based on WebRTC and related products
CN114298841A (en) Investment and financing match transaction technical scheme based on block chain
KR20210033688A (en) P2p foreign exchange direct dealing intermediation device using blockchain technology