Hyperledger Fabric v1.4(LTS) 系列(3.1) -关键概念

译文目录:

Hyperledger Fabric v1.4(LTS) 系列译文总目录

Key Concepts

  • Introduction
  • Hyperledger Fabric Functionalities
  • Hyperledger Fabric Model
  • Blockchain network
  • Identity
  • Membership
  • Peers
  • Smart Contracts and Chaincode
  • Ledger
  • The Ordering Service
  • Private data
  • Use Cases

Introduction

Hyperledger Fabric is a platform for distributed ledger solutions underpinned by a modular architecture delivering high degrees of confidentiality, resiliency, flexibility, and scalability. It is designed to support pluggable implementations of different components and accommodate the complexity and intricacies that exist across the economic ecosystem.

Hyperledger Fabric是一个分布式账本解决方案平台,由模块化架构支撑,具备高度机密性、弹性、灵活性和可扩展性。它设计为支持可插拔不同组件的实现,并适应经济生态中存在的复杂性和多样性。

We recommend first-time users begin by going through the rest of the introduction below in order to gain familiarity with how blockchains work and with the specific features and components of Hyperledger Fabric.

为了熟悉区块链的工作方式以及Hyperledger Fabric 的特征和组件,我们建议首次使用的用户从简介以下的内容开始。

Once comfortable — or if you’re already familiar with blockchain and Hyperledger Fabric — go to Getting Started and from there explore the demos, technical specifications, APIs, etc.

如果没难度—或者如果你已经熟悉区块链和Hyperledger Fabric—可以跳转到入门,然后从那里查看示例、技术规范、API等。

What is a Blockchain?

A Distributed Ledger

At the heart of a blockchain network is a distributed ledger that records all the transactions that take place on the network.

A blockchain ledger is often described as decentralized because it is replicated across many network participants, each of whom collaborate in its maintenance. We’ll see that decentralization and collaboration are powerful attributes that mirror the way businesses exchange goods and services in the real world.

区块链网络的核心是一个分布式账本,记录网络上发生的所有交易。

区块链分类账通常被描述为去中心化,因为它在众多网络参与者间复制,每个参与者在维护中协作。我们可以看到,去中心化和协作这些重要属性呈现的是企业在现实世界中交换商品和服务的方式。

decentralized and collaborate in the real world

In addition to being decentralized and collaborative, the information recorded to a blockchain is append-only, using cryptographic techniques that guarantee that once a transaction has been added to the ledger it cannot be modified. This property of “immutability” makes it simple to determine the provenance of information because participants can be sure information has not been changed after the fact. It’s why blockchains are sometimes described as systems of proof.

除了去中心化和协作,记录到区块链的信息只可追加,通过加密技术确保一旦交易被添加到分类账中,它就不能被修改。“不可变”的属性使确认信息来源变得简单,因为参与者可以确保信息在实际发生后没有被更改。这就是为什么区块链有时被描述为证明系统

译注:
1.append-only 的意思是,不能像传统的文件或者RDBMS一样,文件内容和数据是可以在添加了以后被修改或删除的,即可以进行CRUD四类操作,而区块链只有C,追加也可以视为是把剩余部分当做新的一部分创建的。
2.这里的加密技术,指的即为
Hyperledger Fabric v1.4(LTS) 系列(2) - 简介
中开篇部分介绍的内容,每个区块,都把对上一个区块摘要内容和本区块打包的内容再进行哈希,最后构成了以默克树为核心的区块链结构。

Smart Contracts

To support the consistent update of information — and to enable a whole host of ledger functions (transacting, querying, etc) — a blockchain network uses smart contracts to provide controlled access to the ledger.

为了支持信息的更新一致性,并实现完整的分类账功能(交易、查询等)— 区块链网络使用智能合约提供对分类账的受控访问。

Smart Contracts

Smart contracts are not only a key mechanism for encapsulating information and keeping it simple across the network, they can also be written to allow participants to execute certain aspects of transactions automatically.

A smart contract can, for example, be written to stipulate the cost of shipping an item where the shipping charge changes depending on how quickly the item arrives. With the terms agreed to by both parties and written to the ledger, the appropriate funds change hands automatically when the item is received.

智能合约不仅是封装信息并使其在整个网络中保持简单的关键机制,还可以让参与者自动执行事务的某些方面。

例如,智能合约可以规定航运物品的费用,其中航运成本根据物品到达的快慢变化。双方同意该条款并写入分类账后,就实现了收到物品的同时相应的资金自动换手。

Consensus

The process of keeping the ledger transactions synchronized across the network — to ensure that ledgers update only when transactions are approved by the appropriate participants, and that when ledgers do update, they update with the same transactions in the same order — is called consensus.

使分类账交易在整个网络中保持同步的过程称为共识,它确保分类账仅在适当的参与者认同交易时更新,并且当分类账更新时,参与者以相同的顺序更新相同的交易。

共识

You’ll learn a lot more about ledgers, smart contracts and consensus later. For now, it’s enough to think of a blockchain as a shared, replicated transaction system which is updated via smart contracts and kept consistently synchronized through a collaborative process called consensus.

稍后您将更多了解分类账、智能合约和共识。现在,把区块链看作一个共享的、被复制的交易系统就可以了,它通过智能合约进行更新,并通过称为共识的协作过程保持一致的同步。

Why is a Blockchain useful?

Today’s Systems of Record

The transactional networks of today are little more than slightly updated versions of networks that have existed since business records have been kept. The members of a business network transact with each other, but they maintain separate records of their transactions. And the things they’re transacting — whether it’s Flemish tapestries in the 16th century or the securities of today — must have their provenance established each time they’re sold to ensure that the business selling an item possesses a chain of title verifying their ownership of it.

What you’re left with is a business network that looks like this:

今天的事务性网络是对开始业务记录以来存在的网络的小更新。business network的成员互相交易,但独立维护交易记录。他们交易的东西—无论是16世纪的佛兰芒挂毯还是今天的证券—必须在每次出售时都进行溯源证明以确保出售物品的企业拥有所有权。

于是你得到这样一个商业网络:

Current Business Network

Modern technology has taken this process from stone tablets and paper folders to hard drives and cloud platforms, but the underlying structure is the same. Unified systems for managing the identity of network participants do not exist, establishing provenance is so laborious it takes days to clear securities transactions (the world volume of which is numbered in the many trillions of dollars), contracts must be signed and executed manually, and every database in the system contains unique information and therefore represents a single point of failure.

It’s impossible with today’s fractured approach to information and process sharing to build a system of record that spans a business network, even though the needs of visibility and trust are clear.

现代技术已经将这一过程从石版和纸质文件夹转变为硬盘和云平台,但底层结构是相同的。管理网络参与者身份的统一系统不存在,溯源非常困难,证券交易的清算需要数天时间(全球交易量以万亿美元计),合同必须手工签署和执行,系统中的每个数据库都包含唯一的信息。因此带来了单点故障。

当今分散的信息和流程共享方法不可能构建跨越业务网络的记录系统,即使可见性和信任的需求如此明确。

The Blockchain Difference

What if, instead of the rat’s nest of inefficiencies represented by the “modern” system of transactions, business networks had standard methods for establishing identity on the network, executing transactions, and storing data? What if establishing the provenance of an asset could be determined by looking through a list of transactions that, once written, cannot be changed, and can therefore be trusted?

That business network would look more like this:

如果商业网络中用一种在网络上建立身份、执行交易和存储数据的标准方法取代“现代”交易系统所代表的低效率,如果可以通过查看一系列只能写入不能修改因而可信的交易来确定资产的出处,商业网络会变成什么样?

这个商业网络看起来更像这样:

Blockchained business network

This is a blockchain network, wherein every participant has their own replicated copy of the ledger. In addition to ledger information being shared, the processes which update the ledger are also shared. Unlike today’s systems, where a participant’s private programs are used to update their private ledgers, a blockchain system has shared programs to update shared ledgers.

With the ability to coordinate their business network through a shared ledger, blockchain networks can reduce the time, cost, and risk associated with private information and processing while improving trust and visibility.

You now know what blockchain is and why it’s useful. There are a lot of other details that are important, but they all relate to these fundamental ideas of the sharing of information and processes.

这是一个区块链网络,每个参与者都有自己的分类账副本。除了分类帐信息外,更新分类帐的过程也是共享的。与今天的系统不同,参与者的私有程序被用来更新他们的私有分类账,区块链系统有共享程序来更新共享分类账。

区块链网络具有通过共享分类账协调其业务网络的能力,它可以减少因信息私有和提升信任和可见度过程相关的时间、成本和风险。

你现在知道什么是区块链,为什么它有用。还有许多其他重要的细节,但它们都与共享信息和过程这个基本思路有关。

What is Hyperledger Fabric?

The Linux Foundation founded the Hyperledger project in 2015 to advance cross-industry blockchain technologies. Rather than declaring a single blockchain standard, it encourages a collaborative approach to developing blockchain technologies via a community process, with intellectual property rights that encourage open development and the adoption of key standards over time.

Hyperledger Fabric is one of the blockchain projects within Hyperledger. Like other blockchain technologies, it has a ledger, uses smart contracts, and is a system by which participants manage their transactions.

Linux基金会在2015成立了Hyperledger项目,以推动跨行业的区块链技术。不同于单单发布一个区块链标准,它鼓励按社区流程以协作方式研发区块链技术,通过知识产权鼓励开源研发和关键标准的采纳。

Hyperledger Fabric是Hyperledger中的区块链项目之一。与其他区块链技术一样,它有一个分类账,使用智能合约,是一个参与者管理交易的系统。

Where Hyperledger Fabric breaks from some other blockchain systems is that it is private and permissioned. Rather than an open permissionless system that allows unknown identities to participate in the network (requiring protocols like “proof of work” to validate transactions and secure the network), the members of a Hyperledger Fabric network enroll through a trusted Membership Service Provider (MSP).

Hyperledger Fabric also offers several pluggable options. Ledger data can be stored in multiple formats, consensus mechanisms can be swapped in and out, and different MSPs are supported.

Hyperledger Fabric also offers the ability to create channels, allowing a group of participants to create a separate ledger of transactions. This is an especially important option for networks where some participants might be competitors and not want every transaction they make — a special price they’re offering to some participants and not others, for example — known to every participant. If two participants form a channel, then those participants — and no others — have copies of the ledger for that channel.

Hyperledger结构与其他区块链系统的区别在于它是私有准入制的。Hyperledger Fabric网络的成员通过受信任的**成员服务提供商(MSP)**注册,而不是允许未知身份参与网络的开放式非准入系统(需要“PoW”等协议来验证事务和保护网络)。

Hyperledger Fabric还提供了几种可插拔选项。分类账数据可以多种格式存储,共识机制可以换入换出,支持不同的MSP。

Hyperledger Fabric还提供创建通道的功能,允许一组参与者创建分离的交易分类账。对于网络来说,这是一个特别重要的选择,其中一些参与者可能是竞争对手,不希望他们所做的每一笔交易让每个参与者都知道,例如他们会给某些参与者而不是其他参与者一个特别价格。如果两个参与者组成一个通道,那么这些参与者而不是其他人就拥有该通道的分类账副本。

Shared Ledger

Hyperledger Fabric has a ledger subsystem comprising two components: the world state and the transaction log. Each participant has a copy of the ledger to every Hyperledger Fabric network they belong to.

The world state component describes the state of the ledger at a given point in time. It’s the database of the ledger. The transaction log component records all transactions which have resulted in the current value of the world state; it’s the update history for the world state. The ledger, then, is a combination of the world state database and the transaction log history.

The ledger has a replaceable data store for the world state. By default, this is a LevelDB key-value store database. The transaction log does not need to be pluggable. It simply records the before and after values of the ledger database being used by the blockchain network.

Hyperledger Fabric的分类账子系统由两个组件组成:世界状态事务日志。每个参与者都有一个分类账副本,将其复制到他们所属的每个Hyperledger Fabric网络。

世界状态组件描述了在给定时间点的分类帐状态。这是分类帐的数据库。事务日志组件记录了导致当前世界状态值的所有事务;它是世界状态的更新历史记录,由此可见,分类帐是世界状态数据库和事务日志历史的组合。

分类帐的世界状态数据存储方式是可更换的,默认是LevelDB KV数据库。事务日志不需要是可插入的。它只记录区块链网络使用的分类账数据库的前后值。

Smart Contracts

Hyperledger Fabric smart contracts are written in chaincode and are invoked by an application external to the blockchain when that application needs to interact with the ledger. In most cases, chaincode interacts only with the database component of the ledger, the world state (querying it, for example), and not the transaction log.

Chaincode can be implemented in several programming languages. Currently, Go and Node are supported.

Hyperledger Fabric智能合约以链码编写,区块链外部的应用程序通过调用智能合约来与账本交互。多数情况下,chaincode只与分类账的数据库组件、世界状态(如查询)交互,而不与事务日志交互。

链码可以用多种编程语言实现。目前支持Go和Node。

Privacy

Depending on the needs of a network, participants in a Business-to-Business (B2B) network might be extremely sensitive about how much information they share. For other networks, privacy will not be a top concern.

Hyperledger Fabric supports networks where privacy (using channels) is a key operational requirement as well as networks that are comparatively open.

根据网络的需要,B2B网络的参与者可能对他们共享了哪些信息非常敏感。对于其他网络来说,隐私并不是首要问题。

Hyperledger结构支持以隐私为关键操作要求的网络(通过使用通道),以及相对开放的网络。

Consensus

Transactions must be written to the ledger in the order in which they occur, even though they might be between different sets of participants within the network. For this to happen, the order of transactions must be established and a method for rejecting bad transactions that have been inserted into the ledger in error (or maliciously) must be put into place.

This is a thoroughly researched area of computer science, and there are many ways to achieve it, each with different trade-offs. For example, PBFT (Practical Byzantine Fault Tolerance) can provide a mechanism for file replicas to communicate with each other to keep each copy consistent, even in the event of corruption. Alternatively, in Bitcoin, ordering happens through a process called mining where competing computers race to solve a cryptographic puzzle which defines the order that all processes subsequently build upon.

交易必须按照它们发生的顺序写入分类帐,即使它们可能在网络中的不同参与者组之间。要做到这一点,必须确定交易顺序,并制定拒绝错误(或恶意)插入分类账的不良交易的方法。

这是一个被深入研究的计算机科学领域,有很多实现方法,每个方法都有不同的利弊。例如,PBFT(实用拜占庭容错)可以提供一种机制,使文件副本间能够相互通信以保持其一致性,即使发生损坏。或者,在比特币中,排序是通过挖矿的过程进行的,在这个过程中,计算机间争相解决一个密码难题,该难题定义了所有过程随后建立的顺序。

译注:
这里对比特币的排序方法解释的不够清楚。实际是每个节点都会收到通过广播而来的交易,但每个节点收到的各交易顺序可能是不一样的,交易的总量往往也不同,甚至交易本身可能也不同。但每个节点都按照自己收到的交易,按照上一个块形成时指定的间隔时间,去计算下一个块,如果一个节点最早计算出了下一个快,而且被51%的节点认可,那大家都认可这个节点所打包的这个块中包含的交易,以及其中交易的顺序。

Hyperledger Fabric has been designed to allow network starters to choose a consensus mechanism that best represents the relationships that exist between participants. As with privacy, there is a spectrum of needs; from networks that are highly structured in their relationships to those that are more peer-to-peer.

We’ll learn more about the Hyperledger Fabric consensus mechanisms, which currently include SOLO and Kafka.

Hyperledger Fabric 的设计允许网络初学者选择最能代表参与者之间存在关系的共识机制。与隐私一样,这方面存在一系列的需求,如从高度组织化关系的网络到更为对等的网络。

我们将进一步了解Hyperledger Fabric的共识机制,目前包括SOLO和Kafka。

Where can I learn more?

A conceptual doc that will take you through the critical role identities play in a Fabric network (using an established PKI structure and x.509 certificates).
带您了解结构网络中的关键角色标识(使用已建立的PKI结构和X.509证书)的概念文档。

Talks through the role of a Membership Service Provider (MSP), which converts identities into roles in a Fabric network.
讨论成员服务提供者(MSP)的角色,MSP将参与者的身份转换为Fabric网络中的角色。

  • Peers (conceptual documentation)

Peers — owned by organizations — host the ledger and smart contracts and make up the physical structure of a Fabric network.
由组织拥有的节点支撑了分类帐和智能合约,并组成结构网络的物理结构。

Learn how to download Fabric binaries and bootstrap your own sample network with a sample script. Then tear down the network and learn how it was constructed one step at a time.
了解如何下载Fabric二进制文件并使用示例脚本启动您自己的示例网络。然后干掉它,学习如何一步一步构建它。

Deploys a very simple network — even simpler than Build Your First Network — to use with a simple smart contract and application.
部署一个极简网络-甚至比构建您的第一个网络更简单-与一个简单的智能合约和应用程序一起使用。

*Transaction Flow

A high level look at a sample transaction flow.
从高层次查看示例事务流。

A high level look at some of components and concepts brought up in this introduction as well as a few others and describes how they work together in a sample transaction flow.
从高层次上看一下本介绍中提出的及其他一些组件和概念,并描述它们如何在示例事务流中一起工作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值