区块链运作机制_什么是区块链及其运作方式?

区块链运作机制

If you're interested in technology, there's a good chance you’ve probably heard the terms Bitcoin, Crypto, Ethereum, or even "distributed, decentralized ledgers."

如果您对技术感兴趣,那么您很有可能已经听说过比特币,加密货币,以太坊,甚至“分布式,分散式分类帐”。

You’ve probably heard people talk about cryptocurrency and encryption algorithms, about the end of "intermediaries" and so on.

您可能已经听说过人们谈论加密货币和加密算法,有关“中介”的结尾等等。

It's easy to assume that cryptocurrency (eg: Bitcoin, Ripple, Ethereum, Litecoin, etc.) are the same as blockchain. They're not.

很容易假设加密货币(例如:比特币,Ripple,以太坊,Litecoin等)与区块链相同。 他们不是。

Cryptocurrencies are a clever application of a much cleverer technology – the Blockchain.

加密货币是更聪明的技术- 区块链的聪明应用。

In this post, I will cover some of the basic concepts of the blockchain so you understand what it is, how it must be conceptualized, and what can be built on top of it.

在本文中,我将介绍区块链的一些基本概念,以便您了解区块链的含义,如何将其概念化以及可以在其之上构建的内容。

But as with all things, they make more sense if you understand why they were invented, before you get into what they do. That context will help you grasp what problem the blockchain was designed to solve.

但是,与所有事物一样,如果您在了解它们的用途之前了解它们被发明的原因 ,它们就更有意义。 该上下文将帮助您掌握区块链旨在解决的问题。

为什么要使用区块链? (Why use blockchain?)

Great question. So glad you asked. Let's sit back and do a small thought experiment.

好问题。 很高兴你问。 让我们坐下来做一个小小的思想实验。

What happens if you and your best friend independently and separately conduct the same petition campaign? Let’s say it’s for the “Free the Hamsters” cause.

如果你和独立和分开你最好的朋友进行同样的请愿运动,会发生什么? 假设这是出于“释放仓鼠”的原因。

Let's say you conduct it in an identical sequence across the same suburb, but come up with different sets of signatures on the petition. Which version of the signed petition is the “source of truth”?

假设您在同一郊区以相同的顺序进行操作,但在请愿书上提出了不同的签名集。 签署的请愿书的哪个版本是“真理的来源”?

You would need to trace back your separate trails, one signature at a time, to locate the last discrepancy. And then you'd have to work further back to identify the first result that diverged between your signature sheets. Prior to that root divergence, all other signatures on the two lists should match up.

您需要追溯单独的踪迹,一次签名一个,以找到最后一个差异。 然后,您必须进一步进行工作,以找出在签名表之间出现分歧的第一个结果。 在该根差异之前,两个列表上的所有其他签名都应匹配。

You then know that prior to that divergence. Both lists are in accord, so those signatures represent the minimum number of people who signed to support freeing the hamsters.

然后,您会在出现分歧之前知道这一点。 这两个列表是一致的,所以这些签名代表支持释放仓鼠的最少签名人数。

While that may work well for hamsters and small suburban surveys, it doesn’t work so well in the digital world. Or voting, banking, financial transactions, transferring land title, discharging contractual obligations etc. You need independent and “trusted third parties” to verify a chain of events, and solemnly reassure you that the "chain of custody" was unbroken.

尽管这对于仓鼠和郊区的小型调查可能效果很好,但在数字世界中效果并不理想。 或表决,银行业务,金融交易,土地所有权转让,履行合同义务等。您需要独立且“受信任的第三方”来验证一系列事件,并郑重地向您保证“监管链”没有中断。

A "chain of custody" can sometimes also be called the "provenance" – they both mean the same thing:  the sequence of historical events concerning the data in question.

有时也可以将“监管链”称为“出处”-它们都具有相同的含义:有关数据的历史事件序列。

That’s why you have governments having the final say on your identity, and votes need to be physically counted and recounted by hundreds of volunteers, and clerks in dingy offices maintain ledgers and certificates to confirm whether or not you own your farm/white picket-fenced bungalow.  

这就是为什么您要让政府对您的身份拥有最终决定权,并且投票必须由数百名志愿者亲自盘点和重新计算,而肮脏的办公室里的文员则维护着分类帐和证书,以确认您是否拥有自己的农场/白色纠察队员平房。

That is why you need financial intermediaries to ensure that when you buy your collector's item Darth Vader doll, using a credit card, the money (value) is “removed” from your account and “put into” to the seller’s account.

因此,您需要金融中介机构来确保在使用信用卡购买收藏家的商品达斯·维达娃娃时,钱(值)从您的帐户中“删除”并“放入”卖家的帐户中。

This is technically called the “double spending problem” – how do you ensure that you’re not spending the same money twice? Without someone to do this, you could spend money and at the same time continue to hold on to that money.

从技术上讲,这就是“ 双重支出问题 ” –如何确保您不会两次花相同的钱? 没有人这样做,您可以花钱,同时继续保留这笔钱。

So it’s a big problem really – modern life requires that we rely on, trust in and pay for “trusted” third party intermediaries to ensure that value (money) does actually digitally “change hands”. That is why Visa and MasterCard exist, and why PayPal and others link with your bank accounts.

因此,这确实是一个大问题–现代生活要求我们依靠,信任并为“受信任的”第三方中介机构付款,以确保价值(金钱)确实以数字方式“易手”。 这就是为什么存在Visa和MasterCard,以及为什么PayPal和其他链接到您的银行帐户的原因。

At the heart of the blockchain's why is this problem: how do you know a sequence of events has not been tampered with to alter the current state?
区块链的核心问题为何如此:您如何知道一系列事件没有被篡改以更改当前状态?

This is where the blockchain fits in. Clear, so far?

这就是区块链适合的地方。

区块链如何运作 (How Blockchain works)

For the sake of communicating a concept with simplicity, I may take liberties with some of the technical, under-the-hood aspects of this technology. My aim is to get you to understand what it is and have a mental model of how it works. For that, I may need to be a little loose with precision in order to improve the odds of comprehension, especially for non-native English speakers.

为了简单地传达一个概念,我可能会对此技术的某些技术,内在方面有所保留。 我的目的是使您了解它的含义,并对它的工作方式有一个心理模型。 为此,我可能需要稍微放松一点,以提高理解的机率,尤其是对于非英语母语的人。

It is essential to remember that the blockchain is a technology – mathematically complex software code to be specific. And Bitcoin (or Ethereum or any of the other cryptos on offer) are just applications of that technology.

重要的是要记住,区块链是一项技术–具体而言,数学上复杂的软件代码。 比特币(或以太坊或任何其他提供的加密货币)只是该技术的应用。

So the key principles are:

因此,关键原则是:

  • Blockchains are ‘mined” (produced through the expenditure of effort, like in gold mining) by powerful and resource-hungry computers  – called nodes, that are on the same network.

    区块链是由功能强大且耗费资源的计算机(称为节点)“挖掘”(通过花费大量精力,例如在金矿中生产的),这些计算机位于同一网络上。
  • Chains of digitally encrypted and timestamped records of transactions are lumped into “blocks”, which are maintained on a “ledger” by each node. As transactions are added to a block, and blocks are linked together linearly and chronologically as "chains". Then the entire record/ledger gets synchronised across the network of nodes such that all the block "chains" on the nodes should tell an identical story of the history of any given transaction. Thus we get "block + chain = blockchain". It's a long, complicated linked list.

    带有数字加密和时间戳记的交易记录链被合并为“块”,每个节点将这些块维护在“分类帐”中。 随着交易被添加到一个区块,区块被线性地和按时间顺序连接在一起,成为“链”。 然后,整个记录/分类帐将在节点网络之间进行同步,以使节点上的所有区块“链”都应讲述任何给定交易历史的相同故事。 因此,我们得到“区块+链=区块链”。 这是一个漫长而复杂的链表。
  • Each block in a chain has its own id - a cryptographic hash that is unique and specific to each block. That hash is also stored in the next block in the chain, causing a link. A block can store thousands of transactions and the tiniest change in that block's data would result in a new hash. So if a hash changes but the next block has a different hash, then we know some data in the previous block was tampered with.

    链中的每个块都有自己的ID-每个块唯一且特定的加密哈希。 该哈希也存储在链中的下一个块中,从而导致链接。 一个块可以存储数千个事务,并且该块数据中最微小的变化将导致新的哈希。 因此,如果哈希值发生变化,但是下一个块具有不同的哈希值,那么我们知道前一个块中的某些数据已被篡改。

  • As hundreds become thousands of nodes (and more are added all the time), each node has to “agree” on the history of the blocks/ledger – this is called "critical consensus". One of the ways in which consensus is achieved is through the cryptographic hash we talked about earlier.

    当数百个节点变成数千个节点时(一直在增加),每个节点都必须“同意”区块/分类账的历史记录-这称为“关键共识”。 达成共识的一种方式是通过我们前面讨论的加密哈希。
  • Where there are discrepancies in the ledger (for example the hash of a block doesn't match with the next block's reference to the previous block's hash), the ledger with the longest chain of valid transactions embedded will be the “correct” one – the source of truth. Any nodes working on other (shorter versions) of the chain switch to the longer one. This maintains the critical consensus (this bit is hugely oversimplified, but sufficient for now).

    如果分类账中存在差异(例如,某个区块的哈希值与下一个区块对前一个区块的哈希值的引用不匹配),则嵌入有效交易链最长的分类账将是“正确的”分类账–真理之源。 在其他(较短版本)链上工作的任何节点都将切换到较长节点。 这维持了关键的共识(这一点被大大简化了,但目前已经足够了)。
  • Any naughty interception or change to one ledger (again, for example, where a block's hash doesn't tally) would immediately create a discrepancy with all the other versions. It would also have a shorter block “history” to corroborate it, which makes that tampered version a suspicious character in the blockchain network where length matters (ahem).

    任何顽皮的拦截或更改为一个分类帐(例如,再次是某个区块的哈希值不相符的情况),都会立即与所有其他版本产生差异。 它也将具有较短的块“历史”来证实它,这使得该篡改版本在长度很重要的区块链网络中(可恶)成为可疑字符。
  • Replicating that discrepancy across all the versions of the ledger – the entire blockchain network – is such a huge task that it is computationally impractical, and would only happen if the bad guys suddenly had control over the majority of the nodes mining blockchain and changed them all rather rapidly. This sort of coordinated attack on the majority of the nodes on the network is often called the 51% attack.

    复制所有分类账的差异(整个区块链网络)是一项巨大的任务,在计算上是不切实际的,并且只有当坏人突然控制了挖矿区块链的大多数节点并全部更改后,这种情况才会发生相当快。 对网络上大多数节点的这种协同攻击通常称为51%攻击

Interestingly, Satoshi Nakamoto says in the original Bitcoin white paper,

有趣的是,中本聪在原始比特币白皮书中说,

As such, the verification is reliable as long as honest nodes control the network, but is more vulnerable if the network is overpowered by an attacker.”  

这样,只要诚实节点控制网络,验证是可靠的,但是如果网络受到攻击者的压制,则验证将更容易受到攻击。

However, elsewhere he/she/the organisation (we don't know who "Satoshi" is) calmly points out that to modify past transactions in blocks, across the entire network of nodes, would require the attacker to re-do the chain of custody in those blocks, and all the blocks added after that. Then they'd have to run like mad to catch up with, and surpass, the work of nodes that aren’t under the bad guy’s control (so that they can re-write the ledger, so-to-speak).

但是,在他/她/组织的其他地方(我们不知道“ Satoshi”是谁)冷静地指出,要在整个节点网络中按块修改过去的交易,将要求攻击者重新执行在这些区块中保管,然后添加所有区块。 然后,他们不得不疯狂追赶跑,不断超越,是不是坏人的控制节点的工作(使他们能够重新写账,所以来讲话)。

And because of this, the “probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added”.

因此,“ 随着添加后续块,较慢的攻击者追赶的概率呈指数下降 ”。

The sheer programmatic complexity, pace and volume of nodal activities make it hard for counterfeiters/attackers to catch up with, let alone outrun, the new blocks mined constantly.

程序的复杂性,节点活动的速度和数量庞大,使得造假者/攻击者难以赶上(不断增长)不断开采的新区块,更不用说超越了。

That does make sense. It’s like the lie you tell one family member about why you couldn’t attend their kid’s flute recital. And then you have to madly chase everyone else in the family and ensure you’ve told them all the same lie so that when the original person you’ve lied to brings it up, everyone is aware of this lie and plays along. Sounds exhausting.

确实有道理。 就像您向一位家庭成员讲谎言,为什么您不能参加他们孩子的长笛演奏会一样。 然后,您必须疯狂地追逐家庭中的其他所有人,并确保已将他们所有的谎言都告诉了他们,以便当您撒谎的原始人提出这个谎言时,每个人都意识到了这种谎言并一直在玩耍。 听起来很累。

To wrap up, the defining characteristic of a blockchain is that it is a distributed ledger across many, many nodes and it is extremely computationally intensive (expensive) to add nodes to that network.

总结起来,区块链的定义特征是它是跨许多节点的分布式分类帐,并且向该网络添加节点的计算量很大(昂贵)。

Thus each ledger must be "aware" of all the transactions, and must have an agreed version (which will have the longest “chain of custody” behind it) across the entire network to which the next transaction will be added.

因此,每个分类账都必须“意识到”所有交易,并且必须在整个网络中拥有一个同意的版本(该版本背后将拥有最长的“监管链”),下一个交易将被添加到该整个网络中。

As Satoshi Nakamoto declares in the original Bitcoin white paper, “ The only way to confirm the absence of a transaction is to be aware of all transactions.

正如中本聪(Satoshi Nakamoto)在原始比特币白皮书中宣称的那样:“ 确认不存在交易的唯一方法是了解所有交易。

Importantly, the blockchain "dis-intermediates" trust – so we don’t need to pay “trusted third parties” transaction fees for being trustworthy and keeping us, and the counter-parties we deal with, honest. The blockchain programmatically ensures truth (provenance) of the history of transaction in it.

重要的是,区块链“ 消除了中介 ”的信任-因此,我们无需为“可信赖的第三方”而支付“可信赖的第三方”交易费用,以保持我们以及与我们交易的对手的诚实。 区块链以编程方式确保其中交易历史的真实性(来源)。

那么,为什么我们要关心呢? (So why should we care?)

Well, by getting rid of the need for “trusted intermediaries” any intermediary that charges a modest fee for giving us the gift of certainty needs to find a new job. And that impact banks who traditionally offer such assurance services.  

好吧,通过摆脱对“可信中介人”的需求,任何收取适度费用以给我们确定性礼物的中介人都需要找到新工作。 这对传统上提供此类保证服务的银行产生了影响。

It also means that we can program “smart contracts” between promisor and promisee that automatically recognise (digitally) whether that promise has been delivered or not.

这也意味着我们可以在承诺者和被承诺者之间编写“ 智能合约 ”,以自动(数字)识别该承诺是否已交付。

This has enabled a truly tech savvy artist like Imogen Heap to sell her music directly to her listening public, and collect her dues directly from them rather than losing the bulk of earnings to record labels, managers and other “trusted intermediaries”.  

这使像Imogen Heap这样真正精通技术的艺术家能够将音乐直接出售给听众,并直接从他们那里收取应得的税款,而不是将大部分收入损失给唱片公司,经理和其他“受信任的中介”。

It will likely change the way Intellectual Property is protected, accessed, shared, distributed, and developed on the internet.

这很可能会改变知识产权在互联网上受到保护,访问,共享,分发和开发的方式。

It could even mean that Uber’s fleet of drivers transact directly with people who want a ride rather than rely on Uber to coordinate and control the flow of information and money.

这甚至可能意味着,Uber的驾驶员队伍直接与想要乘车的人进行交易,而不是依靠Uber来协调和控制信息和资金流。

It may mean that I could directly send you small amounts of money for virtually no fees (micro-transactions). It could mean that the millions of unbanked people in the world who have smartphones can start to transact well beyond their traditional physical-world boundaries.

这可能意味着我可以直接向您发送少量资金,而几乎不收取任何费用(微交易)。 这可能意味着世界上数百万拥有智能手机的无银行账户的人可以开始超越传统的自然世界范围进行交易。

Wonderfully enough, governments are looking beyond just cryptocurrency when it comes to deploying this technology – to record land ownership, for example.

不足为奇的是,政府在部署此技术时不仅考虑使用加密货币, 例如 记录土地所有权

In effect, we could create a world of true peer-to-peer digital transactions for the transfer of value that is distributed, horizontal, removes the need to rely on trust, and above all requires extraordinary computational power to tamper with. These transactions could be between people, machines and devices.

实际上,我们可以创建一个真正的点对点数字交易世界,以实现水平分布的价值转移,从而消除了对信任的依赖,最重要的是,它需要非凡的计算能力来进行篡改。 这些交易可能发生在人,机器和设备之间。

It could therefore offer a new security paradigm for the protection of data collected by and transferred through the “internet of things”.

因此,它可以为保护“物联网”收集和传输的数据提供一种新的安全范式。

I personally believe that the complexity of the modern world is obscured behind intuitive touchscreens. Blockchain technology will quickly become embedded in our technological universe without us being fully aware of it – just like we have been using yeast recombinant DNA for synthetic insulin production since the 1970s.

我个人认为,直观触摸屏背后掩盖了现代世界的复杂性。 就像我们从1970年代以来就一直在使用酵母重组DNA生产合成胰岛素一样,区块链技术将很快被嵌入我们的技术领域。

The changes and cost savings will be sweepingly referred to as technological changes, like that "interweby thing” or some other vague, all-inclusive phrase.

这种变化和成本节省将被统称为技术变化,例如“网络事物”或其他模糊,包罗万象的短语。

One catch: it'll work as long as we can trust that a "trust-less system" that is coded and engineered by humans (whom we trust?) will further the cause of trust-less-ness in an untrusting and untrustworthy world. You may need to read that sentence several times.

一个陷阱:只要我们可以相信,由人类(我们信任谁?)编码和设计的“无信任系统”将在不信任和不信任的世界中进一步促进不信任的根源。 您可能需要多次阅读该句子。

结语 (Wrapping up)

OK – you should now be reasonably aware of the basics of blockchain. But there is a lot more to learn if you're interested.

好的–您现在应该合理地了解区块链的基础知识。 但是,如果您有兴趣,还有很多东西要学习。

You can debate whether blockchain is useful or over-hyped, revolutionary or boring. But it's hard to ignore that it is pretty cool as a concept.

您可以争论区块链是有用的还是过度炒作的,革命性的还是无聊的。 但是,很难忽略它作为一个概念非常酷。

Here is a really fantastic video by Anders Brownworth that explains the whole thing with a mockup blockchain. I strongly recommend you watch it.

这是安德斯·布朗沃思(Anders Brownworth)制作的一段非常棒的视频,它用一个模型区块链解释了整个过程。 我强烈建议您观看。

And as a learning exercise, you can build your own blockchain right in your browser or your command line. Here's a quick tutorial for how to build your own blockchain.

作为学习练习,您可以直接在浏览器或命令行中构建自己的区块链。 这是有关如何构建自己的区块链的快速教程

If you have any comments about this article or think I could have explained parts of this better, Tweet at me at @ZubinPratap

如果您对本文有任何意见,或者认为我可以更好地解释本文的某些部分,请通过@ZubinPratap在我身上鸣叫

Also, I believe your most precious resources are your time, effort and money. Of these, the single most important resource is time, because the other two can be renewed and recovered. So if you’re going to spend time on something make sure it gets you closer to this goal.

另外,我相信您最宝贵的资源是您的时间,精力和金钱。 其中,最重要的资源是时间,因为其他两个资源可以更新和恢复。 因此,如果您要花时间在某些事情上,请确保它使您更接近此目标。

With that in mind, if you want to invest 3 hours with me to find your shortest path to learning to code (especially if you’re a career changer, like me), then head to my own personal course site and type in "Udemy" in the comment box, and leave your email.

考虑到这一点,如果您想花3个小时与我一起寻找最短的学习编码的途径(尤其是像我这样的职业转变者),那么请前往我自己的个人课程网站,然后输入“ Udemy ”,然后留下您的电子邮件。

Also if you would like to learn more about my journey into code, check out  episode 53 of the  freeCodeCamp podcast, where Quincy (founder of FreeCodeCamp) and I share our experiences as career changers that may help you on your journey. You can also access the podcast on iTunes, Stitcher, and Spotify.

另外,如果您想了解有关我的代码之旅的更多信息,请查看freeCodeCamp播客的 第53集 ,其中Quincy(FreeCodeCamp的创始人)和我分享了我们的职业转变经验,这些经验可能对您的旅程有所帮助。 您还可以在iTunesStitcherSpotify上访问播客。

翻译自: https://www.freecodecamp.org/news/what-is-blockchain-and-how-does-it-work/

区块链运作机制

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值