《區(qū)塊鏈技術(shù)應(yīng)用》課件-1-區(qū)塊鏈技術(shù)基礎(chǔ)-Fundamentals of Blockchain Technology_第1頁
《區(qū)塊鏈技術(shù)應(yīng)用》課件-1-區(qū)塊鏈技術(shù)基礎(chǔ)-Fundamentals of Blockchain Technology_第2頁
《區(qū)塊鏈技術(shù)應(yīng)用》課件-1-區(qū)塊鏈技術(shù)基礎(chǔ)-Fundamentals of Blockchain Technology_第3頁
《區(qū)塊鏈技術(shù)應(yīng)用》課件-1-區(qū)塊鏈技術(shù)基礎(chǔ)-Fundamentals of Blockchain Technology_第4頁
《區(qū)塊鏈技術(shù)應(yīng)用》課件-1-區(qū)塊鏈技術(shù)基礎(chǔ)-Fundamentals of Blockchain Technology_第5頁
已閱讀5頁,還剩30頁未讀, 繼續(xù)免費(fèi)閱讀

付費(fèi)下載

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

《ApplicationofBlockchainTechnolog》Microcoursename:BlockchainFundamentalsMainlecturer:GuoLina區(qū)塊鏈技術(shù)應(yīng)用微課程名稱:區(qū)塊鏈基礎(chǔ)主講人:郭立娜21、Whatisblockchain1、

什么是區(qū)塊鏈TheconceptofblockchainBlockchainistheresultoftheintegrationofmultipletechnologies,makingdecentralizedtrustarealitythroughnewdatastructures,distributedconsensusmechanisms,hashencryptionalgorithms,anduniqueoperatingmechanisms.Blockchainisadistributeddatabasethatisalmostimpossibletobechanged,anddistributionisnotonlyreflectedinthedistributedstorageofdata,butalsointhedistributedrecordingofdata.defineDataperspectiveBusinessperspectiveSimplyput,blockchainisadecentralizeddistributedledgertechnology.Itstoresdataonmultiplenodesthroughencryptiontechnology,ensuringthesecurityandimmutabilityofthedata.區(qū)塊鏈概念什么是區(qū)塊鏈?區(qū)塊鏈?zhǔn)嵌喾N技術(shù)的整合的結(jié)果,通過新的數(shù)據(jù)結(jié)構(gòu)、分布式共識機(jī)制、哈希加密算法以及獨(dú)特的運(yùn)行機(jī)制,使得去中心化的信任構(gòu)想成為現(xiàn)實(shí)。區(qū)塊鏈?zhǔn)且环N幾乎不可能被更改的分布式數(shù)據(jù)庫,分布式不僅體現(xiàn)在對數(shù)據(jù)的分布式存儲,也體現(xiàn)在對數(shù)據(jù)的分布式記錄定義數(shù)據(jù)角度業(yè)務(wù)角度區(qū)塊鏈?zhǔn)且粋€分布式賬本,一種通過去中心化,去信任的方式集體維護(hù)一個可靠數(shù)據(jù)庫的技術(shù)方案2、Characteristicsofblockchain2、

區(qū)塊鏈的特點(diǎn)TheconceptofblockchainNontampering:Thesubmitteddatawillalwaysexistandcannotbedestroyedormodified.Theinformationrecordedontheblockchaincanbeaccuratelytraced.Transparency:Theoperatingrulesanddatainformationaretransparent,andnodesdonotneedtoprovetheiridentityandtrusteachother.Blockchainisadistributeddatastoragestructurethatdoesnothaveacentralnode,andallnodesstoreallthesameblockinformation.Decentralization:Threemajorcharacteristicsofblockchain

Howdoesblockchainachieveseveralmajorfeatures?區(qū)塊鏈概念不可篡改:提交后的數(shù)據(jù)會一直存在,不可被銷毀或修改。區(qū)塊鏈上記錄的信息可以準(zhǔn)確地追溯。透明性:運(yùn)行規(guī)則和數(shù)據(jù)信息都是透明的,節(jié)點(diǎn)間無需證明身份,相互信任。區(qū)塊鏈?zhǔn)且环N分布式數(shù)據(jù)存儲結(jié)構(gòu),沒有中心節(jié)點(diǎn),所有節(jié)點(diǎn)都保存全部的相同區(qū)塊信息。去中心化:區(qū)塊鏈三大特效3、Thetechnicalarchitectureofblockchain3、

區(qū)塊鏈的技術(shù)架構(gòu)SixlayerarchitectureofblockchainBlockchaintechnologyarchitectureAsshowninthefigure,theblockchainsystemconsistsofadatalayer,anetworklayer,aconsensuslayer,anincentivelayer,acontractlayer,andanapplicationlayer.Datalayer:encapsulatestheunderlyingdatablocksandrelateddataencryptionandtimestamptechnologies;Networklayer:includesdistributednetworkingmechanism,datapropagationmechanism,anddataverificationmechanism,etc;Consensuslayer:mainlyencapsulatesvariousconsensusalgorithmsofnetworknodes;Incentivelayer:Integratingeconomicfactorsintotheblockchaintechnologysystem,mainlyincludingtheissuancemechanismanddistributionmechanismofeconomicincentives;Contractlayer:Itmainlyencapsulatesvariousscripts,algorithms,andsmartcontracts,andisthefoundationoftheprogrammablefeaturesofblockchain;Applicationlayer:Itencapsulatesvariousapplicationscenariosandcasesofblockchain.區(qū)塊鏈六層體系結(jié)構(gòu)區(qū)塊鏈技術(shù)架構(gòu)區(qū)塊鏈系統(tǒng)由數(shù)據(jù)層、網(wǎng)絡(luò)層、共識層、激勵層、合約層和應(yīng)用層組成。數(shù)據(jù)層:封裝底層數(shù)據(jù)塊和相關(guān)數(shù)據(jù)加密和時間戳技術(shù);網(wǎng)絡(luò)層:包括分布式組網(wǎng)機(jī)制、數(shù)據(jù)傳播機(jī)制、數(shù)據(jù)驗(yàn)證機(jī)制等;共識層:主要封裝網(wǎng)絡(luò)節(jié)點(diǎn)的各種共識算法;激勵層:將經(jīng)濟(jì)因素融入?yún)^(qū)塊鏈技術(shù)體系,主要包括經(jīng)濟(jì)激勵的發(fā)放機(jī)制和分配機(jī)制;合約層:主要封裝各種腳本、算法和智能合約,是區(qū)塊鏈可編程特性的基礎(chǔ);應(yīng)用層:它封裝了區(qū)塊鏈的各種應(yīng)用場景和案例。4、Componentsofblockchain4、

區(qū)塊鏈的組成部分TheconceptofblocksBlockchain:Itisachainlikedatastructurethatcombinesdatablocksinchronologicalorderandensuresimmutabilityandunforgeabilitythroughcryptographicmeans.Sothequestionis,whatisablock?Inblockchain,dataispermanentlystoredintheformofelectronicrecords.Thefilesthatstoretheseelectronicrecordsarecalledblocks.Asshowninthefigure,itconsistsofblocksonebyone,eachcontainingasetoftransactioninformation.Eachblockhasanaddress,andtheseblocksformachainbyrecordingtheIDofthepreviousblock.

區(qū)塊的概念區(qū)塊鏈:由一個一個的區(qū)塊組成,每個區(qū)塊中包括著一組交易信息,每一個區(qū)塊都會有一個地址,這些區(qū)塊通過記錄前一個區(qū)塊的ID來形成一條鏈。如圖所示,它由一個接一個的塊組成,每個塊都包含一組交易信息。每個塊都有一個地址,這些塊通過記錄前一個塊的ID形成一個鏈。所以問題是,什么是塊?在區(qū)塊鏈中,數(shù)據(jù)以電子記錄的形式永久存儲。存儲這些電子記錄的文件稱為塊。TheconceptofblocksAsshowninthefigureontheright:Ablockconsistsoftwoparts:blockheaderandblockbody.Blockheader:Recordthemetadata,alsoknownasfeaturevalues,ofablock.Suchasparentblockhash,timestamp,Merkleroot,andsoon.Blockbody:Theblockbodycontainsactualtransactiondata.blockDistrictHeadParentblockhashtimestampOtherMerkelGenHash1234Hash12Hash34Hash1Hash2Hash3Hash4Transaction1Transaction2Transaction3Transaction4Blockbody

區(qū)塊的概念區(qū)塊:區(qū)塊頭+區(qū)塊體兩部分構(gòu)成。區(qū)塊頭:記錄區(qū)塊的元數(shù)據(jù)(metadata)也叫特征值。

區(qū)塊體:指的是在一定時間內(nèi)所生成的詳細(xì)數(shù)據(jù)區(qū)塊區(qū)塊頭父塊哈希時間戳其他……默克爾根哈希1234哈希12哈希34哈希1哈希2哈希3哈希4交易1交易2交易3交易4區(qū)塊體BlockheaderinformationdataitemInstructionssizepreviousblockhashThehashpointingtothepreviousblockisusedtoensurethattheentireblockchainisorderly.32BversionIndicatetheverificationrulesfollowedbythisblock4BtimestampThetimewhentheblockwasgenerated4BnonceUsedtogeneratehashvaluesthatmeettheminingdifficultytarget,inordertominenewblocks.32BTargetDifficultyofProofofWorkTargetforCurrentBlock4BMerkle-rootBasedonthehashvaluesofalltransactionsinthecurrentblock4BDataitemsforblockheaderTheblockheadercontainsmultipleimportantdataitemsusedtodescribeandverifythebasicinformationoftheblock.

區(qū)塊頭信息數(shù)據(jù)項(xiàng)說明大小父塊哈希(previousblockhash)指向上一個區(qū)塊的哈希,用于確保整個區(qū)塊鏈?zhǔn)怯行虻摹?2B版本號(version)表示本區(qū)塊遵守的驗(yàn)證規(guī)則4B時間戳(timestamp)該區(qū)塊產(chǎn)生的時間4B隨機(jī)數(shù)(nonce)用來生成滿足挖礦難度目標(biāo)的哈希值,以便挖出新的區(qū)塊。32B目標(biāo)值(Target)當(dāng)前區(qū)塊的工作量證明目標(biāo)難度4B默克爾根(Merkle-root)基于當(dāng)前區(qū)塊中所有交易的哈希值4B區(qū)塊頭的組成塊頭包含多個重要數(shù)據(jù)項(xiàng),用于描述和驗(yàn)證塊的基本信息。BlockinformationdataitemInstructionssizeVersionIndicatetherulesreferencedinthistransaction4BIn-counterApositiveintegerrepresentingthenumberofinputs,1~9BlistofinputsThefirsttransactionineachblockiscalleda"Coinbase"transaction.---Out-counterIndicatethequantityofoutput,1~9BlistofoutputsTheoutputofthefirsttransactionineachblockisarewardforminers.---lock_timeBlocknumber;Ifthetransactionhasbeenterminated,itreferstothetimestamp.---ThemaindataitemsintheblockbodyTheblockcontainsactualtransactiondata,andeachtransactionismainlydividedintothreeparts:metadata,aseriesofinputs,andaseriesofoutputs.區(qū)塊信息數(shù)據(jù)項(xiàng)說明大小版本標(biāo)識該筆交易所參考的規(guī)則4字節(jié)輸入計(jì)數(shù)(In-counter)表示輸入數(shù)量的正整數(shù)1~9字節(jié)輸入列表每個區(qū)塊中的第一筆交易稱為“幣基(Coinbase)交易”---輸出計(jì)數(shù)(Out-counter)表示輸出數(shù)量1~9字節(jié)輸出列表每個區(qū)塊中第一筆交易的輸出是給礦工的獎勵---鎖定時間(lock_time)區(qū)塊號;若交易已終止,則指時間戳---區(qū)塊體中的主要數(shù)據(jù)項(xiàng)區(qū)塊包含實(shí)際的交易數(shù)據(jù),每筆交易主要分為三部分:元數(shù)據(jù)、一系列輸入和一系列輸出。LinkedStorageAsshowninthefigurebelow,eachblockiscloselyconnectedtothepreviousblock,formingacontinuouslygrowingdatachain.Eachblockcontainsthehashvalueofthepreviousblockanditsowntransactiondata.Essence:Implementpairwiseconnectionsbetweenblocks.Theimplementationmethodistostorethesummarydataofthepreviousblock(thehashvalueoftheparentblockintheblockheader)intheblockheaderofthenextblock.Ablockisthecarrierofinformationstoredinablockchain,whichstoresdatainachainstructure.

鏈?zhǔn)酱鎯Ρ举|(zhì):實(shí)現(xiàn)區(qū)塊間的兩兩連接。實(shí)現(xiàn)方式為將前一個區(qū)塊的摘要數(shù)據(jù)(區(qū)塊頭中的父塊哈希值)存儲在后一個區(qū)塊的區(qū)塊頭中。

區(qū)塊鏈以鏈?zhǔn)浇Y(jié)構(gòu)存儲數(shù)據(jù),每個區(qū)塊與前一個區(qū)塊緊密相連,形成了一個不斷增長的數(shù)據(jù)鏈條。每個區(qū)塊都包含了前一個區(qū)塊的哈希值和自身的交易數(shù)據(jù)或信息。5、Simplecodeimplementationonblockchain5、

區(qū)塊鏈上的簡單代碼實(shí)現(xiàn)BlockcodedesignNow,let'sdesignasimpleblockchainthroughcode.WeusePythonlanguagetoimplementithere.Firstly,definetheblockstructure.DefineaBlockclasstorepresentablock:initializetheblock,includingblockindex,timestampofblockgeneration,datastoredintheblock,parenthashvalue,calculatethehashvalueofthecurrentblock,etc.

區(qū)塊代

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論