解析 |《Wisdom Chain文檔知識庫》之條件支付

2021-01-20 WisdomChain中文站
Conditional payment of Wisdom Chain document knowledge baseThis article comes from the official Twitter of Wisdom Chainhttps://twitter.com/Wisdom_Chain/status/1298458216725176328?s=20

If we want to make a transaction now, I want to sell my data to you. what is the safest way of transaction?



Obviously, there are two problems:


Because what I sell is the data, certainly cannot give you directly, otherwise how can I do if you get the data and then directly run away?

But I certainly can't take your money first, because the data I gave you may not meet your requirements, or I took the money and ran away.


To solve the above problem, we need a perfect and accurate "one hand pay, one hand delivery" solution. Zero knowledge proof and blockchain can be used at this time.


Today we try to explain this interesting solution in the language that ordinary people can understand: the conditional payment of Wisdom Chain.


What does this concept mean?


To put it simply, it is to reach a perfect and fair "one hand pay, one hand delivery" scheme without trusting a third party.


Imagine a transaction scenario in which neither party is willing to make payment / delivery to the other party without the presence of a trusted third party, otherwise the other party will run away. One hand payment and one hand delivery means that the payment / delivery action must be atomic.


The so-called perfect fairness means that neither side can take more advantage. However, this concept is an old topic. As early as the 1980s, many scholars have been studying how to achieve a perfect fair trade. But for a long time, it has been agreed that a trusted third party is essential. Later, when Bitcoin was born, we found that it could be done by using the characteristics of blockchain.


How is conditional payment realized in Wisdom Chain?


According to official disclosure, conditional payment in Wisdom Chain is mainly composed of "hash time locking", "hash height locking" and other factors. Here, only hash time locking and hash height locking are discussed.


What is hash time locking?


Hash lock, full name of hash time lock contract, is a new technology implementation form proposed in lightning network.


Hash lock mode is a mechanism that users guess the original value of hash value to pay in a specified period of time. In short, on the basis of the smart contract, both parties lock the assets first. If both parties input the original value of the correct hash value in a limited time, the transaction can be completed.


In this mechanism, we can realize the rapid confirmation of micro payment, that is to say, to achieve the goal of rapid confirmation of lightning network. Next, the author will take the asset exchange of the application scenario of hash locking as an example to explain how hash locking is realized.


How to implement hash time locking? In order to facilitate the understanding of how hash time locking is locked, here we compare two locks, one is hash lock and the other is time lock.

 

1. Hash lock


Through hash value locking, after locking, only the original value of the hash value is used to unlock. Assuming that the number is 123, the value after hash is a03a. Through a03a locking, without considering hash collision, it can only be unlocked by 123.


2. Time lock


The time lock requires the password for the hash lock to be entered within a specified time. If the time of the time lock is 1 hour, the user is required to enter the password of the hash lock within 1 hour. If the password of the hash lock is input after 1 hour, the time lock will not be opened.


In other words, the condition for opening the two locks at the same time is to input the original value of the hash value within the specified time. In the above example, if "123" is input within one hour, both locks will be in the open state.


Now A will use hash time locking mechanism to exchange its WDC in B for Ethernet currency. The specific steps are as follows:


A first generates random number S, and then give hash value H (S) of random number to B through the network, assuming that the random number is 123, and the hash value is a03a.


At the same time, A locks time and locks Hash, assuming that the time lock time is 1 hour, and the Hash value of Hash lock is a03a. After locking, the WDC to be converted is locked on chain 1.



After B receives the hash value "a03a" given by A, B deploys the smart contract on the Ethernet site based on this hash value and stores the same value of ETH in the contract. B's smart contract requires A to provide the password "123" within the specified time to take away the ETH in the smart contract.


This process is equivalent to that B itself has two locks. The hash lock is the same as the hash lock of A. it needs the same password to open it. If the time lock is half an hour.

 


A uses the smart contract of B, and enters its own password "123" within half an hour, then it can open B's hash lock on chain B, and take away the ETH in B smart contract (equivalent to B's ETH, because the smart contract is created by B, and the ETH in the contract is also transferred by B).

Because A entered the password when calling the smart contract of B, so B also knew that the password was "123". As long as he opened the hash lock on the chain A in one hour, the WDC of A would be transferred to B.



Through the above process, we can see that A can realize the exchange from WDC to ETH through hash time locking.


Through the above description, we understand the hash time locking, and the following hash height locking will be very simple to understand, and the principle is roughly the same as hash time locking. So let's briefly describe hash height locking.


Hash height lock


A and B can reach an agreement to lock A's 10WDC. Before the arrival of time T (T is expressed in terms of a block chain height in the future), if B can show a suitable R to A so that the hash value of R is equal to the predetermined value H®, B can obtain the 10WDC; if B still fails to provide A correct R until time T has passed, the WDC will automatically unfreeze and return it to A. This process produces random numbers and verifies them.


When you understand hash time lock and hash height lock, you understand the technical principle of conditional payment for WisdomChain.

相關焦點

  • 深度|《Wisdom Chain文檔知識庫》之多重籤名
    Use of aggregatesignatureIn the privacy protection of wisdomchain's latest white paper, we see the use of aggregate signatures.
  • 關鍵|《Wisdom Chain文檔知識庫》之Schnorr籤名算法
    關注Wisdom Chain動態Twitter:@Wisdom_Chain微博:WisdomChain知乎:智慧鏈技術社區Facebook:WisdomChainTelegram:@WisdomPublicChain相關資源WIsdom Chain公鏈文檔知識庫:https://docs.wisdchain.com/#/Wisdom Chain
  • 為什麼選擇在Wisdom Chain上發token
    , address indexed spender, uint tokens);}上述代碼包含了ERC-20中的兩大事件與五大功能:兩大事件:①Transfer事件:該事件負責放出合約代幣從一個地址轉向另一個地址的支付細節
  • OKChain的黑客松作品,Token進行支付的跨境電商支付SDK
    通過Ankr這個平臺每個企業和個人都能容易、便捷、快速地部署OKChain區塊鏈節點,無需進行開發工作,只需要簡單的幾步操作:創建節點名稱,進行基礎設置,支付伺服器費用。 然後節點就自動進行部署和同步了,同步完成後對應的節點API就會自動生成,此時複製API到URL就可以打開查詢節點狀態和信息了。
  • StepChain 0.0.7 發布,Java 通用業務處理框架
    gitee: https://gitee.com/zengfr/stepchaingithub: https://github.com/zengfr/stepchain-spring-boot-starter/Repositories Central Sonatype MvnrepositoryFeature:1、支持通用業務job、services
  • QuarkChain新版主網「BigBang」啟動 多原生代幣功能開放使用
    多原生代幣功能介紹 ◆QuarkChain多原生代幣價值◆ 在QuarkChain主網中,多原生代幣(Multinative token) 在QuarkChain系統中和 QKC 基本是一樣的地位,可以調用合約、跨鏈、在滿足某些情況的條件下可以支付交易手續費
  • Python自動化辦公之Word,全網最全看這一篇就夠了
    很多已經做案例的人,卻不知道如何去學習更加高深的知識。 那麼針對這三類人,我給大家提供一個好的學習平臺,免費領取視頻教程,電子書籍,以及課程的原始碼!??¤ 升級pip(便於安裝最新庫) 使用方法: 使用方法: 使用方法: 使用方法: 效果如下: 示例代碼 0.1 Python-docx新建文檔.py:
  • 以VON CHAIN為例,技術小白怎麼看懂黑貓Github開原始碼庫?
    其實啊,要判斷一個項目是不是真的有技術實力並沒有大家想像中那麼難,你只要在它們公開的Github開原始碼庫中查看幾個數據,項目大概的開發水平也心裡有數了。案例:雖然VON CHAIN是2020年年底才正式上線,但我們從黑貓GITHUB開原始碼庫中可以發現,VON從2019年已經開始上傳、更新代碼,而且代碼一直以來更新都非常頻繁,從開源的代碼庫中可以看到技術團隊一直堅持更新,幾乎每日都有上傳新的開發文檔。
  • 入門Python爬蟲——解析數據篇
    一般情況下,網頁頭部分會定義HTML文檔的編碼以及網頁的標題。而網頁體部分則決定著一個網頁中的正文內容。在一個HTML文檔內,我們可以看到許多被<>括住的內容,它們被稱作一個標籤。標籤通常是成對出現的。
  • GitHub中文幫助文檔上線:統一術語翻譯,Fork成「分叉」
    聲明:本文來自於微信公眾號新智元(ID:AI_era),作者:新智元,授權站長之家轉載發布GitHub剛剛推出了官方中文幫助文檔,這是繼日文幫助文檔之後,第二個非英語語種的幫助文檔。GitHub希望藉此來幫助中文開發者更好的理解GitHub操作規範,降低學習門檻。
  • Linux之父帶1.2億程式設計師如何深度剖析Git底層原理文檔
    前言相信每一個開發人員,從開始工作實習就和一個開源項目不離不棄,你的idea,你的文檔,你的代碼指南,幾乎都會和它扯上相應的聯繫,相信有朋友已經猜到了,對,他就是Git,老牌程式設計師可能會用的是SVN,但是我想後面也已經轉型而來,改為Git了吧之前寫過一篇文章,影響世界的開源項目,除了Linux之外,還有一個就是Git,有興趣的大家可以看一下:讓世界為之讚嘆的開源項目
  • 誇人聰明,要用intelligence還是wisdom?
    新東方網>英語>英語學習>語法詞彙>詞彙指導>正文誇人聰明,要用intelligence還是wisdom?任何人都可以透過學習來獲得相等的知識量,並達到同一個智力水平,但並不是全部人,都懂得利用自身的Intelligence來創造更高層次的「新知識」,或是開發學習上的新領域,這份無可估量的智慧力量,就是Wisdom。   所以,擁有高Intelligence值的學霸,不一定擁有高Wisdom值; 而擁有無限潛能Wisdom值的天才兒童,卻不一定擁有高Intelligence值。
  • 財政部通知中央預算單位明年深化國庫集中支付改革
    2011年是「十二五」改革發展各項規劃的開局之年,各部門要繼續大力推進和深化財政國庫各項改革,加強預算執行管理,提高財政財務管理的科學化精細化水平。全面深化國庫集中支付改革,進一步擴大改革級次和範圍,實現所有中央預算單位和所有一般預算、政府性基金和國有資本經營預算資金實行國庫集中支付;健全和完善國庫單一帳戶體系,逐步將中央預算單位實有資金銀行帳戶納入國庫單一帳戶體系並實施動態管理;深化公務卡改革,將改革推進到所有三級和具備條件的三級以下預算單位,擴大結算範圍,切實減少公務支出的現金使用;加強用款計劃管理,不斷提高用款計劃的科學性和準確性;推進財政授權支付網上銀行試點工作
  • 知識管理工具選石墨、語雀還是Baklib呢?
    企業知識庫因使用對象的不同大致有以下兩種作用:企業內部企業知識庫使信息和知識結構化,有利於知識的存儲和使用!知識庫幫助企業間信息系統進行有效對接和協作,提高員工工作用效率。知識庫可以幫助企業實現對客戶知識的有效管理。減小客服壓力,同時節約了員工的培訓成本。
  • PyTorch實現,GitHub4000星:微軟開源的CV庫
    機器之心報導編輯:魔王、陳萍本文介紹了微軟開源的計算機視覺庫,它囊括了計算機視覺領域的最佳實踐、代碼示例和豐富文檔。近年來,計算機視覺領域突飛猛進,在人臉識別、圖像理解、搜索、無人機、地圖、半自動和自動駕駛方面得到廣泛應用。而這些應用的核心部分是視覺識別任務,如圖像分類、目標檢測和圖像相似度。
  • 深度Deepin 社區 DTK 文檔正式上線
    IT之家12月19日消息 深度作業系統近期宣布,Deepin 社區 DTK 文檔上線,歡迎大家共同參與建設。網站地址:https://docs.deepin.org/
  • 十天幹在十二長生中之墓庫詳論
    文/子漁在十二生旺庫中,辰戌醜未為四墓庫,既是墓和庫之合論,也是方位之餘氣,比如:甲祿在寅,旺在卯,餘氣在辰,故而也成辰戌醜未為「四老」——氣之老矣。墓庫,也是「實物」存放之所。財官在庫,透幹則可解析為實業家、企業界等職業,兼論為有條理、有規則的管理制度。有寬廣的氣度和容量,可進可退,能適應各種不同的生態。對細節有具體的認知,重理性,不會久戀任何事情,懂得功成身退的理念,有現實人生觀,但子女緣薄。藏在墓庫之財官不透,則帶有閉塞,不易接納外界意見之傾向。
  • QuarkChain Game of DeFi - 原生代幣競拍流程
    打開競拍網頁:https://quarkchain.io/native-token-devnet/#/,此時網頁右上角會顯示您的QKC地址。確認您需要為競標支付的QKC數量,點擊「確定」發起競標。接下來,您可以到QuarkChain的測試網:https://devnet.quarkchain.io/contract,點擊右邊「Tokens」的下拉框,查看您鑄的原生代幣已誕生(請注意,QuarkChain默認所有新鑄的原生代幣都在分片0上)。如圖所示:自此,恭喜您,屬於您的原生代幣已成功鑄造,並已可以交易!
  • 電子元器件知識大全:PowerPCB元件庫基礎
    雖然PowerPCB與PowerLogic是兩個不同的系統,都有各自獨立的 Library,對庫操作時用戶需要在各自的系統下進行,但是兩個系統的庫之間又是密切關聯的。本章主要學習PowerPCB元件庫的基本知識,但是同時也會介紹與邏輯封裝庫CAE之間的關係。