Giter Club home page Giter Club logo

blockchain_guide's Introduction

区块链技术指南

v1.6.2

区块链是金融科技(Fintech)领域的一项基础性的创新。

作为新一代分布式记账(Distributed Ledger Technology,DLT)系统的核心技术,区块链被认为在金融、物联网、商业贸易、征信、资产管理等众多领域都拥有广泛的应用前景。

目前,区块链技术尚处于快速发展的阶段,涉及分布式系统、密码学、博弈论、网络协议等诸多学科知识,为学习和实践都带来了不小的挑战。

本书希望能客观探索区块链概念的来龙去脉,剖析关键技术和原理,同时以全球最大的开源分布式账本项目——超级账本为例讲解具体应用。在开发超级账本项目,以及为企业设计方案过程中,笔者积累了一些实践经验,也通过本书分享出来,希望能有助于分布式账本科技的发展和应用。

阅读使用

本书适用于对区块链技术感兴趣,且具备一定金融科技基础的读者;无技术背景的读者也可以从中了解到区块链技术的现状。

进阶学习

区块链原理、设计与应用 第二版

区块链原理、设计与应用 第 2 版》 围绕超级账本 Fabric 2.x 最新版,详细介绍了区块链和分布式账本领域的核心技术,以及企业分布式账本方案的设计、架构和应用,欢迎大家阅读并反馈建议。本书已被译为多国语言发行,有意欢迎与作者联系。

如果发现疏漏,欢迎提交到 勘误表

参与贡献

欢迎 参与维护项目

支持鼓励

欢迎鼓励一杯 coffee~

coffee

在线交流

欢迎大家加入区块链技术讨论群:

  • QQ 群 IV:364824846(可加)
  • QQ 群 III:414919574(已满)
  • QQ 群 II:523889325(已满)
  • QQ 群 I:335626996(已满)

blockchain_guide's People

Contributors

akio0o avatar autosaida avatar betterenvi avatar detailyang avatar gnokuw avatar guaguawa avatar gymgle avatar haizhenzhuo avatar hatuw avatar hdsfade avatar herrkaefer avatar hsyodyssey avatar huahang avatar jchenibm avatar jimfang avatar lafenicecc avatar lglove avatar oldsharp avatar qiang0723 avatar qianyingshuo avatar qurikuduo avatar stephenmjm avatar swbsin avatar syaojun avatar vquanli avatar xianfeng92 avatar yeasy avatar yupengzte avatar zhangnew avatar zzmarquis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockchain_guide's Issues

Recovery seed

I want to know the watch only wallet of Blockchain recovery phrase.

42页翻译用词问题

42页 “注:著名黑客凯文•米特尼克(Kevin D. Mitnick)所著的《反欺骗的艺术——世界传奇黑客的
经历分享》一书中分享了大量的真实社交工程欺骗案例。” 一句中使用的“社交工程”大陆一般用“社会工程”。

章节缺失

大神你好,
阅读中发现区块链应用开发的“简介”页和“链上代码工作原理”页是空白,这个会考虑填上吗

go build error of chaincode_example03.go

The example chaincode occurs error messages while go build:
https://yeasy.gitbooks.io/blockchain_guide/content/hyperledger/chaincode_examples/chaincode_example03.go


root@peer0:~# ls
chaincode_example03.go
root@peer0:~# go build
# _/root
./chaincode_example03.go:57: cannot use new(SimpleChaincode) (type *SimpleChaincode) as type shim.Chaincode in argument to shim.Start:
	*SimpleChaincode does not implement shim.Chaincode (wrong type for Init method)
		have Init(*shim.ChaincodeStub, string, []string) ([]byte, error)
		want Init(shim.ChaincodeStubInterface) peer.Response
root@peer0:~# 

How can I solve this problem? Thanks a lot.

关于Merkle 树的零知识证明(zero-knowledge proof)。

零知识证明:例如如何证明某个数据(D0……D3)中包括给定内容 D0,很简单,构造一个默克尔树,公布 N0,N1,N4,Root,D0 拥有者可以很容易检测 D0 存在,但不知道其它内容。

为什么拥有者不直接公布 N0 ,那么,D0拥有者就可以信任对方拥有内容 D0。
因为D0拥有者不知道其他数据,N1, N4, Root 给他没用, 也无法验证正确性啊。


About zero-knowledge proof in Merkle tree.
Why not just use N0 as the proof of owning D0?

English Version Please

I try convert the language to english but seems i loss many nuance and information. So it's hard to understand. could you make the english version? so all people in the whole world can read this guide.

thanks
Gun Gun Febrianza

fabric

您好 请问怎么在fabric中怎么插入自定义model数据

PDF Viewing Bug

Hi Yeasy,

I read your pdf blockchain_guide today. And it's amazing. Thanks for sharing your knowledge about blockchain and this cookbook is quite helpful to construct a overall sight in blockchain.

But there is a problem related to the PDF version. Some of the formula can not present correctly.

For example, in page 57.

多于Fomula的叛变者时有没有可能有解决方案

I have tried build-in PDF reader in Mac Chrome Version 54.0.2840.98 (64-bit) and Mac Adobe Acrobat Reader Version 2015.009.20069.

Hope it can help you.

Thanks

拜占庭问题:为什么会有f个可信节点离线呀?

请问为什么 并且 $$g$$ 个忠诚者中有 $$f$$ 个离线时 ?为什么是f个?
$$f$$ 个叛变者都给出一个恶意的提案,并且 $$g$$ 个忠诚者中有 $$f$$ 个离线时,剩下的 $$g - f$$ 个忠诚者此时无法分别是否混入了叛变者,仍然要确保取多数能得到正确结果,因此,$$g - f > f$$,即 $$g > 2f$$,所以系统整体规模要大于 $$3f$$

Run the network, register the program, Test the URL from SOAP UI - HTTP:\LOCALHOST:7050\

Hi All –
We are trying to implement Blockchain program using one of the sample program (SimpleSample.JAVA) listed out in the below link. We are able to setup the environment to execute the program in Windows10 operating system. But, when we test it from SOAPUI with URL http:\localhost:7050 with HTTP METHOD GET/POST, we get an error saying ‘- ERROR GETTING RESPONSE; ORG.APACHE.HTTP.NOHTTPRESPONSEEXCEPTION: THE TARGET SERVER FAILED TO RESPOND’.

Need your inputs on how this can be rectified to run the Blockchain program? The Blockchain program is successfully registered with the Docker. We got stuck post trying from the URL.

Linked followed for the implementation: https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/index.html

File – SIMPLESAMPLE.JAVA

With Regards,
Senthil R.

Ethereum 的版本发布日期有误

2016 年 3Q,发布 Metropolis;
2017 年 1Q,发布 Serenity,发布区块链的 PoS 股权证明(Casper)版本。

根据coindesk,Metropolis 主网预计在2017年10月初发布,Serenity预计在2018年初上线。

对候选区块生成规则的疑问

章节 1-4 中有这么一段:

客户端发起一项交易后,会广播到网络中并等待确认。网络中的节点会将一些等待确认的交易记录打包在一起(此外还要包括此前区块的哈希值等信息),组成一个候选区块。然后,试图找到一个 nonce 串放到区块里,使得候选区块的 hash 结果满足一定条件(比如小于某个值)。一旦算出来这个区块在格式上就合法了,就可以进行全网广播。

可能是我理解有误,对这里有几点疑问:

  1. 在某个节点“将等待确认的交易记录打包”的时候,不同的节点打包的几个交易记录可能是不一样的?这里我的理解是:比如现在整个网络中有 100 个客户端发起交易广播出来待确认,节点 A 收到 30 个就打包这 30 个组成候选区块,节点 B 收到 40 个就打包那 40 个。谁先计算完,那一批交易就算完成。

  2. 假如某个节点在打包候选区块的时候加入虚假记录(比如把别人的钱转给自己),又首先计算完成进行全网广播,岂不是形成攻击。这个行为是怎么避免的?

evaluation

Hi @yeasy

Could provide what tools you used to evaluate Hyperledger??

I want to reproduce the experiments

Hyperledger Fabric v0.6 性能评测

Fabric在实际场景下部署在哪里?

您好,这个问题困扰我很久,因为像公有链,每个电脑都是一个节点,能够拿到全部账本。

而Fabric又应该怎么部署呢,如果三家企业想做一份儿账本,那么应该由谁来出服务器?其中的peer节点应该部署在哪家企业里?如果每家企业都要部署peer节点,那么endorsing peer和commit peer又应该怎样分配,orderer节点又放在哪里呢?

如果都放在一个地方岂不是中心化的了

Abra是需要收取手续费的,

典型应用场景 -> 金融服务小节里提到:

Abra:区块链数字钱包,无需银行账户和手续费

这句话不太准确,据我所了解,Abra是要收手续费的,拥有当地货币的teller有权决定费率。

peer channel create error

Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'businesschannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group] /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied.

对同一个身份enroll两次

未revoke身份的情况下,对同一个身份enroll两次会有何影响?
1)首次enroll的用户还能正常交互吗?
2)第二次enroll的用户是否合法?

chaincode_example05.go

i run chaincode_example05.go as a example and find some errors.
for example:line 368: err !- nil, it should be err != nil
line 284 getHomeById,this func undefined
is this file on edit or finished?

1.2.7小结文字输入错误:“造价”应为“造假”

原文:
小结
无论如何,区块链确实是第一个试图做公开、中立、匿名化的分布式数据库的系统。它的出
现,让大家意识到除了互联网这样的基础设施外,数据库系统也可以成为公共基础设施。而
且像比特币这样的例子,给与了区块链更多的遐想空间。如果交易**无法造价**,信息**无法造
价**,世界是不是会多了一些算法来保证的公平呢?这是又一次用技术给人类发展带来进步的
福利。

“造价“应为”造假“

错别字更正

第四章,Paxos 算法与 Raft 算法节中,
98行原文:Raft 算法的主要设计**与 ZAB 类型
应该改为:Raft 算法的主要设计**与 ZAB 类似

网络 ID 和链 ID 混淆

如下图红框部分,我觉得解释 chainId 不太准确。

参考:Hyperledger Besu 的解释Ethereum networks have two identifiers, a network ID and a chain ID. Although they often have the same value, they have different uses.

image

请问orderer集群如何配置

您好!
我在看您的《区块链:原理、设计与应用》,10.4.1章节也提到了orderer集群。
但是具体怎么配置呢?
您的例子都是指定一个orderer,请问如何指定多个orderer。
我看有的人说就正常建立多个orderer节点,orderer都是用同一个kafka,
peer channel create -o 任意指定一个orderer就可以,后续kafka会分配给某个orderer处理。
也有人说通过HAProxy反向代理到某个orderer。
您能指点一下吗,不胜感谢。

Register error

您好!我参照您书中的"权限管理"的样例,注册用户时出现如下错误:

curl -i -H "Accept:application/json" -H "Content-Type:application/json" -X POST -d "{"enrollId":"wukai","enrollSecret":"123456"}" 127.0.0.1:5000/registrar
HTTP/1.1 401 Unauthorized
Access-Control-Allow-Headers: accept, content-type
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Wed, 13 Jul 2016 01:08:05 GMT
Content-Length: 91

{"Error": "rpc error: code = 2 desc = 'Identity lookup error: sql: no rows in result set'"}root@vp2:/#

能帮忙解决吗,谢谢!

Fabric 1.0 client APP 疑問

您好:
想請問你個基本的問題
目前我把自己的 fabric 環境建立好,chaincode 也已經部屬完畢
現在我需要部屬一個 client 端的 APP (Nodejs)
但我疑惑在這
因為官方提供的 Application 的範例中,有個 cred 資料夾
裡面放了 其中一個節點的私鑰跟公鑰,這看起來是為了這個範例所產生出來的
這個看起來似乎是必要的?
還是說 如果有架設好 fabric-ca 就不需要這個公私鑰?
(以上問題可能是我理解錯誤)

English version

I have been following this repo for sometime now.

I have to copy things to Google translate per page and then figure things out.
Will it be possible to put forth an English version {using auto translate itself}.
Will become much easier to read. If you know a way and I can help, do let me know.

Thanks!
P

错别字更正

gitbook第108页非对称加密算法中,椭圆曲线算法第一句,应用最广也是强度最(高)的系列算法

Fabric1.0并发情况下报错的问题

版主好,我使用Fabric1.0,并用官方提供的资产转移的示例,在并发测试时报异常,异常信息如下:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.hyperledger.fabric.sdk.exception.TransactionEventException:
Received invalid transaction event. Transaction ID 908eb057a2ccaefacf39ee95ba4c9c15e4a4173ca0877bd4f3d32ac8b71e6f09 status 11
状态码:11,的定义如下:

image

感觉是并发读冲突了。。这个问题您之前在做性能测试时有遇到过吗?如何解决的?

Fabric1.0的性能情况

版主好,本人详细阅读了blockchain_guide.pdf的相关内容,对于Fabric性能这块有些疑问。性能与评测一章中提到Fabric0.6版本的单客户端连接情况下,tps 基本在 190 ~ 300 范围内。那Fabric1.0版本您测试过吗?大体性能是多少?前几天Fabric1.0已经释放了,我在本机测试了一下性能,invoke操作的tps数只有20左右,而且1000并发下,后台还会报一些错误。这个跟Fabric0.6的性能测试结果差距很大,不解是什么原因?另外,Fabric1.0中有batch操作的API吗?

questions on proto

At repo hyperledger/fabric-protos, transactions are defined simply as:

message Transaction {

    // The payload is an array of TransactionAction. An array is necessary to
    // accommodate multiple actions per transaction
    repeated TransactionAction actions = 1;
}

while [at book] (https://github.com/yeasy/blockchain_guide/blob/master/fabric_design/design.md), transactions are much more complex:

message Transaction {
    enum Type {
        UNDEFINED = 0;
        // deploy a chaincode to the network and call `Init` function
        CHAINCODE_DEPLOY = 1;
        // call a chaincode `Invoke` function as a transaction
        CHAINCODE_INVOKE = 2;
        // call a chaincode `query` function
        CHAINCODE_QUERY = 3;
        // terminate a chaincode; not implemented yet
        CHAINCODE_TERMINATE = 4;
    }
    Type type = 1;
    //store ChaincodeID as bytes so its encrypted value can be stored
    bytes chaincodeID = 2;
    bytes payload = 3;
    bytes metadata = 4;
    string uuid = 5;
    google.protobuf.Timestamp timestamp = 6;

    ConfidentialityLevel confidentialityLevel = 7;
    string confidentialityProtocolVersion = 8;
    bytes nonce = 9;

    bytes toValidators = 10;
    bytes cert = 11;
    bytes signature = 12;
}

Just wonder if it is caused by version update or is the book trying to give the whole picture on this?

Besides, later in the section, it says World State is stored as a merkely tree but I could not find the source on fabric documentation, could you point me to the source of the writing?

Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.