![Platform white paper 平臺技術(shù)白皮書_第1頁](http://file4.renrendoc.com/view5/M00/06/24/wKhkGGYTlL2Af7DeAAFw4P9mkqQ076.jpg)
![Platform white paper 平臺技術(shù)白皮書_第2頁](http://file4.renrendoc.com/view5/M00/06/24/wKhkGGYTlL2Af7DeAAFw4P9mkqQ0762.jpg)
![Platform white paper 平臺技術(shù)白皮書_第3頁](http://file4.renrendoc.com/view5/M00/06/24/wKhkGGYTlL2Af7DeAAFw4P9mkqQ0763.jpg)
![Platform white paper 平臺技術(shù)白皮書_第4頁](http://file4.renrendoc.com/view5/M00/06/24/wKhkGGYTlL2Af7DeAAFw4P9mkqQ0764.jpg)
![Platform white paper 平臺技術(shù)白皮書_第5頁](http://file4.renrendoc.com/view5/M00/06/24/wKhkGGYTlL2Af7DeAAFw4P9mkqQ0765.jpg)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
ChromiaPlatformwhitepaper平臺白皮Platformwhitepaper平臺白皮書ExecutiveSummary摘要Motivation動Technicaldesign&features技術(shù)設(shè)計&特征Uses使用Designrationale設(shè)計原Overviewofproblemswithexistingplatforms現(xiàn)有平臺問題概述Blockchainasadatabase作為數(shù)據(jù)庫的區(qū)塊鏈Relationalmodel關(guān)系模First--classdecentralizedapplications頂尖的分散應(yīng)用程序Programmingmodel編程模型Consensus&nodes共識&節(jié)點Modeloverview模型概述SybilcontrolmechanismSybil控制機制Consensus共識Nodecompensation節(jié)點補償Miscellaneousfeatures其他特征Decentralizedapplications分散應(yīng)用程序Transparentapps透明的應(yīng)用程序Tokenmodel代幣模型TheroleofChromiaChromia的角Notcontrolledbyasingleentity.非受控于單個個體Controlledbythecommunityofusers.受用戶社區(qū)控制Cannotbeshutdown.不可關(guān)閉Censorship--resistant.抗審查Transparent.透明的Privacy.隱私Highlyavailable.高效Decentralizationquality去中心化質(zhì)量Platformarchitecture平臺架構(gòu)Postchain后鏈ChainsNodeimplementation節(jié)點實Interactionwithotherblockchains與其他區(qū)塊鏈的交互Components組件Governance管ChromapolissystemgovernanceChromia系統(tǒng)管Initialcentralization初始中心化Rejectedalternatives被否決的選擇Stake/coinvoting賭注、錢幣投Noformalgovernance沒有正式的管理Uniqueusers獨特的用戶Applicationgovernance應(yīng)用程序管理Uses使用Tokens代幣Games游Businessuses商業(yè)用途Tokensandincentives代幣和激勵Fees費Applicationfeemodels應(yīng)用程序費用模型Hostingfees代管費Nodeincentives節(jié)點激勵Nodestakes節(jié)點股份Tokenuseingames游戲中使用的代幣Chromatokeneconomics幻彩代幣經(jīng)濟Systemaccounts系統(tǒng)賬戶Publicgoodaccount公共優(yōu)良賬戶Tokendistribution代幣分配Promotionaltokenfund促銷代幣資金Decentralization去中心化Centralizationnecessaryatstart以中心化開Decentralizationthroughadiversesetofproviders通過多樣化的供應(yīng)商去中心化Bitcoin比特幣DPoSEthereum以太坊ChromapolisChromiaNumberoffullnodes全節(jié)點數(shù)量Security安全Blockchain區(qū)塊鏈Nodesecurity節(jié)點安全Governancesecurity管理安全Lightclientsecurity輕客戶安全Dappclientandwalletsecurity分散應(yīng)用程序客戶和錢包安ExecutiveSummary摘Chromiaisanewblockchainplatformfordecentralizedapplications,conceivedinresponsetotheshortcomingsofexistingplatformsanddesignedtoenableanewgenerationofdappstoscalebeyondwhatiscurrentlypossible.Chromia是為分散應(yīng)用程序提供的一個嶄新的區(qū)塊鏈平臺,旨在解決現(xiàn)存平臺的缺陷,開創(chuàng)分散應(yīng)用程序的新時代。Motivation動WhileplatformssuchasEthereumallowanykindofapplicationtobeimplementedintheory,inpracticetheyhavemanylimitations:baduserexperience,highfees,frustratingdeveloperexperience,poorsecurity.Thispreventsdecentralizedapps(dapps)fromgoingmainstream.雖然像以太坊這樣的平臺理論上可支持任何應(yīng)用程序的執(zhí)行,但實際運用中卻存在很多局限:不良的用戶體驗、高昂的平臺費用、欠佳的開發(fā)者體驗、較低的安全性。這些都阻礙了分散應(yīng)用程序走向主流的步伐。Webelievethattoaddresstheseproblemsproperlyweneedtoseriouslyrethinktheblock--chainarchitectureandprogrammingmodelwiththeneedsofdecentralizedapplicationsinmind.Ourprioritiesareto:要解決這一系列問題,我們需要重新認真了解區(qū)塊鏈架構(gòu),以分散應(yīng)用程序的需求為中心來設(shè)計模塊。我們的首要任務(wù)是:Allowdappstoscaletomillionsofusers.使分散應(yīng)用程序面向數(shù)百萬用戶Maketheuserexperienceassmoothaswithacentralizedapplication:nofeeforeveryinteraction,nowaitingtime.使用戶體驗像中心化應(yīng)用程序一樣平穩(wěn),每筆交互都不收Allowdeveloperstobuildsecureapplicationswithminimaleffort,usingfamiliarpara--digms.使開發(fā)者能用最少的精力,參照相似的范例來開發(fā)安全的應(yīng)用程序。Technicaldesign&features技術(shù)設(shè)計和特Webelievethatwithinadecentralizedapplicationecosystemablockchainservestheroleofashareddatabase:Itstoresapplicationdataandmakessurethatdataadditions,updatesandtransformationsareauthorizedandconsistentwiththeapplication’srules.Forthisreason,Chromiaisdesignedandoptimizedtoservetheroleofashareddatabaseinthebestwaypossible.Itfeatures:在一個分散應(yīng)用程序的生態(tài)系統(tǒng)中,區(qū)塊鏈扮演著共享數(shù)據(jù)庫的角色。它存儲應(yīng)用程序數(shù)據(jù)確保數(shù)據(jù)的添加、更新、轉(zhuǎn)化都有授權(quán),且遵照應(yīng)用程序的規(guī)則。為此,Chromia應(yīng)運而生,力爭成為最佳的共享數(shù)據(jù)庫。它的特征有:Arelationalmodel1:Blockchaindataandapplicationstatearestoredinarelationaldatabase.Thismodelisconsideredtobebestinclassintermsofflexibility,versatilityandconsistency.關(guān)系模型:區(qū)塊鏈數(shù)據(jù)和應(yīng)用程序狀態(tài)被存儲在關(guān)系數(shù)據(jù)庫中。這一模塊被認為在靈活性、通用性和相容性方面是最一流的。Horizontalscaling:Eachdappgetsitsownblockchain(or,perhaps,multipleblock--chains).Eachblockchainisrunbyasubsetofnodes,thusbyincreasingnumberofnodeswecanincreasetotalthroughput.橫向擴展:每一個分散應(yīng)用程序擁有自己的區(qū)塊鏈(或許可能有多個區(qū)塊鏈)。每一區(qū)塊鏈通過節(jié)點的子集來運行,這樣就可以通過增加節(jié)點數(shù)量來增加總產(chǎn)量。Richindexingandquerying:Dappscanquicklyretrieveinformationtheyneeddirectlyfromnodesrunningtheapplication.Dappblockchainlogiccanperformcomplexque--rieswithoutsevereperformancedegradation.強大的檢索和查詢:分散應(yīng)用程序能快速從運行的應(yīng)用程序節(jié)點中直接獲取它們需要的信息。分散應(yīng)用程序的區(qū)塊鏈邏輯可以在沒有嚴重績效降級的情況下完成復(fù)雜的查詢。Arelationalprogramminglanguage:Chromiadappbackendsarewritteninaspecial--izedlanguagewhichisdeeplyintegratedwiththerelationalmodel.Thismodelin--creasesprogrammerproductivityandensuresapplicationconsistency.關(guān)系編程語言:Chromia的分散應(yīng)用程序后端由專業(yè)語言編成,與關(guān)系模型深入融HighI/Othroughput:dataqueriesandupdatesaredelegatedtoaheavilyoptimizedrelationaldatabase,allowingdappstoperformalargenumberofqueriesanddataupdateoperations.I/O高吞吐量:數(shù)據(jù)查詢和更新的速度代表了極度優(yōu)化的關(guān)系數(shù)據(jù)庫,使分散應(yīng)用程序能處理大量查詢和數(shù)據(jù)更新。PBFT2--styleconsensus:Transactionscanbeconfirmedwithinseconds.PBFT式共識:交易在數(shù)秒內(nèi)就能確認。First--classdapps:Dappsdonotarisefrom“smartcontracts”inChromia,butarecon--sideredfirst--classentities.Chromiagivesdappdevelopersahighdegreeofflexibilityandcontrol.Forexample,Chromiadoesnotchargedappusersforeachtransactiontheymake,insteadcollectingfeesfromdappsasawhole.Thisleavesdevelopersfreetocreatetheirownfeeandresourceusepolicies.一流的分散應(yīng)用程序:在Chromia,分散應(yīng)用程序并非起源于“智能合約”,而是一個一流的個體。Chromia給予分散應(yīng)用程序開發(fā)者更強的靈活性和控制權(quán)。例如,Chromia不對分散用戶的每筆交易進行收費,而是整體收費。這使得開發(fā)者能自主制定費用和資源使用政策。1CoddE.F(1970)ARelationalModelofDataforLargeSharedDataBanks"大型共享數(shù)據(jù)庫的數(shù)據(jù)關(guān)系模CommunicationsoftheACM.計算機協(xié)會通Classics13(6)377–87;/ci--2Castro,M.;?Liskov,B.(2002)."PracticalByzantineFaultToleranceandProactiveRecovery"“實用的拜占庭式容錯和主動恢復(fù)”.ACMTransactionsonComputerSystems.計算機系統(tǒng)上的ACM交易Asso--ciationforComputingMachinery.計算機協(xié)會 20(4):398–461.ChromiaisimplementedontopoftheexistingPostchain3frameworkdevelopedbyChro--Chromia在幻彩大道開發(fā)的后鏈架構(gòu)上運行Chromiaoffersthesamelevelofopenness,transparencyanddecentralizationasotherpublicblockchains.InChromiaminersarereplacedwithproviders.Providersownnodeswhichpro--duceblocks.IthasbeensuggestedthatthefourlargestminingpoolsofbothBitcoin4andEthereum5couldexertsignificantcontroloverthosenetworksiftheycolluded.Weaimtoen--surethattheminimumnumberofnodeproviderswhosecollusionwouldberequiredtoexertsuchcontrolonChromiaexceedsthisnumbersignificantly.ItcanthereforebesaidthattheChromiamodeldoesnottendtowardscentralizationanymorethantheoldestandmosttrustedpublicblockchains.Chromia與其他公有區(qū)塊鏈一樣開放、透明、去中心化。在Chromia,礦工被供應(yīng)商所取代供應(yīng)商擁有能夠生產(chǎn)區(qū)塊的節(jié)點。有人建議,如果比特幣和以太坊的四大礦池串通,將對那些網(wǎng)絡(luò)形成極強的控制。而我們力求確保節(jié)點供應(yīng)商的最小量遠超這一數(shù)字。那么我們可以說Chromia模型并不像最古老的,最受信任的公有區(qū)塊鏈那樣走向中心化。Chromia’PBFT--styleconsensusisfurtherhardenedbyanchoring6tomakesurethatfinalityisatleastasstrongasthefinalityofProofofWork(PoW)blockchainssuchasBitcoinandEthereum.ToalterthehistoryofananchoredportionofChromiablockhistoryitwouldbenecessarytocombinePoWblockchainreorganizationwithamaliciouscollusionofasufficientnumberofChromianodes.ChromiaPBFT式共識通過側(cè)鏈來加固,確保它的終端至少同比特幣、以太坊這樣的PoW區(qū)鏈一樣強健。為了改變以往Chromia區(qū)塊中的側(cè)鏈比例,我們有必要將PoW區(qū)塊鏈與Chromia一定數(shù)量的惡意串通節(jié)點進行重組Uses使Chromiaisageneral--purposeplatformwhichissuitableforalmostallkindsofdapps.ItisparticularlywellsuitedtocaseswhichrequirehighI/Ocapacityorwhichinvolvemanagementofcomplexdatasets.Chromia是一個面向大眾的平臺,它適用于幾乎所有種類的分散應(yīng)用程序。尤其適用于對吞吐量有高要求的或者需要管理復(fù)雜數(shù)據(jù)的情況3456WeoriginallydescribedAnchoringas“side--chains”我們最初將錨定形容為“側(cè)鏈”/index.php?topic=313347;?amoreformaldiscussionofanchoringcanbefoundintheBitFurywhitepaper“OnBlockchainAuditability”.對于錨定更正式的討論可以在BitFury白皮書“區(qū) Massivelymultiplayeronlinegames(MMOGs)areoneexample.Chromiaiscapableofhost--ingentiregameworldsintheblockchain,makingsurethattheyevolveaccordingtopredeter--minedrulesandensuringthatnoonecancheat.Blockchaingamingisbecomingincreasinglypopular,butMMOGsarecurrentlyoutofreachbecausenoexistingblockchainplatformcansupportthem.WebelievethatimplementingaMMOGwillbethebestwaytoshowcasethecapabilitiesofChromia.MMOGshaveaverydemandingsetofrequirements;?thecapacitytorunMMOGsimpliesthatChromiaissuitablefordemandingandcomplexdappsofallkinds.多用戶在線游戲(MMOG)就是一個很好的例子。Chromia可在區(qū)塊鏈上支持整個游戲世界,并確保按照既定的規(guī)則進行,沒有人可以作弊。區(qū)塊鏈游戲正日趨受歡迎,但MMOG卻很少有人涉足,因為現(xiàn)有的區(qū)塊鏈平臺都無法支持他們。而MMOG的運行恰恰最好展示了Chromia的實力。MMOG對平臺有著十分苛刻的要求,因此MMOG的運行意味著Chromia有能力應(yīng)對任何復(fù)雜的分散應(yīng)用程序。Designrationale設(shè)計原Overviewofproblemswithexistingplatforms現(xiàn)有平臺問題概Ethereumwasafirstblockchaintoofferaplatformfordecentralizedapplicationdevelopment.Manyapplicationprototypeswerecreated,butdevelopersfacedthefollowingissues:以太坊是為分散應(yīng)用程序發(fā)展提供的第一個區(qū)塊鏈平臺。它創(chuàng)建了許多應(yīng)用程序標準,但開發(fā)者會面臨以下問題:Limitedcapacity.Becausenetworkcapacityislimited,andusagefeesareproportionaltoload,transactionfeescanbe$1ormoreforcomplexapplications.Thiscost,typi--callypaidforeachinteractionwithanapplication,makesmostapplicationstooexpen--sivetobepractical.有限容量。因為網(wǎng)絡(luò)容量有限,且使用費是按比例收取,交易費可達1美元,一些雜的應(yīng)用程序會更貴。高昂的成本使得大多數(shù)應(yīng)用程序都貴的離譜ProhibitivelyexpensiveI/Ooperations,forthesamereason.Forexample,acontractcannotiteratethroughalistofuserssincethecostofthisactionwouldexceedtheblockgaslimit.Thusdevelopershavetojumpthroughhoopstoimplementsomethingassimpleasaninterestpaymenttoalistofusers.同樣的原因?qū)е逻^高的I/O操作費。例如,一份合約不能對多個用戶使用,因為這一操作的成本超出了區(qū)塊的限制。因此,開發(fā)者不得不向用戶們重復(fù)類似于利息支付那樣的簡單操作。Poordatamodellingtoolsandpoorsupportforqueries.Applicationdevelopershavetoresorttocentralizedindexingandcachinglayers,orusingthirdpartyserviceswhichdonotprovidethesamesecurityguaranteesasthebaselayer.欠佳的數(shù)據(jù)模型工具和查詢支持。應(yīng)用程序開發(fā)者不得不通過中心索引來獲取應(yīng)用層,有時還需借助第三方服務(wù),但這樣又得不到同等的安全保障。Error--pronecontractlanguagewhichhasresultedinmanyhigh--profile易出錯的合約語言已導(dǎo)致許多備受矚目的攔劫Noprovisionforcontractupgradesattheplatformlevel,thisfunctionalityhastobeimplementedasaseparatelayerwhichfurtherincreasescomplexity.在平臺層面沒有合約升級的條款,在單獨應(yīng)用層實現(xiàn)這一功能更加劇了復(fù)雜性UsershavingtopayfeesforeveryinteractionresultsinpoorUX.Slowconfirmationsareamajorusabilityissue.用戶需要為每一次交互付費導(dǎo)致了不好的用戶體驗。確認速度慢是一個主要的使用問題。Poorlightclientsupport.ThreeyearsafterbeginningdevelopmenteffortstheEthereumFoundationwasstillstrugglingtoofferaproduction--qualitylightwallet.不良的輕客戶端支持。在開發(fā)平臺三年后,以太坊基金仍舊在研發(fā)產(chǎn)品級質(zhì)量輕錢包。Applicationsdesignedwithalargeaudienceinmindneedtobeflexibleandresponsive.Theyrequireaplatformwhichempowersthedevelopertoallocateresourcesinawaythatsuitstheirusers.EvenifEthereumandotherplatformscurrentlyindevelopmenttacklescalabilityissues,theywillnotbeabletoprovideasufficientdegreeofdeveloperautonomyandwillremainasomewhathostileenvironmentfordapps.面向大批量客戶群的應(yīng)用程序必須具有靈活性和快速響應(yīng)能力。它們要求平臺賦能開發(fā)者完成用戶所需資源的配置。即使以太坊等其他平臺目前正發(fā)展解決可擴展性的問題,他們依舊無法給開發(fā)者提供足夠的自主權(quán),對于分散應(yīng)用程序而言仍舊會是個糟糕的運行環(huán)境。Webelievethattoaddresstheseproblemsproperlyweneedtoseriouslyrethinktheblock--chainarchitectureandprogrammingmodelwiththeneedsofdecentralizedapplicationsin要解決這一系列問題,我們需要重新認真了解區(qū)塊鏈架構(gòu),以分散應(yīng)用程序的需求為中心來設(shè)計模塊。Blockchainasadatabase作為數(shù)據(jù)庫的區(qū)塊Themainroleofablockchaininadecentralizedapplicationcontextistomanagedatainasecureandconsistentmanner.Thusitcanbeunderstoodasadatabase,particularly,asasecuredecentralizeddatabase.Anothermajorroleofablockchainispreventionofdouble--spending,butthisisaspecialcaseofdataconsistencyconstraints.在分散應(yīng)用程序的環(huán)境中區(qū)塊鏈的主要職責(zé)是以安全和始終如一的方式管理數(shù)據(jù)。所以它可被定義為一個數(shù)據(jù)庫,一個安全的去中心化數(shù)據(jù)庫。區(qū)塊鏈的另一個重要職責(zé)是防止重復(fù)消費,但這是針對數(shù)據(jù)一致性約束的一個個例。Blockchainswhichareoptimizedforpayments,suchasBitcoin,canadopthighlyspecialized(andoptimized)datamodels.Butaplatformdesignedforhostingdiversedecentralizedappli--cationsneedsageneral--purposedatamodel.像比特幣這樣優(yōu)化付款的區(qū)塊鏈可以采用高級定制化(和優(yōu)化)的數(shù)據(jù)模型。但一個承載多樣化分散應(yīng)用程序的平臺需要的是一個多用途的數(shù)據(jù)模型。Mostblockchainplatformsnowadaysusekey--valuedatastores(examples:Ethereum,NEO,Fabric).Thismodelis,intheory,complete,andenablestheuseofhigh--performancedatastoressuchasLevelDB.However,thismodelisverylow--level.Itrequiresapplicationdevel--operstoimplementdetailssuchasserializationandindexing,adauntingchallenge.現(xiàn)行的多數(shù)區(qū)塊鏈平臺都使用關(guān)鍵值數(shù)據(jù)存儲(如:以太坊,NEO,Fabric等)。從理論上講,這一模型完整且可以使用像LevelDB這樣高效的數(shù)據(jù)存儲。但是,這種模型是非常低層次的。它要求應(yīng)用程序開發(fā)者執(zhí)行序列化和檢索等細節(jié),這無疑是一巨大挑戰(zhàn)。Compoundingthis,blockchainplatformstypicallydonotexposethefullfunctionalityofkey--valuestores,suchastheabilitytousearbitrary--sizedkeysanditeratethroughkeys.Forex--ample,inEVMallkeysare256--bitintegersanditeratingthroughstoredkeysisimpossible.Forthesereasons,implementingproperindexeddataaccessontheEVMisbothdifficultand綜合以上情況,區(qū)塊鏈平臺無法展示關(guān)鍵值存儲的所有功能,比如任意大小值和重復(fù)值的使用能力。在EVM中所有值都是256比特整,重復(fù)使用存儲值也是無法實現(xiàn)的。為此,在上執(zhí)行適當(dāng)?shù)臋z索數(shù)據(jù)權(quán)限是困難且無效的。Relationalmodel關(guān)系模Forthereasonsstatedabove,weconsiderourchoiceofdatamodeltobethelynchpinofourblockchainplatform.綜上所述原因,我們將數(shù)據(jù)模型的選擇視為區(qū)塊鏈平臺的關(guān)鍵Therelationalmodelhasbeenthegoldstandardfordatabasemanagementforthelastfivedecades.Rootedinmathematicsandlogic,itisknowntobeabletomodelcomplexdatainanefficientway.關(guān)系模型在過去的五十年里都是數(shù)據(jù)庫管理的黃金標準。從數(shù)學(xué)和邏輯角度出發(fā),關(guān)系模型被認為可以高效建立復(fù)雜數(shù)據(jù)模型。Asdecentralizedapplicationsdealwithincreasinglycomplexdatastructures,thepoweroftherelationalmodelbecomesmoreandmoreapparent.Further,mostsoftwareengineersarealreadyfamiliarwithitsotheywon’thavetolearnnewconceptsinordertoimplementan由于分散應(yīng)用程序處理著日益復(fù)雜的數(shù)據(jù)架構(gòu),關(guān)系模型的力量也日趨明顯。此外,大多數(shù)軟件工程師都已熟悉關(guān)系模型,無需再為執(zhí)行應(yīng)用程序?qū)W習(xí)新的理念。ArelationalmodelalsoallowsustoleveragethepowerofSQLdatabasemanagementsys--temswhichhavebeenoptimizedfordecades.Insteadofdappcodewhichtraversesmemorycellsonebyone,wecansendaquerytotheDBMSandletituseitssophisticatedqueryplanning,datastructuresandcachingcapabilitiestocarryoutthequeryasfastaspossible.關(guān)系模型也使我們能利用已經(jīng)被優(yōu)化了幾十年的SQL數(shù)據(jù)庫管理系統(tǒng)。與其讓分散應(yīng)用程序代碼一個個穿過記憶細胞,我們可以向DBMS發(fā)送一個查詢請求,讓它運用其精細的查詢設(shè)計、數(shù)據(jù)架構(gòu)和獲取能力來快速開展查詢。Ofcourse,thechoiceofdatamodelisatradeoff.Therelationalmodelmighthavethefollow--ingdisadvantages:當(dāng)然,數(shù)據(jù)模型的選擇也是一個折中的考量。關(guān)系模型也有以下的一些缺陷Performanceishardtopredictanddependsonthequeryplanner.Thisisnotasignif--icantdisadvantageinthecontextofChromiabecauseeachdappwillberuninanisolatedmanner;?slowquerieswillaffectonlythedappwhichperformsthemratherthanthesystemasawhole.性能的好壞很難預(yù)測,它取決于查詢計劃者。這對于Chromia也并非是一個重大缺陷,因為每一個分散應(yīng)用程序都以單獨的方式運行,查詢緩慢只會影響分散應(yīng)用程序,而不是系統(tǒng)本身。Itisimpossibletoimposehardboundsonqueryexecutiontime.Again,thisisnotaprobleminthecaseofChromiabecauseitaffectsonlytheapplicationwhichissuesslowqueries.對查詢執(zhí)行時間規(guī)定明確界限并不切實可行。同樣,這對Chromia而言也不是問題,ParallelizationofSQLdatabasesisacomplexareaofactiveresearch.Asfarasweknow,noblockchainplatformoffers100%fullyautomaticparallelizationonamassivescale.Thusthereisnoevidencethatarelationalmodelisworsethanothermodels.Inaddition,webelievethattherelationalmodelwillmakelogicalshardingandsidechainmechanismseasiertoimplement.SQL數(shù)據(jù)庫的平行化是有效調(diào)查的一個難點。據(jù)目前了解,尚未有區(qū)塊鏈平臺能在大范圍內(nèi)提供100%自動平行化。所以,沒有證據(jù)可以證明關(guān)系模型不如其他模型。另外,我們認為關(guān)系模塊將會使邏輯分片和側(cè)鏈機制更易執(zhí)行。First--classdecentralizedapplications頂尖的分散應(yīng)用程InEthereumallcodelivesin“contracts”.Itdoesnotdifferentiatebetweenindividualwalletcontractsandcomplexmulti--usercontracts,theyallusethesameresourcemeteringnadpro--grammingmodel.AnEthereum--baseddappwilluseoneormorecontracts(possiblyacontractforeachuser)andfront--endcomponents.Infact,manyEthereumapplicationsmakeuseofcentralizedcaching,renderingtheir“decentralized”credentialssomewhatdubious.在以太坊上,所有的代碼存活于“合約”中。私有錢包合約與復(fù)雜多用戶合約并未區(qū)分開,他利用的是同一資源測量程序模型。一個基于以太坊的分散應(yīng)用程序會用一個或多個合約(一個用戶一份合約)和前端組件。事實上,許多以太坊應(yīng)用程序利用中心化緩存來補償“去中心化”證書,這多少有些可疑。Whilethisapproachisquiteelegantandcanscaletodifferentkindsofapplications,itisveryinconvenientfordappsdesignedformassuse.End--usershavetopayforeveryinteractionwiththeirdapp,inproportiontothecomputationalandstorageresourcesrequiredfortheirtransaction.Inotherwords,Ethereumdoesn’tgivedecentralizedapplicationstheflexibilitytomanageresourcesthemselves.Forexample,a“freemium”businessmodelisoutrightimpos--sible.Thiscreatesabarrierfordecentralizedapplicationadoption:mostusersarenotreadytopayforeverysingleclick.雖然這一方法十分明智,可以分布到各不同種類的應(yīng)用程序,但對于大范圍使用的分散應(yīng)用序來說很不方便。終端用戶需要為他們分散應(yīng)用程序上的每一次交互付費,與他們所需的計算和存儲資源成正比。換言之,以太坊沒有給分散應(yīng)用程序該有的靈活性來管理他們自己的資源。例如,“免費增值”的商務(wù)模型是完全無法實現(xiàn)的。這給分散應(yīng)用程序的使用添加了一道屏障,大多數(shù)用戶并未準備好為他們的每一次操作買單。ChromiasolvesthisissuebyprovisioningresourcesonthedecentralizedapplicationChromia通過在分散應(yīng)用程序?qū)用嫣峁┵Y源來解決此問題Eachdapphasitsownblockchain每個分散應(yīng)用程序擁有自己的區(qū)塊鏈(側(cè)鏈Fees(collectedtomaintainnodes)arepaidbythedappasawhole,notbyend--users由分散應(yīng)用程序統(tǒng)一付費,而非終端用Thusdappsarefreetoimplementtheirownresourcemanagementpolicies,whichcanthusbealignedwitheconomicratherthantechnicalneeds分散應(yīng)用程序能夠執(zhí)行自己的資源管理政策,可以更好的統(tǒng)一經(jīng)濟需求,而非技術(shù)需求。Everyblockchainneedsananti--spammechanism,butthismechanismdoesn’thavetobetiedtofees.Forexample,adappmightallowonly1actionfromausereach15seconds,thusasingleuserwon’tbeabletospamtheblockchainwithbillionsoftransactions.AdappcanalsomitigateSybilattacksthroughlimitingnewuserregistrationtosomereasonablerateand/orrequiringinvitationoradeposit.每個區(qū)塊鏈都需要一個反垃圾信息機制,但這一機制并非要與費用掛鉤。例如,一個分散應(yīng)程序可能在15秒內(nèi)只允許用戶有一次操作,因此單一用戶不會在區(qū)塊鏈上有數(shù)十億次交易。分散應(yīng)用程序還可通過一定程度限制新用戶注冊量或通過邀請、押金的方式注冊來減輕Sybil攻擊。Inthismodel,wedonotneedtomeasuretheresourcesusedbyeachoperation.Instead,weprovisionresourcestotheapplicationasawhole:eachdapp’sblockchainwillrunonacertainsetofnodes.TypicallyitwillhaveitsowndedicatedCPUthread.在這一模型下,我們無需衡量每一操作的資源。相反,我們將資源整體運用到應(yīng)用程序上:每一分散應(yīng)用程序的區(qū)塊鏈通過一定數(shù)量的節(jié)點運行。它將有自己專屬的CPU螺紋。Thisremovesresourcemeteringoverhead(wenolongercarehowmanyinstructionswereexecuted,asanapplicationcannotusemoreresourcesthanitwasgiven)allowingdappstoperformfasterandscalebetter.這一資源轉(zhuǎn)移使得分散應(yīng)用程序運行更快,延伸更廣(我們不用再關(guān)注執(zhí)行了多少指令,因為應(yīng)用程序已最大化使用其資源)。Ifadappneedsmorethanoneexecutionthread,itcanconsistofmultipleshardseachofwhichwillbeasidechain.如果一個分散應(yīng)用程序需要多個執(zhí)行螺紋,它可包含多個分片,即側(cè)鏈Besidesscheduling,havingdappsasfirst--classcitizenontheplatformallowsthefollowing除了調(diào)度,作為平臺上的頂尖市民,分散應(yīng)用程序擁有以下特征Tokeneconomicsintegratedwithafeemodel,i.e.feesaretakenfromprofits“earned”byanapplication代幣經(jīng)濟與費用模型融合,如程序的支出可在其所獲盈利中支取Built--ingovernance內(nèi)置管Updates更Programmingmodel編程模ThePostchainframeworkonwhichChromiaisbasedallowsustouseexistingopensourceSQLdatabasesoftware(specifically,PostgreSQL)toimplementdatastoreandquerycapa--bilities.However,wecannotallowdappstoperformarbitrarySQLqueriesassaidqueriesmightbeunsafe,ambiguousorleadtoexcessiveresourceuse.Chromia所在的后鏈框架允許我們利用現(xiàn)有開放的SQL數(shù)據(jù)庫軟件來執(zhí)行數(shù)據(jù)存儲和查詢。但是,我們不允許分散應(yīng)用程序隨意執(zhí)行SQL查詢,因為查詢可能不安全、模糊不清或?qū)е沦Y源濫用。Mostdappblockchainplatformsusevirtualmachinesofvariouskinds.Butatraditionalvirtualmachinearchitecturedoesn’tworkverywellwiththeChromiarelationaldatamodel,asweneedawaytoencodequeriesratherthanjustoperations.大多數(shù)分散應(yīng)用程序區(qū)塊鏈平臺使用各種虛擬機器。但是傳統(tǒng)的虛擬機器在Chromia關(guān)系數(shù)Forthisreason,wearetakingmorelanguage--centricapproach:anewlanguagecalledRell([Rel]ational[l]anguage)willbeusedfordappprogramming.Thislanguageallowsprogram--merstodescribe:為此,我們采取更多以語言為中心的方法:一種叫做Rell(關(guān)系語言)的新語言將應(yīng)用于分散應(yīng)用程序的編程。這一語言使程序員能描述:Schema/datamodel模式/數(shù)據(jù)模Queries查Proceduralapplicationcode程序代Rellwillbecompiledtoanintermediatebinaryformatwhichcanbeunderstoodascodeforaspecializedvirtualmachine.ChromianodeswillthentranslatequeriescontainedinthiscodeintoSQL(whilemakingsurethistranslationissafe)andexecutecodeasneededusinganinterpreterorcompiler.Rell會編制一個二進制格式,可理解為一個專屬虛擬機器的代碼。Chromia的節(jié)點就會將帶此代碼的查詢翻譯成SQL,用編譯器來執(zhí)行代碼RellwillhavethefollowingRell有以下特征Typesafety/statictypechecks.It’sveryimportanttocatchprogrammingerrorsatthecompilationstagetopreventfinanciallosses.Rellwillbemuchmoretype--safethanSQL,anditwillmakesurethattypesreturnedbyqueriesmatchtypesusedinproce--duralcode.輸入安全/靜態(tài)類型檢查。在編輯階段發(fā)現(xiàn)編程錯誤很重要,可以防止不必要的經(jīng)濟損失。Rell比SQL在編寫時更加安全,它可確保查詢反饋輸入與代碼輸入相匹配。Safety--optimized.Arithmeticoperationsaresaferightoutofthebox,programmersdonotneedtoworryaboutoverflows.Authorizationchecksareexplicitlyrequired.安全優(yōu)化。算術(shù)操作安全可用,程序員無需擔(dān)心超限。授權(quán)檢查是明確要求的Concise,expressiveandconvenient.ManydevelopershateSQLbecauseit’sveryverbose.Relldoesn’tbotherdeveloperswithdetailswhichcanbederivedautomati--cally.Asadatadefinitionlanguage,Rellisupto7xmorecompactthanSQL.精準、可表現(xiàn)、方便。許多開發(fā)者不喜歡SQL,因為它及其繁瑣。Rell不會過多打擾開發(fā)者,細節(jié)之處可自動獲取。作為一個數(shù)據(jù)定義語言,Rell比SQL簡潔7倍多。Allowsmeta--programming.Wedonotwantapplicationdeveloperstoimplementthebasicsfromscratchforeverydapp.Rellwillallowfunctionalitytobebundledastem--支持元編程。我們不想讓應(yīng)用程序開發(fā)者忙于為每一個分散應(yīng)用程序執(zhí)行最基礎(chǔ)的內(nèi)容。所以,Rell支持模板功能。Weidentifiedthatnoexistinglanguageorenvironmenthasthefeaturesetrequiredforthistask,andthusdevelopmentofanewlanguageisabsolutelynecessary.我們意識到現(xiàn)存的任何語言或環(huán)境都無法完成此任務(wù),所以開發(fā)一種新的語言迫在眉睫WedesignedRellinsuchawaythatitiseasytolearnfor我們設(shè)計的Rell易于程序員學(xué)習(xí)Programmerscanuserelationalprogrammingidiomstheyarealreadyfamiliarwith.However,theydon’thavetogooutofwaytoexpresseverythingthroughrelationalalgebra:Rellcanseamlesslymergerelationalconstructswithproceduralprogram--程序員可以運用他們已經(jīng)熟悉的關(guān)系編程語言。但是他們無需用關(guān)系代數(shù)來表述所有東西。Rell可以將關(guān)系架構(gòu)與程序編程完美融合。ThelanguageisdeliberatelysimilartomodernprogramminglanguageslikeJavaScriptandKotlin.Afamiliarlanguageiseasiertoadaptto,andourinternaltestsshowthatprogrammerscanbecomeproficientinRellinmatterofdays.Incontrast,theALGOL--stylesyntaxofPL/SQLgenerallyfeelsancientandweirdtomoderndevelopers.該語言和JavaScript和Kotlin這樣的編程語言非常相似。一種熟悉的語言更容易被采納,我們的內(nèi)部測試顯示程序員幾天內(nèi)就可熟練運用Rell。相反,PL/SQL使用的ALGOL型語法顯得和當(dāng)今行業(yè)有些格格不入。TheEthereumprogrammingmodelistypicallydescribedasveryerror--prone.BugsinEthereumsmartcontractshaveresultedinlossestotallinghundredsofmillionsofdollars7.InChromia,weaimtoeliminatemostcommonsourcesofproblemsthroughabetterprogram--mingmodel(noweirdinteractionsbetweendifferentsmartcontractsasintheDAOcase89)andsaferlanguages.以太坊編程模型被認為極易出錯。以太坊智能合約中的故障已導(dǎo)致總計數(shù)億美元的損失。Chromia,我們希望通過更優(yōu)的編程模型和更安全的語言來消除這些最常見問題的根源7AlistofthemostseriousEthereumvulnerabilitiescanbefoundhere可訪問以下鏈接找到最嚴重的以太坊脆弱性清單:https://www.dasp.co/8hpsbogehereumorg20160617crcal-update--re--dao--9hpswwwwredcom20160650-million--hack--just--showed--dao--OnEthereumcodeisimmutable,itisoftenimpossibleforadevelopertofixherdappunlesssheretainsfullcontrol,thusmakingitnot--quite--decentralized.InChromia,upgradescanbedeployedthroughabuilt--ingovernanceandtransitionmechanism.在以太坊上的代碼是不可變的,開發(fā)者想要處理分散應(yīng)用程序必須保持對程序的完全控制,這樣就做不到去中心化了。在Chromia,程序更新可以通過內(nèi)置的管理和轉(zhuǎn)變機制來完成。Consensus&nodes共識&節(jié)ModeloverviewItisclearthatthefullnodemodeldoesn’tscaleparticularlywell.Ifwerequireuserstorunafullnodewhichhasacompletecopyofthesystemstatethendappsareseverelylimitedinwhatcomputationsandstorageresourcestheycanuse.很顯然,全節(jié)點模型并沒有延伸的很好。如果我們要求用戶運行擁有系統(tǒng)狀態(tài)全部備份的全節(jié)點,那分散應(yīng)用程序可用的計算和存儲資源就變得極其有限。Withtheaimofachievingbetterperformanceatscaleweproposeamodelinwhichindividualdappsarehostedonasubsetofvalidatornodes,whichestablishconsensusonanymodifi--cationstothedappstate,andhandleclientqueries.Thesystemshouldpermitanyusertorunafullreplicanodeifdesired,butthesystemshouldnotdependonthesereplicanodesfor為了能在延伸性方面能有更佳表現(xiàn),我們推出了讓單一分散應(yīng)用程序在驗證器子節(jié)點上運行的模型,這樣對分散應(yīng)用程序狀態(tài)的任何修改都可達成共識,也可處理客戶查詢。系統(tǒng)應(yīng)該允許任何用戶運行想要的全復(fù)制節(jié)點,但不應(yīng)該將常規(guī)運行依賴于此。SybilcontrolmechanismSybilTheresearchdonebyourteamindicatesthatcommonlyusedSybilcontrolmechanismslikePoWandProofofStake(PoS)areunsatisfactory10:neitherofthemguaranteesasufficientlevelofSybilattackmitigation,orevenaparticularlygoodmeasureofdecentralization.Evi--denceindicatesthatmostPoW--basedblockchains,includingBitcoin,mightbedefactocon--trolledbyasmallgroupofentities.Thisproblemisparticularlybadforsmallercryptocurrencieswhichdonotyethaveanindependentminingecosystem.PoSalsocomeswithnodecentral--izationguarantees,andDPoS11inparticularispronetoformationofcartelsandbribery.調(diào)查發(fā)現(xiàn),像PoW和PoS這樣常見的Sybil控制機制表現(xiàn)都不盡如人意。它們都無法保證Sybil攻擊有一定層級的減輕,甚至好的去中心化方式都沒有。事實證明,包括比特幣在內(nèi)的多數(shù)基于PoW的區(qū)塊鏈都很可能是由一小群個體控制的。這一問題對于小型加密貨幣尤為突出,因為它們沒有自己獨立的挖礦生態(tài)系統(tǒng)。PoS也沒有去中心化保障,DPoS甚至有壟斷和賄賂傾向。ThusinsteadoffollowingcommonlyusedapproacheswewilldesignChromiaconsensusandSybilcontrolmechanismsfromfirstprinciples.1011DelegatedProofofStake股份授權(quán)證明機制,hpsbsharesorgechnoogydeegaed-proof--of--因此,摒棄過往常用的方法,我們設(shè)計出了Chromia共識和Sybil控制機制FirstweobservethatwhatChromiaistryingtoachievecanbecomparedtocloudcomputing:anapplicationwhichredundantlyusesmultiplecloudhostingproviderscanbeconsideredadecentralizedapplication,inthesensethatfailureorcensorshipofasinglecloudhostingpro--viderdoesnotresultinashutdownofthewholeapplication.Acloudcomputingmodelalsoallowsuserstousethinclientsinsteadofhostingacompletereplicaofapplicationbackendontheirpersonaldevice.首先,我們發(fā)現(xiàn)Chromia所想要達成的可比作為云計算:一個過多使用多個云代管供應(yīng)商的應(yīng)用程序可被認為是一個分散應(yīng)用程序。單一云代管供應(yīng)商的故障或?qū)彶椴粫?dǎo)致整個應(yīng)用程序的癱瘓。云計算模型也使得用戶可以使用瘦客戶,而不是在他們個人設(shè)備上運行一整個應(yīng)用程序后端。TheessentialrolesintheChromiamodelaredefinedasfollows.Chromiasoftwarerunsonnodes,physicalorvirtualinstancesofcomputingpower.Nodesarecontrolledorperhapsownedbysomekindofindividual,organisation,orcollectivewhichwerefertoasaprovider.Usersconnecttosuchnodestoposttransactions,querydataorsynchronizetheirprivateChromia模型定義的基本職責(zé)如下。Chromia軟件在節(jié)點上運行,這些節(jié)點是物理或虛擬的運算力。節(jié)點被一些個人、組織或集體所控制或擁有,我們將他們稱之為供應(yīng)商。用戶連接這些節(jié)點以完成盤后交易、數(shù)據(jù)查詢或同步私人備份。AByzantinefaulttolerantnetworkisdistinguishedfromamerelyfaulttolerantnetworkbyitsabilitytotoleratearbitraryandpotentiallymaliciousbehaviourbynetworkparticipants.Theconceptofnodesissufficientfordesigningafaulttolerantnetwork,buttotargetproperByz--antinefaulttolerancewemust
溫馨提示
- 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年房產(chǎn)大數(shù)據(jù)合作協(xié)議書
- 2025年低壓化成箔合作協(xié)議書
- 2025年減震系統(tǒng)材料合作協(xié)議書
- 2025年個人店鋪租賃合同樣本(三篇)
- 2025年中學(xué)設(shè)備供貨合同(2篇)
- 2025年二年級初中班主任工作總結(jié)樣本(五篇)
- 2025年二手房買賣購房合同樣本(2篇)
- 2025年個人房屋簡易租賃合同樣本(4篇)
- 2025年代理記賬委托協(xié)議合同格式版(2篇)
- 2025年互聯(lián)網(wǎng)專線電路接入服務(wù)協(xié)議范文(2篇)
- 同等學(xué)力英語申碩考試詞匯(第六版大綱)電子版
- 中日合同范本
- T-CARM 002-2023 康復(fù)醫(yī)院建設(shè)標準
- 《康復(fù)按摩知識》課件
- 旅游文本的翻譯課件
- 最全新能源材料-鋰離子電池材料189張課件
- 申論詳解(PPT課件)
- 立式加工中心說明書
- 第八版神經(jīng)病學(xué)配套課件-12-中樞神經(jīng)系統(tǒng)感染性疾病
- 15MW風(fēng)力發(fā)電機
- 正面管教 讀書分享(課堂PPT)
評論
0/150
提交評論