比特派钱包官网版本下载|ethereum中文翻译

作者: 比特派钱包官网版本下载
2024-03-15 02:31:05

ethereum.org 各国语言翻译 | ethereum.org

reum.org 各国语言翻译 | ethereum.org跳转至主要内容学习用法构建参与研究搜索​​​​语言 ZH帮助更新此页面本页面有新版本,但现在只有英文版。请帮助我们翻译最新版本。翻译页面没有错误!此页面未翻译,因此特意以英文显示。不再显示语言支持以太坊是一个全球性项目,每个人,不论其国籍或语言,都可以访问ethereum.org。我们社区一直在努力使这一愿景成为现实。有兴趣做贡献吗? 了解更多关于我们翻译计划的信息.除了翻译 ethereum.org 的内容外,我们还维护 和管理以多种语言提供的以太坊资源列表.ethereum.org有以下语言版本:language-amአማርኛlanguage-beбеларускі中文(简体)简体中文中文(繁体)繁體中文丹麦语Dansk乌克兰语Українська乌兹别克语O'zbekcha乌尔都语اردو亚美尼亚语հայերեն伊博语Ibo俄语Pусский保加利亚语български克罗地亚语Hrvatski加利西亚语Galego加泰罗尼亚语Català匈牙利语Magyar北印度语हिन्दी印度尼西亚语Bahasa Indonesia古加拉特语ગુજરાતી哈萨克语қазақ土库曼语türkmen土耳其语Türkçe埃纳德语ಕನ್ನಡ塞尔维亚语Српски孟加拉语বাংলা尼日利亚皮钦语Nigerian Pidgin尼泊尔语नेपाली希伯来语עִבְרִית希腊语Ελληνικά德语Deutsch意大利语Italiano挪威语Norsk捷克语Čeština斯洛伐克语Slovenský斯洛文尼亚语Slovenščina斯瓦希里语Kiswahili日语日本語格鲁吉亚语ქართული法语Français波兰语Polski波斯尼亚语босански波斯语فارسی泰米尔语தமிழ்泰语ภาษาไทย瑞典语Svenska立陶宛语Lietuvis罗马尼亚语Română芬兰语Suomi英语English荷兰语Nederlands菲律宾语Filipino葡萄牙语Português葡萄牙语(巴西)Português西班牙语Español越南语Tiếng Việt阿塞拜疆语Azərbaycan阿拉伯语العربية韩语한국어马拉地语मराठी马拉雅拉姆语മലയാളം马来语Melayu高棉语ចក្រភពខ្មែរ想用不同的语言查看ethereum.org吗?ethereum.org的翻译者总是以尽可能多的语言进行翻译。 要看看他们正在做什么或注册加入他们,请阅读我们的 翻译计划.网站最后更新: 2024年2月16日(opens in a new tab)(opens in a new tab)(opens in a new tab)使用以太坊查找钱包获取以太币Dapps - 去中心化应用二层网络运行节点稳定币质押ETH学习学习中心什么是以太坊?什么是以太币 (ETH)?以太坊钱包Gas fees以太坊安全和预防欺诈措施什么是 Web3?智能合约以太坊能源消耗以太坊路线图以太坊改进提案 (Eip)以太坊的历史以太坊白皮书以太坊词汇表以太坊治理区块链桥零知识证明测试中心开发者开始体验相关文档教程通过编码来学习设置本地环境生态系统社区中心以太坊基金会以太坊基金会的博客(opens in a new tab)生态系统支持方案(opens in a new tab)以太坊漏洞悬赏计划生态系统资助计划以太坊品牌资产Devcon(opens in a new tab)企业级应用主网以太坊私密以太坊企业级应用关于ethereum.org关于我们工作机会参与贡献语言支持隐私政策使用条款缓存政策联系我们(opens in a new t

首页 | ethereum.org

ethereum.org跳转至主要内容学习用法构建参与研究搜索​​​​语言 ZH帮助更新此页面本页面有新版本,但现在只有英文版。请帮助我们翻译最新版本。翻译页面没有错误!此页面未翻译,因此特意以英文显示。不再显示Ethereum欢迎来到以太坊以太坊是由社区驱动的技术,为加密货币以太币(ETH)和成千上万的去中心化应用程序提供动力。探索以太坊开始体验ethereum.org 是你进入以太坊世界的门户。这项技术日新月异,因此指南会有所帮助。如果你想深入了解,我们有以下建议。选择钱包你可以通过钱包连接到以太坊并管理资金。获取以太币ETH 是以太坊的货币 – 你可以在应用程序中使用它。使用去中心化应用程序Dapps 是由以太坊提供支持的应用程序。看看你可以做什么。开始构建如果想在以太坊里开始编写代码,我们有文档与教程可供参考,你亦可在开发者门户中查看更多信息。什么是以太坊?以太坊是数字货币、全球支付和应用程序的技术之家。以太坊社区已经创建了蓬勃发展的数字经济,为创造者在线上获取收入开辟了大胆而创新的途径,且不止于此。它面向所有人开放,无论身处何处,只需互联网即可。什么是以太坊?关于数字货币的更多信息更加公平的金融系统今天,数十亿人无法开设银行帐户,还有一些人的支付帐户被封锁。而以太坊的去中心化金融 (DeFi) 系统永不停息,永无歧视。只需有互联网连接,你就可以在世界任何地方汇款、收款、借款、赚取利息甚至流动资金。探索去中心化金融 (DeFi)资产互联网以太坊并非仅限数字货币。你拥有的任何东西都可以采用非同质化代币 (NFT) 来表现、交易和使用。你可以将艺术品代币化,并在每次重新出售时自动获得使用费。或者,你也可以用所有物的代币来贷款。不断开辟新的可能。关于非同质化代币的更多信息开放式网络今天,我们通过放弃对个人数据的控制权来获得“免费”的互联网服务。以太坊服务则默认开放 - 只需要钱包即可。这些应用不仅免费,易于设置,由你掌控,而且无需个人信息。探索开放式网络关于钱包的更多信息代码示例你自己的银行你可以用自己编写的逻辑来建立银行。自己的货币你可以创建代币,并在应用程序之间转账和使用。JavaScript 以太坊钱包你可以使用现有语言与以太坊及其他应用程序进行交互。开放、无需许可的 DNS你可以将现有的服务重构为去中心化的开放应用程序。全新发展领域以太坊及其应用程序具有透明和开源性质。你可以分叉代码并重新使用已由他人建立的功能。如果不想学习新语言,你可以直接使用 JavaScript 和其他现有语言与开源代码进行交互。开发者门户以太坊现状最新的网络统计数据以太币质押总数当前质押的用来保护网络安全的以太币总量。3126万 30d90d今日交易过去 24 小时内,网络成功处理的交易笔数。123.3万 30d90d去中心化金融中锁定的价值(美元)以太坊数字经济及去中心化金融 (DeFi) 应用程序中的资金量。US$1370亿 30d90d节点以太坊由全球数千计志愿者运行,他们被称为节点。7,144 30d90d加入 ethereum.org 社区加入我们的 Discord 服务器(opens in a new tab),与近 4 万名成员一起交流。参加我们每月举行的社区电话会议,获取有关 Ethereum.org 发展的令人兴奋的最新消息和重要生态系统新闻。你将有机会提出问题、分享想法和提供反馈——这是你成为蓬勃发展的以太坊社区一员的绝佳机会。☎️ Ethereum.org Community Call - March 20242024年3月28日 16:00(UTC)Join Discord(opens in a new tab)添加到日历(opens in a new tab)即将召开的电话会议2024年3月21日⚙️ ethereum.org Office Hours [S3E1](opens in a new tab)2024年3月27日 QA session - ethereum.org portal(opens in a new tab)之前的电话会议2024年3月13日 QA session - ethereum.org portal(opens in a new tab)2024年2月28日 QA session - ethereum.org portal(opens in a new tab)2024年2月29日☎️ Ethereum.org Community Call - February 2024(opens in a new tab)2023年11月1日 QA session - ethereum.org portal(opens in a new tab)探索 ethereum.org提升你对网络升级的理解以太坊路线图由相互连接的升级组成,旨在使网络更具可扩展性、安全性和可持续性。企业级以太坊查看以太坊如何开启新业务模式,降低你的成本,并使你的业务经得起未来的考验。以太坊社区以太坊由社区驱动。它由来自不同背景和兴趣的人组成。看看如何加入!为 ethereum.org 贡献力量这个网站是开源的,有数百个社区贡献者。你可以对这个网站上的任何内容提出编辑建议,建议出色的新功能,或者帮助我们排除错误。关于贡献力量的更多信息GitHub(opens in a new tab)网站最后更新: 2024年2月16日(opens in a new tab)(opens in a new tab)(opens in a new tab)使用以太坊查找钱包获取以太币Dapps - 去中心化应用二层网络运行节点稳定币质押ETH学习学习中心什么是以太坊?什么是以太币 (ETH)?以太坊钱包Gas fees以太坊安全和预防欺诈措施什么是 Web3?智能合约以太坊能源消耗以太坊路线图以太坊改进提案 (Eip)以太坊的历史以太坊白皮书以太坊词汇表以太坊治理区块链桥零知识证明测试中心开发者开始体验相关文档教程通过编码来学习设置本地环境生态系统社区中心以太坊基金会以太坊基金会的博客(opens in a new tab)生态系统支持方案(opens in a new tab)以太坊漏洞悬赏计划生态系统资助计划以太坊品牌资产Devcon(opens in a new tab)企业级应用主网以太坊私密以太坊企业级应用关于ethereum.org关于我们工作机会参与贡献语言支持隐私政策使用条款缓存政策联系我们(opens in a new t

什么是以太坊? | ethereum.org

太坊? | ethereum.org跳转至主要内容学习用法构建参与研究搜索​​​​语言 ZH帮助更新此页面本页面有新版本,但现在只有英文版。请帮助我们翻译最新版本。翻译页面没有错误!此页面未翻译,因此特意以英文显示。不再显示什么是以太坊?我们数字未来的基石关于以太坊运作方式、以太坊优势以及全世界数百万人使用以太坊的案例的完整初学者指南。让我们开始吧!概览以太坊是一个由世界各地的计算机组成的网络,遵循一套称为以太坊协议的规则。以太坊网络提供了一个基础,任何人都可以在上面构建和使用社区、应用程序、组织和数字资产。你可以随时随地创建一个以太坊帐户,探索这处应用程序世界,也可以构建自己的应用程序。最重要的创新在于,你不需要信任中心化组织就可以完成这些,因为中心化组织可能会更改规则或限制你访问。请继续阅读以了解更多详情...以太坊能做什么?属于所有人的银行服务现实生活中,并不是每个人都可以获得金融服务。然而只需连接互联网,就能访问以太坊并使用上面的借贷和储蓄产品。开放式网络任何人都可以和以太坊网络交互或者在上面构建应用程序。这样,你就可以管控自己的资产和身份信息,而不是让少数大公司管控。P2P网络在以太坊上,你可以和其他人协作、达成协议并直接传输数字资产。不需要依靠任何中间商。反审查以太坊不受任何政府或公司的管控。去中心化保障你在以太坊上获得付款或使用服务的权力不容他人干涉。商业保障用户有一种安全的、内置保障机制,仅当用户表示同意后,资金才能够转手。同样,开发者可以确信相关规则将不会变化。可组合产品所有应用程序都在同一条区块链上构建,都有一个共享全局状态,这就意味着它们之间可以互为构建基础(类似于乐高积木)。而这也为我们提供了更好的产品和体验,确保没有人能够删除应用程序所依靠的任何工具。什么是区块链?什么是加密货币?区块链是一个交易数据库,在网络上多台电脑之间更新和共享。每次添加一组新交易时,就称其为“区块”,这也是区块链名称的由来。以太坊这样的公开区块链,允许任何人添加数据,但不能删除数据。如果有人想要篡改任何信息或欺骗系统,他们必须在网络中的大多数电脑上操作。这样做工作量巨大!这使得以太坊这类去中心化区块链具备很高的安全性。术语加密货币用来描述通过区块链保证安全的多种同质化数字代币。加密货币始于比特币。比特币可以用于在双方之间转移价值而不必信任中间人。你只需信任比特币代码,而比特币代码是开源的并可以免费获得。比特币和以太币这类资产被称为“加密货币”,原因是用户数据和资产的安全通过加密来保障,而不是信任某个机构或公司诚信行事。以太坊有自己的原生加密货币以太币 (ETH),用于支付网络上的某些活动。以太币在以太坊网络上可以传输给其他用户,也可以兑换其他代币。以太币是特殊的,因为它用来支付在以太坊上构建和运行应用程序及组织所需的计算。我为什么要使用以太坊?如果你想用更具复原力、更加开放和更加可信的方式来进行全球协作、创建组织、构建应用程序和分享价值,以太坊就是你的菜。以太坊是我们大家共同书写的故事,所以来吧,来探索我们能够共同用以太坊创建的那些神奇世界。对于那些由于无法控制的外部力量而不得不处理与其资产的安全性、稳健性或移动性相关的不确定因素的人来说,以太坊也是极有价值的。更便宜、更快捷的跨境支付稳定币是一种新型加密货币,依赖于更稳定的资产作为其价值基础。大多数稳定币都与美元挂钩,因而维持其货币价值。这样一个非常便宜且稳定的全球支付系统应运而生。当前许多稳定币都构建在以太坊网络上。以太坊和稳定币简化了海外汇款流程。在全球范围内转移资金通常只需要几分钟即可完成,相比之下普通银行可能需要几个工作日甚至几周,并且价格只是银行服务的一小部分。此外,进行高额交易不收取额外费用,并且对于汇款地址或原因没有任何限制。在危机时刻提供最快捷的帮助如果你足够幸运,可以在生活的地方享受值得信赖的机构提供的多种银行业务,你可能会认为它们提供的财务自由、安全和稳定是理所当然的。但对于世界各地面临政治压制或经济困难的许多人来说,金融机构可能无法提供他们需要的保护或服务。在委内瑞拉(opens in a new tab)、古巴(opens in a new tab)、阿富汗(opens in a new tab)、尼日利亚(opens in a new tab)、白俄罗斯(opens in a new tab)和乌克兰(opens in a new tab)的居民饱受战乱、经济灾难或民权制裁之苦时,加密货币就成了留住金融机构最快捷、往往也是唯一的选择。1(opens in a new tab) 从这些示例中可以看出,在人们与外界隔绝时,以太坊等加密货币可以让他们不受限制地进入全球经济,此外当地货币由于超级通胀而崩溃时,稳定币可以提供一种保值手段。为创作者赋能仅在 2021 年,艺术家、音乐家、作家和其他创作者就利用以太坊共赚取了约 35 亿美元。这使得以太坊成为最大的全球创作者平台之一,与 Spotify、YouTube 和 Etsy 并驾齐驱。了解更多(opens in a new tab)。赋能玩家近来出现的边玩边赚游戏(玩家确实通过玩游戏获得奖励)正在改变游戏行业。传统上,通常禁止交易或转手游戏资产来换取现钱。这迫使玩家使用通常存在安全风险的黑市网站。区块链游戏支持游戏内经济并以可信赖的方式倡导这类行为。此外,玩家能够将游戏中的代币换成现钱并且因为玩游戏而切实获得激励。2010投资者2014投资者开发者公司当前投资者开发者公司艺术家音乐家作者玩家难民透过数字看以太坊4k+Projects built on Ethereum 96M+Accounts (wallets) with an ETH balance 53.3M+Smart contracts on Ethereum $410BValue secured on Ethereum $3.5BCreator earnings on Ethereum in 2021 123.6万Number of transactions today 谁在运行以太坊?以太坊不受任何特定实体控制。只要有相互连接并按照以太坊协议运行软件并添加到以太坊区块链上的计算机,就有以太坊。其中每台计算机都称为一个节点。节点可由任何人运行,但必须要质押以太币(以太坊的原生代币)才可以参与保护网络的安全。任何拥有32 个以太币的人都可以质押而无需许可。甚至以太坊的源代码也不是由单个实体生成的。任何人都可以建议更改协议并讨论升级。有一些以太坊协议的实现是由独立组织用多种编程语言完成的,它们通常建立在开放的基础上并鼓励来自社区的贡献。运行节点什么是智能合约?智能合约是存在于以太坊区块链上的计算机程序。它们仅在由用户发出的交易触发时执行。智能合约使以太坊在功能方面非常灵活。这些程序充当去中心化软件和组织的构建基块。你是否使用过更改过服务条款的产品?或者删除了你认为有用的功能?一旦智能合约发布到以太坊,只要以太坊存在,它就会一直在线并运行。就连创作者也无法让它离线。由于智能合约是自动化的,它们不会歧视任何用户并且随时可以使用。智能合约的常见示例包括借贷应用程序、去中心化交易所、保险、二次融资、社交网络、非同质化代币 — 基本上囊括你能想到的一切。更多关于智能合约的信息探索去中心化应用程序认识以太坊的加密货币 — 以太币以太坊网络上的许多操作都需要在以太坊的嵌入式计算机(称为以太坊虚拟机)上做一些计算工作。这种计算不是免费的;它用以太坊的原生加密货币以太币 (ETH) 来支付。这意味着你至少需要少量以太币才能使用网络。以太币是一种纯数字货币,你可以立即将它发送给世界上任何角落的任何人。以太币 (ETH) 的供应不受任何政府或公司控制 — 它是去中心化且完全透明的。按照协议,通过一种精确的方式将以太币仅发放给确保网络安全的质押人。什么是以太币?获取以太币以太坊的能源消耗如何?2022 年 9 月 15 日,以太坊经历了合并升级,从工作量证明过渡到权益证明。合并是以太坊规模最大的一次升级,将保护以太坊安全所需的能源消耗减少了 99.95%,同时创建一个更安全、碳成本更低的以太坊网络。以太坊现在成为一种低碳区块链,并且安全性和可扩展性得到增强。更多关于能源消耗的信息合并更新我听说加密货币被充当犯罪活动的工具。这是真的?像任何技术一样,加密货币有时会被滥用。然而,由于所有以太坊交易都发生在开放的区块链上,与传统金融系统中相比,监管机构通常更容易追踪非法活动,可以说,以太坊对于那些宁愿不被发现的人来说吸引力较小。根据欧盟执法合作署暨欧洲刑警组织最近一份报告的主要调查结果称,用于犯罪目的加密货币要远远低于法定货币:“将加密货币用于非法活动似乎只占整个加密货币经济的一小部分,而且似乎比传统金融中涉及的非法资金数量要少。”Europol Spotlight - Cryptocurrencies - Tracing the evolution of criminal finances.pdf(opens in a new tab) EN (1.4 MB)Chainalysis (2021), The 2021 Crypto Crime report(opens in a new tab) EN以太坊与比特币有什么不同?以太坊立足比特币创新之上,于 2015 年启动,两者之间有一些显著不同。两者都允许你使用数字货币,而无需支付服务提供商或银行。但是以太坊是可编程的,所以你还可以在以太坊网络上构建和部署去中心化应用程序。比特币使我们能够互通基本信息,了解我们认为有价值的东西。在没有权威的情况,确定价值就已经很强大了。以太坊则更进一步,不仅可以互通信息,用户还能编写任何常规程序或合约。可以创建和达成共识的合约种类没有限制,因此以太坊网络上时常出现重大创新。比特币只是一个支付网络,而以太坊更像是一个金融服务、游戏、社交网络和其他应用程序的市场。延伸阅读每周以太坊新闻(opens in a new tab) - 每周资讯,报道整个生态系统的重大发展。原子、机构、区块链(opens in a new tab) - 为什么区块链很重要?内核(opens in a new tab) 以太坊的梦想探索以太坊基于以太坊创造一些玩意如果你想尝试进行以太坊相关的开发,请阅读我们的文档,尝试一些教程或者下载开发工具作为开始。开始构建以太坊社区我们的社区成员来自五湖四海,各行各业,他们包括艺术家、加密无政府主义者,世界500强企业,现在,还有你。赶快来看看如何加入吧。我们的社区测试你的以太坊知识Loading...本页面对你有帮助吗?是否网站最后更新: 2024年2月16日(opens in a new tab)(opens in a new tab)(opens in a new tab)使用以太坊查找钱包获取以太币Dapps - 去中心化应用二层网络运行节点稳定币质押ETH学习学习中心什么是以太坊?什么是以太币 (ETH)?以太坊钱包Gas fees以太坊安全和预防欺诈措施什么是 Web3?智能合约以太坊能源消耗以太坊路线图以太坊改进提案 (Eip)以太坊的历史以太坊白皮书以太坊词汇表以太坊治理区块链桥零知识证明测试中心开发者开始体验相关文档教程通过编码来学习设置本地环境生态系统社区中心以太坊基金会以太坊基金会的博客(opens in a new tab)生态系统支持方案(opens in a new tab)以太坊漏洞悬赏计划生态系统资助计划以太坊品牌资产Devcon(opens in a new tab)企业级应用主网以太坊私密以太坊企业级应用关于ethereum.org关于我们工作机会参与贡献语言支持隐私政策使用条款缓存政策联系我们(opens in a new t

Ethereum White Paper 以太坊白皮书(中英对照版) - 知乎

Ethereum White Paper 以太坊白皮书(中英对照版) - 知乎首发于BTC深入浅出切换模式写文章登录/注册Ethereum White Paper 以太坊白皮书(中英对照版)戴新生​南京大学 法律硕士A Next-Generation Smart Contract and Decentralized Application Platform下一代智能合约和去中心化应用平台Satoshi Nakamoto's development of Bitcoin in 2009 has often been hailed as a radical development in money and currency, being the first example of a digital asset which simultaneously has no backing or "intrinsic value" and no centralized issuer or controller. However, another - arguably more important - part of the Bitcoin experiment is the underlying blockchain technology as a tool of distributed consensus, and attention is rapidly starting to shift to this other aspect of Bitcoin. Commonly cited alternative applications of blockchain technology include using on-blockchain digital assets to represent custom currencies and financial instruments ("colored coins"), the ownership of an underlying physical device ("smart property"), non-fungible assets such as domain names ("Namecoin"), as well as more complex applications involving having digital assets being directly controlled by a piece of code implementing arbitrary rules ("smart contracts") or even blockchain-based "decentralized autonomous organizations" (DAOs). What Ethereum intends to provide is a blockchain with a built-in fully fledged Turing-complete programming language that can be used to create "contracts" that can be used to encode arbitrary state transition functions, allowing users to create any of the systems described above, as well as many others that we have not yet imagined, simply by writing up the logic in a few lines of code.2009年中本聪开发出比特币,经常被人们誉为货币的激进式发展,因为比特币是第一个同时没有支持和“内在价值”,也没有集中发行人或控制者的数字资产。然而,比特币实验的另一部分 —— 可以说是更加重要的部分——是作为分布式共识工具的底层区块链技术,关注正在迅速转移到比特币的其他方面。通常被引用的区块链技术的替代应用包括:使用区块链数字资产来表示自定义货币和金融工具(“彩色硬币”),基础物理设备(“智能财产”)的所有权,不可替代资产(如域名币“Namecoin”)以及更复杂的应用程序,其中涉及通过实施任意规则的一段代码(“智能合约”)甚至基于区块链的“分布式自治组织”(DAO)直接控制数字资产。以太坊计划提供的区块链是一种内置的完全成熟的图灵完备的编程语言,可用于创建编码任意状态转换功能的“合同”,允许用户创建上述任何系统,还有其他许多我们还没有想象到的,仅仅通过在几行代码中编写逻辑就可以实现。Table of Contents 目录Introduction to Bitcoin and Existing Concepts 对比特币及现有概念的介绍History 历史Bitcoin As A State Transition System 作为一种状态转换系统的比特币Mining 挖矿Merkle Trees 默克尔树Alternative Blockchain Applications 其他的区块链应用Scripting 脚本Ethereum 以太坊Ethereum Accounts 以太坊账户Messages and Transactions 消息和交易Messages 消息Ethereum State Transition Function 以太坊状态转换功能Code Execution 代码运行Blockchain and Mining 区块链和挖矿Applications 应用Token Systems 代币系统Financial derivatives and Stable-Value Currencies 金融衍生品和价值稳定的货币Identity and Reputation Systems 身份与声望系统Decentralized File Storage 去中心化文件存储Decentralized Autonomous Organizations 去中心化自治组织Further Applications 将来的应用Miscellanea And Concerns 杂集及相关Modified GHOST Implementation 被修改的GHOST实现Fees 费用Computation And Turing-Completeness 计算及图灵完备Currency And Issuance 货币及发行Mining Centralization 挖矿集中Scalability 可扩展性Conclusion 结论Notes and Further Reading 注释及延伸阅读Notes 注释Further Reading 延伸阅读Created by gh-md-toc gh-md-toc 创建Introduction to Bitcoin and Existing Concepts对比特币及现有概念的介绍History 历史The concept of decentralized digital currency, as well as alternative applications like property registries, has been around for decades. The anonymous e-cash protocols of the 1980s and the 1990s, mostly reliant on a cryptographic primitive known as Chaumian blinding, provided a currency with a high degree of privacy, but the protocols largely failed to gain traction because of their reliance on a centralized intermediary. In 1998, Wei Dai's b-money became the first proposal to introduce the idea of creating money through solving computational puzzles as well as decentralized consensus, but the proposal was scant on details as to how decentralized consensus could actually be implemented. In 2005, Hal Finney introduced a concept of "reusable proofs of work", a system which uses ideas from b-money together with Adam Back's computationally difficult Hashcash puzzles to create a concept for a cryptocurrency, but once again fell short of the ideal by relying on trusted computing as a backend. In 2009, a decentralized currency was for the first time implemented in practice by Satoshi Nakamoto, combining established primitives for managing ownership through public key cryptography with a consensus algorithm for keeping track of who owns coins, known as "proof of work".分布式数字货币的概念以及财产登记等替代应用已经存在数十年了。二十世纪八十年代和九十年代的匿名电子现金协议,主要依赖于一种被称为Chaumian blinding的密码原语,它提供了一种高度隐私的货币,但由于其过于依赖一种集中式中介而未能被广泛接受。 1998年, Wei Dai 的B-money成为第一个提出通过解决数学难题和分布式共识来创造货币的提案,但是该提案没有提供关于如何实现分布式共识的细节。 2005年,Hal Finney引入了一种“可重复使用的工作量证明”的概念,该系统使用B-money的想法和Adam Back计算困难的哈希现金难题创造了一个加密货币概念,但由于需要依赖可信的后端计算而再一次没有实现。 2009年,中本聪首次实施了分布式货币,通过公钥密码体制来管理所有权与共识算法追踪谁拥有货币相结合,这一算法称为“工作l量证明”。The mechanism behind proof of work was a breakthrough in the space because it simultaneously solved two problems. First, it provided a simple and moderately effective consensus algorithm, allowing nodes in the network to collectively agree on a set of canonical updates to the state of the Bitcoin ledger. Second, it provided a mechanism for allowing free entry into the consensus process, solving the political problem of deciding who gets to influence the consensus, while simultaneously preventing sybil attacks. It does this by substituting a formal barrier to participation, such as the requirement to be registered as a unique entity on a particular list, with an economic barrier - the weight of a single node in the consensus voting process is directly proportional to the computing power that the node brings. Since then, an alternative approach has been proposed called proof of stake, calculating the weight of a node as being proportional to its currency holdings and not computational resources; the discussion of the relative merits of the two approaches is beyond the scope of this paper but it should be noted that both approaches can be used to serve as the backbone of a cryptocurrency.工作量证明背后的机制是这一领域的的突破,因为它同时解决了两个问题。首先,它提供了一个简单而适度有效的共识算法,允许网络中的节点共同商定对比特币账本状态的一组规范更新。其次,它提供了允许自由进入共识流程的机制,解决了由谁来影响共识的政治问题,同时防止sybil攻击。它通过用经济壁垒来取代正式的参与壁垒,正式的参与壁垒如要求在特定列表上登记为独特的实体,而经济障碍则是 - 共识投票过程中单个节点的权重与该节点带来的计算能力成正比。此后,有人提出了一种替代方法,称为股权证明,它计算一个节点的权重的方式是与其货币持有量成正比,而不是计算资源;对这两种方法相对优点的讨论超出了本文的范围,但应该指出,这两种方法都可以用作加密货币的核心支撑。Bitcoin As A State Transition System作为状态转换系统的比特币From a technical standpoint, the ledger of a cryptocurrency such as Bitcoin can be thought of as a state transition system, where there is a "state" consisting of the ownership status of all existing bitcoins and a "state transition function" that takes a state and a transaction and outputs a new state which is the result. In a standard banking system, for example, the state is a balance sheet, a transaction is a request to move $X from A to B, and the state transition function reduces the value in A's account by $X and increases the value in B's account by $X. If A's account has less than $X in the first place, the state transition function returns an error. Hence, one can formally define:从技术的角度来看,像比特币这样的加密货币账本可以被认为是一种状态转换系统,其中存在一个由所有现有比特币的所有权状态组成的“状态”和一个状态转换功能,它输入一个状态和一个交易,输出一个新状态作为结果。 例如,在标准的银行系统中,状态是资产负债表,交易是将$X从A移动到B的请求,状态转换功能将A的账户中的值减少$X,并增加B帐户的值$X。 如果A的账户首先少于$X,则状态转换函数返回一个错误。 因此,人们可以正式定义:APPLY(S,TX) -> S' or ERRORIn the banking system defined above:在银行系统定义如上(下)APPLY({ Alice: $50, Bob: $50 },"send $20 from Alice to Bob") = { Alice: $30, Bob: $70 }But:但是:APPLY({ Alice: $50, Bob: $50 },"send $70 from Alice to Bob") = ERRORThe "state" in Bitcoin is the collection of all coins (technically, "unspent transaction outputs" or UTXO) that have been minted and not yet spent, with each UTXO having a denomination and an owner (defined by a 20-byte address which is essentially a cryptographic public key[1]). A transaction contains one or more inputs, with each input containing a reference to an existing UTXO and a cryptographic signature produced by the private key associated with the owner's address, and one or more outputs, with each output containing a new UTXO to be added to the state.比特币中的“状态”是已经产生和尚未用完的所有货币(技术上说是“未使用的交易输出”或UTXO)的集合,每个UTXO有一个面额和一个拥有者(由20字节地址定义) 本质上是一个密码公钥(译者注:实际与密码公钥还是有很大差别的,严格说,也该是公钥的两次hash)[1])。 交易包含一个或多个输入,每个输入包含对现有UTXO的引用和由与所有者地址关联的私钥生成的加密签名,以及一个或多个输出,每个输出包含要添加新UTXO到状态中去。The state transition function APPLY(S,TX) -> S' can be defined roughly as follows:状态转换函数 APPLY(S,TX) -> S' 可以粗略的定义如下:For each input in TX: 对每个TX的输入If the referenced UTXO is not in S, return an error. 如果引用的UTXO不在S里面,返回错误If the provided signature does not match the of the UTXO, return an error.如果提供的签名不能被UTXO验证相符,返回错误If the sum of the denominations of all input UTXO is less than the sum of the denominations of all output UTXO, return an error. 如果所有输入的UTXO的面额小于输出的UTXO的面额,返回错误Return S' with all input UTXO removed and all output UTXO added. 返回S’,同时移除所有的输入UTXO,增加输出的UTXO。The first half of the first step prevents transaction senders from spending coins that do not exist, the second half of the first step prevents transaction senders from spending other people's coins, and the second step enforces conservation of value. In order to use this for payment, the protocol is as follows. Suppose Alice wants to send 11.7 BTC to Bob. First, Alice will look for a set of available UTXO that she owns that totals up to at least 11.7 BTC. Realistically, Alice will not be able to get exactly 11.7 BTC; say that the smallest she can get is 6+4+2=12. She then creates a transaction with those three inputs and two outputs. The first output will be 11.7 BTC with Bob's address as its owner, and the second output will be the remaining 0.3 BTC "change", with the owner being Alice herself.第一步的前半部分阻止交易发送人花费不存在的比特币,第一步的第二部分阻止交易送人花费其他人的比特币,同时第二步执行价值守恒。 为了使用这个付款,协议如下。 假设Alice想要将11.7 BTC发送给Bob。 首先,Alice将寻找一套她拥有的可用UTXO,总计至少为11.7 BTC。 实际上,Alice将无法准确获得11.7 BTC; 就说她能得到的接近的组合是6 + 4 + 2 = 12。 然后,她用这三个输入和两个输出创建一个交易。 第一个输出11.7 BTC到Bob所有的的地址,第二个输出将是余下的0.3 BTC“找零”,其拥有者是Alice本人。Mining 挖矿If we had access to a trustworthy centralized service, this system would be trivial to implement; it could simply be coded exactly as described, using a centralized server's hard drive to keep track of the state. However, with Bitcoin we are trying to build a decentralized currency system, so we will need to combine the state transaction system with a consensus system in order to ensure that everyone agrees on the order of transactions. Bitcoin's decentralized consensus process requires nodes in the network to continuously attempt to produce packages of transactions called "blocks". The network is intended to produce roughly one block every ten minutes, with each block containing a timestamp, a nonce, a reference to (ie. hash of) the previous block and a list of all of the transactions that have taken place since the previous block. Over time, this creates a persistent, ever-growing, "blockchain" that constantly updates to represent the latest state of the Bitcoin ledger.如果我们能够获得值得信赖的集中式服务,这个系统将很容易实施; 它可以完全按照描述进行编码,使用中央服务器的硬盘来跟踪状态。 但是,对于比特币,我们正在试图建立一个分布式的货币体系,所以我们需要将状态交易体系与共识体系结合起来,以确保每个人都对交易顺序达成一致。 比特币的分布式共识流程要求网络中的节点不断尝试生成称为“块”的交易包。 网络每10分钟产生一个块,每个块包含一个时间戳,一个随机数,一个前一个块的引用(即散列)和一个自上一次块产生以来发生的所有交易的列表。 随着时间的推移,这会创建一个持续、不断增长的“区块链”,它的不断更新是为了代表最新的比特币账本的状态。The algorithm for checking if a block is valid, expressed in this paradigm, is as follows:用来表达这种模式的,检查一个区块是否合法的算法,如下所示:Check if the previous block referenced by the block exists and is valid. 检查被当期区块引用的前一个区块是否存在和合法。Check that the timestamp of the block is greater than that of the previous block[2] and less than 2 hours into the future 检查当前区块的时间戳大于前一个区块,同时小于未来2小时(译注:应该就是按照当前区块加入的时间计算是否小于2小时)Check that the proof of work on the block is valid. 检查当前区块上的工作量证明是否正确Let S[0] be the state at the end of the previous block. 让S[0]作为前一个区块的末尾的状态。Suppose TX is the block's transaction list with n transactions. For all i in 0...n-1, set S[i+1] = APPLY(S[i],TX[i]) If any application returns an error, exit and return false. 假设 TX 是区块中 n 个交易的交易列表,因为所有的 i 都在 0...n-1 中, 让 S[i+1] = APPLY(S[i],TX[i]) ,如果程序返回错误,则退出并返回失败。Return true, and register S[n] as the state at the end of block. 如果返回正确,纳闷注册 S[n] 作为当前区块末尾的状态。Essentially, each transaction in the block must provide a valid state transition from what was the canonical state before the transaction was executed to some new state. Note that the state is not encoded in the block in any way; it is purely an abstraction to be remembered by the validating node and can only be (securely) computed for any block by starting from the genesis state and sequentially applying every transaction in every block. Additionally, note that the order in which the miner includes transactions into the block matters; if there are two transactions A and B in a block such that B spends a UTXO created by A, then the block will be valid if A comes before B but not otherwise.本质上,块中的每个交易必须提供从事务执行前的规范状态到新状态的有效状态转换。 请注意,状态不以任何方式编码在块中; 状态仅仅是一个被验证节点记住的抽象概念,任何区块的状态,都可以从创始状态开始,按次序加入每个块中的每一笔交易后,被(安全地)计算出来。 此外,请注意矿工处理将交易包含进区块的顺序; 如果块中有两个交易A和B,B花费由A创建的UTXO,如果A在B之前,则该块将是有效的,否则不是。The one validity condition present in the above list that is not found in other systems is the requirement for "proof of work". The precise condition is that the double-SHA256 hash of every block, treated as a 256-bit number, must be less than a dynamically adjusted target, which as of the time of this writing is approximately 2187. The purpose of this is to make block creation computationally "hard", thereby preventing sybil attackers from remaking the entire blockchain in their favor. Because SHA256 is designed to be a completely unpredictable pseudorandom function, the only way to create a valid block is simply trial and error, repeatedly incrementing the nonce and seeing if the new hash matches.在上述列表中出现的,在其他系统没有发现的有效性条件,是对“工作证明”的要求。 确切的条件是,每个区块的双-SHA256散列值(被视为256位数)必须小于一个动态调整的目标,截至本文写作时约为2^187。这样做的目的是为了让创建区块变得“困难”,从而防止sybil攻击者为了私利而重建整个区块链。 因为SHA256被设计为一个完全不可预知的伪随机函数,所以创建一个有效区块的唯一方法是简单的反复尝试,不断增加随机数的值并查看新的哈希值是否匹配。At the current target of ~2187, the network must make an average of ~269 tries before a valid block is found; in general, the target is recalibrated by the network every 2016 blocks so that on average a new block is produced by some node in the network every ten minutes. In order to compensate miners for this computational work, the miner of every block is entitled to include a transaction giving themselves 12.5 BTC out of nowhere. Additionally, if any transaction has a higher total denomination in its inputs than in its outputs, the difference also goes to the miner as a "transaction fee". Incidentally, this is also the only mechanism by which BTC are issued; the genesis state contained no coins at all.如果当前的目标值是在2^187之下,网络发现有效块之前必须平均进行2^69次尝试; 一般而言,网络每产生2016个区块后会重新校准目标值,以保证平均每10分钟由网络中的某个节点产生一个新区块。 为了补偿矿工们的计算工作,每个发现区块的矿工有权包含一笔给自己12.5比特币(不要问哪里来的)的交易进区块(译注:这就是所谓的每个区块里面的第一个交易,coinbase交易,最开始奖励是25个比特币,每4年减半,以太坊白皮书推出时已经第一次减半)。 此外,如果任何交易在其输入总额高于其输出,则差额也作为“交易费”交给矿工。 顺便说一句,这也是BTC发行的唯一机制; 创始状态根本没有比特币。In order to better understand the purpose of mining, let us examine what happens in the event of a malicious attacker. Since Bitcoin's underlying cryptography is known to be secure, the attacker will target the one part of the Bitcoin system that is not protected by cryptography directly: the order of transactions. The attacker's strategy is simple:为了更好地理解挖矿的的目的,让我们来看看在发生恶意攻击时会发生什么。 由于比特币的基础密码学是安全的,因此攻击者将瞄准比特币系统中不受密码学直接保护的部分:交易顺序。 攻击者的策略很简单:Send 100 BTC to a merchant in exchange for some product (preferably a rapid-delivery digital good) 发送比特币给一个商户,交互一些产品(更青睐快速发货的数字产品)Wait for the delivery of the product 等待商品发货Produce another transaction sending the same 100 BTC to himself 创建另一个交易,将刚才的100比特币发送给自己Try to convince the network that his transaction to himself was the one that came first. 试图让网络相信,那笔发送给自己的交易是第一个交易。Once step (1) has taken place, after a few minutes some miner will include the transaction in a block, say block number 270000. After about one hour, five more blocks will have been added to the chain after that block, with each of those blocks indirectly pointing to the transaction and thus "confirming" it. At this point, the merchant will accept the payment as finalized and deliver the product; since we are assuming this is a digital good, delivery is instant. Now, the attacker creates another transaction sending the 100 BTC to himself. If the attacker simply releases it into the wild, the transaction will not be processed; miners will attempt to run APPLY(S,TX) and notice that TXconsumes a UTXO which is no longer in the state. So instead, the attacker creates a "fork" of the blockchain, starting by mining another version of block 270000 pointing to the same block 269999 as a parent but with the new transaction in place of the old one. Because the block data is different, this requires redoing the proof of work. Furthermore, the attacker's new version of block 270000 has a different hash, so the original blocks 270001 to 270005 do not "point" to it; thus, the original chain and the attacker's new chain are completely separate. The rule is that in a fork the longest blockchain is taken to be the truth, and so legitimate miners will work on the 270005 chain while the attacker alone is working on the 270000 chain. In order for the attacker to make his blockchain the longest, he would need to have more computational power than the rest of the network combined in order to catch up (hence, "51% attack").一旦步骤(1)发生,几分钟后某些矿工将把交易包括在一个区块中,例如区块编号270000。大约一个小时后,在该区块之后将再添加五个区块,每个区块都间接地指向那笔交易并如此进行“确认”。此时,商家将接受付款并最终交付产品;因为我们假设这是一个数字商品,交货是即时的。现在,攻击者创建了另一个发送100比特币的交易。如果攻击者只是简单地将交易释放到外面,这个交易将不会被处理;矿工将尝试运行APPLY(S,TX),并注意到TX会消耗一个不在状态的UTXO。因此,攻击者创建区块链的“分支”,首先挖掘另一个版本的区块270000,指向与父区块相同的区块269999,但其中新的交易取代旧的交易。由于区块数据不同,这需要重做工作证明。此外,攻击者的新版区块270000具有不同的散列,因此原始块270001至270005不会“指向”它;因此,原始链和攻击者的新链完全分开。规则是,在一个分支中,最长的区块链被认为是事实,所以合法的矿工将在270005链上工作,而攻击者只能在270000链上工作。攻击者为了使自己的区块链最长,他需要比网络其余部分具有更多的计算能力才能赶上(因此,也叫“51%攻击”)。Merkle Trees 默克尔树Left: it suffices to present only a small number of nodes in a Merkle tree to give a proof of the validity of a branch.左边:在默克尔树中,仅用少量节点就足以证明一个分支的有效性Right: any attempt to change any part of the Merkle tree will eventually lead to an inconsistency somewhere up the chain.右边:任何试图对默克尔树任何部分的改变,都将导致链上某处的不一致。An important scalability feature of Bitcoin is that the block is stored in a multi-level data structure. The "hash" of a block is actually only the hash of the block header, a roughly 200-byte piece of data that contains the timestamp, nonce, previous block hash and the root hash of a data structure called the Merkle tree storing all transactions in the block. A Merkle tree is a type of binary tree, composed of a set of nodes with a large number of leaf nodes at the bottom of the tree containing the underlying data, a set of intermediate nodes where each node is the hash of its two children, and finally a single root node, also formed from the hash of its two children, representing the "top" of the tree. The purpose of the Merkle tree is to allow the data in a block to be delivered piecemeal: a node can download only the header of a block from one source, the small part of the tree relevant to them from another source, and still be assured that all of the data is correct. The reason why this works is that hashes propagate upward: if a malicious user attempts to swap in a fake transaction into the bottom of a Merkle tree, this change will cause a change in the node above, and then a change in the node above that, finally changing the root of the tree and therefore the hash of the block, causing the protocol to register it as a completely different block (almost certainly with an invalid proof of work).比特币的一个重要的可扩展性特征是,区块存储在多层级数据结构中。区块的“散列”实际上只是块头的散列,一个大致200字节的数据块,包含时间戳,随机数,先前区块散列和称为Merkle树的数据结构的根散列,这个Merkle树中存储了所有交易。 Merkle树是一种二叉树,由一组节点组成,其中包含底层数据的树的底部有大量的叶节点,一组中间节点,其中每个节点是其两个子节点的散列,最后是一个单一的根节点,也是由它的两个子节点的散列形成的,代表树的“顶部”。 Merkle树的目的是允许块中的数据零散传递:一个节点可以只从一个源下载块的头部,从另一个源下载与此相关的树的小部分,并且依然可以确信所有数据都是正确的。之所以这样做,是因为哈希会向上传播:如果恶意用户试图将虚假交易替换到Merkle树的底部,则此更改将导致其上的节点发生更改,然后改变的是这个节点上面的节点,最后改变树的根,因此改变区块的散列值,导致协议将它标示为完全不同的块(几乎肯定带有无效的工作量证明)。The Merkle tree protocol is arguably essential to long-term sustainability. A "full node" in the Bitcoin network, one that stores and processes the entirety of every block, takes up about 15 GB of disk space in the Bitcoin network as of April 2014, and is growing by over a gigabyte per month. Currently, this is viable for some desktop computers and not phones, and later on in the future only businesses and hobbyists will be able to participate. A protocol known as "simplified payment verification" (SPV) allows for another class of nodes to exist, called "light nodes", which download the block headers, verify the proof of work on the block headers, and then download only the "branches" associated with transactions that are relevant to them. This allows light nodes to determine with a strong guarantee of security what the status of any Bitcoin transaction, and their current balance, is while downloading only a very small portion of the entire blockchain.Merkle树协议,对于长期可持续性来说可能是必不可少的。 比特币网络中的一个“完整节点”,一个用于存储和处理所有区块整体的网络,截至2014年4月,占用大约15 GB的磁盘空间,并且每月增长超过千兆字节。 目前,这对于一些台式计算机是可行的,但是手机不行,并且以后只有企业和爱好者才能参与。 被称为“简化支付验证”(SPV)的协议允许存在另一类节点,称为“轻节点”,其下载区块头部,验证区块头部的工作量证明,然后仅下载与他们的交易相关联的“分支”。 这使得轻型节点只需下载整个区块链很小的部分,就可以安全的确定任一比特币交易状态和他们的账户余额安全。Alternative Blockchain Applications 其他区块链应用The idea of taking the underlying blockchain idea and applying it to other concepts also has a long history. In 2005, Nick Szabo came out with the concept of "secure property titles with owner authority", a document describing how "new advances in replicated database technology" will allow for a blockchain-based system for storing a registry of who owns what land, creating an elaborate framework including concepts such as homesteading, adverse possession and Georgian land tax. However, there was unfortunately no effective replicated database system available at the time, and so the protocol was never implemented in practice. After 2009, however, once Bitcoin's decentralized consensus was developed a number of alternative applications rapidly began to emerge.将底层区块链想法应用于其他领域的想法早就出现了。 2005年,Nick Szabo提出了“标示所有权的安全产权”概念,一个文件描述了“复制数据库技术的新进展”将会如何允许基于区块链的系统,用来存储谁拥有哪块土地的注册, 并创建一个精心设计的框架,包括诸如家园式,逆权管理和格鲁吉亚地税等概念。 但是,不幸的是,当时没有有效的复制数据库系统,因此该协议在实践中从未得到实施。 然而,2009年之后,当比特币的分布式共识被开发出来后,很多其他的应用迅速涌现。Namecoin - created in 2010, Namecoin is best described as a decentralized name registration database. In decentralized protocols like Tor, Bitcoin and BitMessage, there needs to be some way of identifying accounts so that other people can interact with them, but in all existing solutions the only kind of identifier available is a pseudorandom hash like 1LW79wp5ZBqaHW1jL5TCiBCrhQYtHagUWy. Ideally, one would like to be able to have an account with a name like "george". However, the problem is that if one person can create an account named "george" then someone else can use the same process to register "george" for themselves as well and impersonate them. The only solution is a first-to-file paradigm, where the first registerer succeeds and the second fails - a problem perfectly suited for the Bitcoin consensus protocol. Namecoin is the oldest, and most successful, implementation of a name registration system using such an idea.Namecoin - 2010年创建,Namecoin最好描述为分布式名称注册数据库。 在像Tor,Bitcoin和BitMessage这样的分布式协议中,需要有一些识别帐户的方法,以便其他人可以与它们交互,但是在所有现有的解决方案中,唯一可用的标识符是伪随机哈希,如1LW79wp5ZBqaHW1jL5TCiBCrhQYtHagUWy。 理想情况下,人们希望能够拥有像“乔治”这样的名字。 但问题是,如果一个人可以创建一个名为“乔治”的账户,那么其他人可以使用相同的过程为自己注册“乔治”,并假冒它们。 唯一的解决方案是采用first-to-file模式,第一个注册成功,第二个失败 - 这是一个完全适合比特币共识协议的问题。 使用这种想法实现名称注册系统,Namecoin是最早、也是最成功的一个。Colored coins - the purpose of colored coins is to serve as a protocol to allow people to create their own digital currencies - or, in the important trivial case of a currency with one unit, digital tokens, on the Bitcoin blockchain. In the colored coins protocol, one "issues" a new currency by publicly assigning a color to a specific Bitcoin UTXO, and the protocol recursively defines the color of other UTXO to be the same as the color of the inputs that the transaction creating them spent (some special rules apply in the case of mixed-color inputs). This allows users to maintain wallets containing only UTXO of a specific color and send them around much like regular bitcoins, backtracking through the blockchain to determine the color of any UTXO that they receive.彩色币(Colored coins) - Colored coins的目的是作为一种协议,允许人们在比特币区块链上创建自己的数字货币 - 或者,一个重要琐碎情况下的货币单位,数字代币等。 在彩色币协议中,通过公开地为特定的比特币UTXO分配一种颜色来“发布”新币种,并且该协议递归地将其他UTXO的颜色定义为,与创建该交易花费的输入(UTXO)的颜色相同 (一些特殊的规则适用于混合颜色输入的情况)。 这允许用户维护仅包含特定颜色的UTXO的钱包,并像常规比特币一样使用它们,通过区块链回溯可以确定它们接收的任何UTXO的颜色。Metacoins - the idea behind a metacoin is to have a protocol that lives on top of Bitcoin, using Bitcoin transactions to store metacoin transactions but having a different state transition function, APPLY'. Because the metacoin protocol cannot prevent invalid metacoin transactions from appearing in the Bitcoin blockchain, a rule is added that if APPLY'(S,TX)returns an error, the protocol defaults to APPLY'(S,TX) = S. This provides an easy mechanism for creating an arbitrary cryptocurrency protocol, potentially with advanced features that cannot be implemented inside of Bitcoin itself, but with a very low development cost since the complexities of mining and networking are already handled by the Bitcoin protocol. Metacoins have been used to implement some classes of financial contracts, name registration and decentralized exchange.元币(Metacoins) - metacoin背后的想法是拥有一个生活在比特币之上的协议,使用比特币交易来存储metacoin交易,但具有不同的状态转换函数 APPLY'。 由于元币协议不能防止无效的元币交易出现在比特币区块链中,所以添加一条规则,即如果APPLY'(S,TX)返回错误,则协议默认为APPLY'(S,TX)= S。 由于挖矿和网络的复杂性已经由比特币协议处理,所以创建任意加密货币协议的机制非常简单,可能无法在比特币内部实现高级功能,但其开发成本非常低。 Metacoins已被用于实施一些类别的金融合同,名称注册和分布式交换。Thus, in general, there are two approaches toward building a consensus protocol: building an independent network, and building a protocol on top of Bitcoin. The former approach, while reasonably successful in the case of applications like Namecoin, is difficult to implement; each individual implementation needs to bootstrap an independent blockchain, as well as building and testing all of the necessary state transition and networking code. Additionally, we predict that the set of applications for decentralized consensus technology will follow a power law distribution where the vast majority of applications would be too small to warrant their own blockchain, and we note that there exist large classes of decentralized applications, particularly decentralized autonomous organizations, that need to interact with each other.因此,总的来说,有两种方法可以建立一个共识协议:建立一个独立的网络,或者在比特币之上构建一个协议。 前一种方法虽然在像Namecoin这样的应用程序中相当成功,但很难实现,因为每个单独的应用都需要创建一个独立的区块链,以及构建和测试所有必要的状态转换和网络代码。 此外,我们预测分布式共识技术的应用程序集将遵循幂律分布,绝大多数应用太小而不能保证自己区块链的安全,并且我们注意到存在大量的分布式应用程序,特别是分布式自治组织,需要相互交流。The Bitcoin-based approach, on the other hand, has the flaw that it does not inherit the simplified payment verification features of Bitcoin. SPV works for Bitcoin because it can use blockchain depth as a proxy for validity; at some point, once the ancestors of a transaction go far enough back, it is safe to say that they were legitimately part of the state. Blockchain-based meta-protocols, on the other hand, cannot force the blockchain not to include transactions that are not valid within the context of their own protocols. Hence, a fully secure SPV meta-protocol implementation would need to backward scan all the way to the beginning of the Bitcoin blockchain to determine whether or not certain transactions are valid. Currently, all "light" implementations of Bitcoin-based meta-protocols rely on a trusted server to provide the data, arguably a highly suboptimal result especially when one of the primary purposes of a cryptocurrency is to eliminate the need for trust.另一方面,基于比特币的方法存在缺陷,因为它继承不了比特币的简化支付验证(SPV)功能。 SPV适用于比特币,因为它可以使用区块链深度作为有效性的代理; 在某种程度上,一旦交易的祖先足够回归,可以肯定地说它们是状态的合法组成部分。 另一方面,基于区块链的元协议,不能强制比特币区块链不要包含元协议环境中无效的交易。 因此,完全安全的SPV元协议实现需要一直向后扫描到比特币区块链的开头,以确定某些交易是否有效。 目前,基于比特币的元协议的所有“轻量级”实现依赖于可信服务器来提供数据,可以说这是一个非常不妙的结果,尤其是因为加密货币的主要目的之一,就是要消除对信任的需求。Scripting 脚本Even without any extensions, the Bitcoin protocol actually does facilitate a weak version of a concept of "smart contracts". UTXO in Bitcoin can be owned not just by a public key, but also by a more complicated script expressed in a simple stack-based programming language. In this paradigm, a transaction spending that UTXO must provide data that satisfies the script. Indeed, even the basic public key ownership mechanism is implemented via a script: the script takes an elliptic curve signature as input, verifies it against the transaction and the address that owns the UTXO, and returns 1 if the verification is successful and 0 otherwise. Other, more complicated, scripts exist for various additional use cases. For example, one can construct a script that requires signatures from two out of a given three private keys to validate ("multisig"), a setup useful for corporate accounts, secure savings accounts and some merchant escrow situations. Scripts can also be used to pay bounties for solutions to computational problems, and one can even construct a script that says something like "this Bitcoin UTXO is yours if you can provide an SPV proof that you sent a Dogecoin transaction of this denomination to me", essentially allowing decentralized cross-cryptocurrency exchange.即使没有任何扩展,比特币协议实际上也实现了“智能合约”概念的弱化版本。比特币中的UTXO不仅可以被公钥拥有,还可以被更复杂的脚本来拥有,这一脚本以简单的基于堆栈的编程语言来表达。在这个模式中,花费UTXO的交易必须提供满足脚本的数据。事实上,即使是基本的公钥所有权机制也是通过脚本实现的:脚本以椭圆曲线签名为输入,根据交易和拥有UTXO的地址验证它,如果验证成功则返回1,否则返回0。其他更复杂的脚本存在于各种其他用例中。例如,可以构建一个脚本,该脚本需要来自给定三个私钥中的两个的签名才能验证(多重签名“multisig”),这一设置对于公司帐户,安全储蓄帐户和一些商业托管情况很有用。脚本也可以用来支付解决计算问题的奖励,甚至你可以构建这样的脚本:“如果您可以提供SPV证据证明您已向此发送此币值的狗币(Dogecoin),则此比特币UTXO即属于您” ,本质上,比特币系统允许分布式的跨加密货币间的兑换。However, the scripting language as implemented in Bitcoin has several important limitations:然而,比特币实现的脚本语言存在几处重要的限制:Lack of Turing-completeness - that is to say, while there is a large subset of computation that the Bitcoin scripting language supports, it does not nearly support everything. The main category that is missing is loops. This is done to avoid infinite loops during transaction verification; theoretically it is a surmountable obstacle for script programmers, since any loop can be simulated by simply repeating the underlying code many times with an if statement, but it does lead to scripts that are very space-inefficient. For example, implementing an alternative elliptic curve signature algorithm would likely require 256 repeated multiplication rounds all individually included in the code.缺乏图灵完备性 - 也就是说,尽管比特币脚本语言支持大量计算,但它并不是支持所有计算。 缺少的主要类别是循环(loops)。 这样做是为了避免交易验证期间的无限循环; 从理论上说,这是一个脚本程序员可以克服的障碍,因为任何循环都可以简单地用 if 语句多次重复底层代码来模拟,但它确实会导致脚本在空间利用上的低效。 例如,实施替代椭圆曲线签名算法可能需要256次重复的乘法循环,每一次循环都需单独包含在代码中。Value-blindness - there is no way for a UTXO script to provide fine-grained control over the amount that can be withdrawn. For example, one powerful use case of an oracle contract would be a hedging contract, where A and B put in $1000 worth of BTC and after 30 days the script sends $1000 worth of BTC to A and the rest to B. This would require an oracle to determine the value of 1 BTC in USD, but even then it is a massive improvement in terms of trust and infrastructure requirement over the fully centralized solutions that are available now. However, because UTXO are all-or-nothing, the only way to achieve this is through the very inefficient hack of having many UTXO of varying denominations (eg. one UTXO of 2k for every k up to 30) and having O pick which UTXO to send to A and which to B.价值盲 - UTXO脚本无法对可撤销的金额进行精细化控制。 例如,预言合同的一个强大的用例就是套期保值合同,A和B投入1000美元的BTC,30天后脚本向A发送价值1000美元的BTC,其余的则发给B。 这就需要预言确定1 BTC价值多少美元,但即使如此,它对信任和基础设施要求方面的重大改进已经超过了现在可用的完全集中式解决方案。 然而,由于UTXO全是或全无,实现这一目标的唯一方法,是通过非常低效地分解许多不同面额的UTXO(例如,一个每达到30 的2k的UTXO),并选择哪个UTXO 发送给A和哪个给B。Lack of state - UTXO can either be spent or unspent; there is no opportunity for multi-stage contracts or scripts which keep any other internal state beyond that. This makes it hard to make multi-stage options contracts, decentralized exchange offers or two-stage cryptographic commitment protocols (necessary for secure computational bounties). It also means that UTXO can only be used to build simple, one-off contracts and not more complex "stateful" contracts such as decentralized organizations, and makes meta-protocols difficult to implement. Binary state combined with value-blindness also mean that another important application, withdrawal limits, is impossible.缺乏状态 - UTXO只有用完和没有用两种状态; 多阶段合同或脚本没有机会保持任何其他内部状态。 这使得很难制定多阶段期权合约,分布式交易提议或两阶段密码承诺协议(安全计算奖励所必需的)。 这也意味着UTXO只能用于构建简单的一次性合同,而不能构建像分布式组织那样更复杂的“有状态”合同,并且使元协议难以实施。 二元状态与价值盲相结合还意味着另一个重要的应用——取款限制——不可能实现。Blockchain-blindness - UTXO are blind to blockchain data such as the nonce, the timestamp and previous block hash. This severely limits applications in gambling, and several other categories, by depriving the scripting language of a potentially valuable source of randomness.区块链盲 - UTXO对区块链数据(例如随机数,时间戳和前一个区块哈希)视而不见。 这剥夺了脚本语言来源于随机性的潜在价值,严重限制了赌博和其他几个类别的应用。Thus, we see three approaches to building advanced applications on top of cryptocurrency: building a new blockchain, using scripting on top of Bitcoin, and building a meta-protocol on top of Bitcoin. Building a new blockchain allows for unlimited freedom in building a feature set, but at the cost of development time, bootstrapping effort and security. Using scripting is easy to implement and standardize, but is very limited in its capabilities, and meta-protocols, while easy, suffer from faults in scalability. With Ethereum, we intend to build an alternative framework that provides even larger gains in ease of development as well as even stronger light client properties, while at the same time allowing applications to share an economic environment and blockchain security.综上,我们了解到在加密货币之上构建高级应用程序的三种方法:构建新的区块链,在比特币之上使用脚本,在比特币之上构建元协议。 构建新的区块链,可以在构建功能集时实现无限制的自由,但成本是开发时间,培育努力和安全保障。 使用脚本很容易实现和标准化,但其功能非常有限,而元协议虽然很容易,但在可伸缩性方面遇到问题。 通过以太坊,我们打算构建一个替代框架,在易于开发的同时提供更大的收益,以及更强大的轻客户端属性,同时允许应用程序共享经济环境和区块链安全。Ethereum 以太坊The intent of Ethereum is to create an alternative protocol for building decentralized applications, providing a different set of tradeoffs that we believe will be very useful for a large class of decentralized applications, with particular emphasis on situations where rapid development time, security for small and rarely used applications, and the ability of different applications to very efficiently interact, are important. Ethereum does this by building what is essentially the ultimate abstract foundational layer: a blockchain with a built-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions. A bare-bones version of Namecoin can be written in two lines of code, and other protocols like currencies and reputation systems can be built in under twenty. Smart contracts, cryptographic "boxes" that contain value and only unlock it if certain conditions are met, can also be built on top of the platform, with vastly more power than that offered by Bitcoin scripting because of the added powers of Turing-completeness, value-awareness, blockchain-awareness and state.以太坊的目的是为构建分散式应用程序创建一个替代协议,提供一套不同的折衷方案,我们认为这对于大量分布式应用程序非常有用,特别强调快速开发时间,小型很少使用的应用程序,以及不同应用程序的高效互动能力都很重要。以太坊通过构建本质上最终的抽象基础层来实现这一点:一种内置图灵完整编程语言的区块链,允许任何人编写智能合约和分布式应用程序,在这些应用程序中他们可以为所有权,交易格式和状态转换函数制定自己的规则。 Namecoin的一个简单版本可以用两行代码编写,其他协议,如货币和信誉系统可以在20行以内建立。因为拥有比比特币脚本所提供的功能强大得多的图灵完备性,价值知晓,区块链知晓和状态,所以智能合约,包含价值并且只有在满足特定条件时才解锁的密码“箱子”,都可以建立在平台之上。Ethereum Accounts 以太坊账户In Ethereum, the state is made up of objects called "accounts", with each account having a 20-byte address and state transitions being direct transfers of value and information between accounts. An Ethereum account contains four fields:在以太坊中,状态由称为“帐户”的对象组成,每个帐户都有一个20字节的地址,状态转换是账户之间的价值和信息的直接转移。 以太坊账户包含四个字段:The nonce, a counter used to make sure each transaction can only be processed once 随机数,用于确定每笔交易只能被处理一次的计算器The account's current ether balance 账户当前的以太币余额The account's contract code, if present 账户的合约代码,如果有的话The account's storage (empty by default) 账户的存储(默认为空)"Ether" is the main internal crypto-fuel of Ethereum, and is used to pay transaction fees. In general, there are two types of accounts: externally owned accounts, controlled by private keys, and contract accounts, controlled by their contract code. An externally owned account has no code, and one can send messages from an externally owned account by creating and signing a transaction; in a contract account, every time the contract account receives a message its code activates, allowing it to read and write to internal storage and send other messages or create contracts in turn.“以太”是以太坊的主要内部加密燃料,用于支付交易费用。 一般来说,有两种类型的账户:外部所有的账户,由私钥控制;合同账户由合同代码控制。 外部所有的账户没有代码,人们从外部所有账户发送消息,以创建和签署交易; 在合同账户中,合约账户每次收到消息后,代码激活,将允许对内部存储进行读写和发送其他消息或者依次创建合约。Note that "contracts" in Ethereum should not be seen as something that should be "fulfilled" or "complied with"; rather, they are more like "autonomous agents" that live inside of the Ethereum execution environment, always executing a specific piece of code when "poked" by a message or transaction, and having direct control over their own ether balance and their own key/value store to keep track of persistent variables.请注意,以太坊中的“合约”不应被视为应该被“履行”或“遵守”的事物; 相反,他们更像是居住在以太坊执行环境中的“自主代理人”,当被消息或交易“捅一下”时,总是执行特定的代码段,并直接控制自己的以太余额和自己的密钥/ 值存储,保持对持久变量的跟踪。Messages and Transactions 消息与交易The term "transaction" is used in Ethereum to refer to the signed data package that stores a message to be sent from an externally owned account. Transactions contain:“交易”术语在以太坊中是指被外部所有账户发送的存有消息的经过签署的数据包。交易包含:The recipient of the message 消息接受人A signature identifying the sender 能证明发送者身份的签名The amount of ether to transfer from the sender to the recipient 一定数量的从发送者转移至接受者的以太币An optional data field 一个可选的数据字段A STARTGAS value, representing the maximum number of computational steps the transaction execution is allowed to take STARTGAS值,代表交易被执行时可以运行的最大计算步骤数A GASPRICE value, representing the fee the sender pays per computational step GASPRICE值,代表发送者为每个计算步骤支付的费用。The first three are standard fields expected in any cryptocurrency. The data field has no function by default, but the virtual machine has an opcode using which a contract can access the data; as an example use case, if a contract is functioning as an on-blockchain domain registration service, then it may wish to interpret the data being passed to it as containing two "fields", the first field being a domain to register and the second field being the IP address to register it to. The contract would read these values from the message data and appropriately place them in storage.前三个是任何加密货币中预期的标准字段。 数据字段默认没有功能,但虚拟机具有合同可以访问数据的操作码; 作为示例用例,如果合同作为区块链上的域名注册服务运行,那么它可能希望将传递给它的数据解释为包含两个“字段”,第一个字段是要注册的域名,第二个字段是域名的IP地址。 合同将从消息数据中读取这些值并将其妥善放置在存储中。The STARTGAS and GASPRICE fields are crucial for Ethereum's anti-denial of service model. In order to prevent accidental or hostile infinite loops or other computational wastage in code, each transaction is required to set a limit to how many computational steps of code execution it can use. The fundamental unit of computation is "gas"; usually, a computational step costs 1 gas, but some operations cost higher amounts of gas because they are more computationally expensive, or increase the amount of data that must be stored as part of the state. There is also a fee of 5 gas for every byte in the transaction data. The intent of the fee system is to require an attacker to pay proportionately for every resource that they consume, including computation, bandwidth and storage; hence, any transaction that leads to the network consuming a greater amount of any of these resources must have a gas fee roughly proportional to the increment.对于以太坊的反拒绝服务模式,STARTGAS和GASPRICE字段至关重要。 为了防止代码中的意外或恶意的无限循环,或其他计算浪费,每个事务都需要设置它可以使用多少的代码执行步骤数。 计算的基本单位是“gas”。 通常,一个计算步骤花费1个gas,但是一些操作耗费更高的gas,因为它们在计算上更昂贵,或者增加了作为状态的一部分的必须存储的数据量。 交易数据中的每个字节也要收费5个gas。 收费系统的目的是要求攻击者按比例支付他们消费的每一种资源,包括计算量,带宽和存储量; 因此,任何导致网络消耗更多资源的交易必须具有与增量大致成比例的gas。Messages 消息Contracts have the ability to send "messages" to other contracts. Messages are virtual objects that are never serialized and exist only in the Ethereum execution environment. A message contains:合约具有向其他合约发送“消息”的能力。消息是从没有被序列化的,只存在于以太坊执行环境的虚拟对象。消息包含:The sender of the message (implicit) 消息发送者(固有的)The recipient of the message 消息接受者The amount of ether to transfer alongside the message 与消息一起被转移的以太币的数量An optional data field 可选的数据字段A STARTGAS value STARTGAS值Essentially, a message is like a transaction, except it is produced by a contract and not an external actor. A message is produced when a contract currently executing code executes the CALLopcode, which produces and executes a message. Like a transaction, a message leads to the recipient account running its code. Thus, contracts can have relationships with other contracts in exactly the same way that external actors can.从本质上讲,消息就像一个交易,除了它是由合同产生的而不是由外部参与者产生的之外。 当一个正在运行代码的协议执行CALLopcode时,将会产生和执行一条消息。 就像一个交易,一条消息导致接收人账户运行其代码。 因此,合约可以拥有与其他合约的关系,这与外部参与者之间的方式完全相同。Note that the gas allowance assigned by a transaction or contract applies to the total gas consumed by that transaction and all sub-executions. For example, if an external actor A sends a transaction to B with 1000 gas, and B consumes 600 gas before sending a message to C, and the internal execution of C consumes 300 gas before returning, then B can spend another 100 gas before running out of gas.请注意,交易或合同分配的gas限额适用于该交易和所有子执行消耗的总gas。 例如,如果外部参与者A向B发送带有1000个gas的事交易,B在向C发送消息之前消耗了600个gas,并且C的内部执行在返回之前消耗300个gas,则B在用光gas之前,只可以花费另外100个gas。Ethereum State Transition Function 以太坊状态转换函数The Ethereum state transition function, APPLY(S,TX) -> S' can be defined as follows: 以太坊状态转换函数 APPLY(S,TX) -> S' 定义如下:Check if the transaction is well-formed (ie. has the right number of values), the signature is valid, and the nonce matches the nonce in the sender's account. If not, return an error. 检查交易是否被构建完好(例如,有正确的值),签名是否正确,随机数是否与发送者账户的随机数匹配。如果不是,返回错误。Calculate the transaction fee as STARTGAS * GASPRICE, and determine the sending address from the signature. Subtract the fee from the sender's account balance and increment the sender's nonce. If there is not enough balance to spend, return an error. 通过 STARTGAS * GASPRICE计算出交易费用,确定发生地址来自于签名,从发送者账户减去费用,同时增加发送者的随机数。如果没有足够的余额,返回错误。Initialize GAS = STARTGAS, and take off a certain quantity of gas per byte to pay for the bytes in the transaction. 初始化 GAS = STARTGAS,在交易中支付确定每字节数量的gas。Transfer the transaction value from the sender's account to the receiving account. If the receiving account does not yet exist, create it. If the receiving account is a contract, run the contract's code either to completion or until the execution runs out of gas. 从发送者账户转移交易数额至接受者的账户。如果接受者的账户不存在,创建一个。如果接受者账户是一个合约,运行合约代码要么完成,要么用光了所有的gas。If the value transfer failed because the sender did not have enough money, or the code execution ran out of gas, revert all state changes except the payment of the fees, and add the fees to the miner's account. 如果是因为发送者没有足够的钱而导致转移失败,或者是代码运行用光了gas,除了支付的费用外,恢复所有状态的更改,并将费用支付给矿工的账户。Otherwise, refund the fees for all remaining gas to the sender, and send the fees paid for gas consumed to the miner. 相反的情况,将剩余的费用找零给发送者,支付消耗的费用给矿工。For example, suppose that the contract's code is:例如,假定合约代码如下:if !self.storage[calldataload(0)]:

self.storage[calldataload(0)] = calldataload(32)Note that in reality the contract code is written in the low-level EVM code; this example is written in Serpent, one of our high-level languages, for clarity, and can be compiled down to EVM code. Suppose that the contract's storage starts off empty, and a transaction is sent with 10 ether value, 2000 gas, 0.001 ether gasprice, and 64 bytes of data, with bytes 0-31 representing the number 2and bytes 32-63 representing the string CHARLIE. The process for the state transition function in this case is as follows:请注意,实际上,合约代码是用低级EVM代码编写的; 为了清晰起见,本示例使用Serpent(我们的高级语言之一)编写,并且可以编译为EVM代码。 假设,合约的存储从空开始,交易是发送:10个以太币,2000gas,0.001 gasprice 和 64字节,其中字节0-31代表数字2,字节32-63代表字符串CHARLIE。 在这种情况下状态转换函数进行如下处理:Check that the transaction is valid and well formed. 检查交易是否有效并组织完好Check that the transaction sender has at least 2000 * 0.001 = 2 ether. If it is, then subtract 2 ether from the sender's account. 检查交易发送者至少拥有2000 * 0.001 = 2 个以太币,并从其账户上扣减2个以太币Initialize gas = 2000; assuming the transaction is 170 bytes long and the byte-fee is 5, subtract 850 so that there is 1150 gas left. 初始化 gas = 2000,假定交易是170字节,每字节5gas,减去850gas,剩下 1150 gasSubtract 10 more ether from the sender's account, and add it to the contract's account. 从发送者账户减去10个以太币,将其增加到合约账户Run the code. In this case, this is simple: it checks if the contract's storage at index 2 is used, notices that it is not, and so it sets the storage at index 2 to the value CHARLIE. Suppose this takes 187 gas, so the remaining amount of gas is 1150 - 187 = 963 运行代码。在这个案例中,非常简单:检查合约账户的存储索引 2 是否被使用,提示没有,则将存储索引2的数据设置为 CHARLIE 。假设这花费了187gas,余下的就是 1150 - 187 = 963 gasAdd 963 * 0.0001 = 0.963 ether back to the sender's account, and return the resulting state. 返还 963 * 0.0001 = 0.963 以太币到发送者账户,同时返回结果状态。If there was no contract at the receiving end of the transaction, then the total transaction fee would simply be equal to the provided GASPRICE multiplied by the length of the transaction in bytes, and the data sent alongside the transaction would be irrelevant.如果在交易接收端没有合约,那么总的交易费用将等于所提供的GASPRICE乘以交易的长度(以字节为单位),与交易一起发送的数据无关。Note that messages work equivalently to transactions in terms of reverts: if a message execution runs out of gas, then that message's execution, and all other executions triggered by that execution, revert, but parent executions do not need to revert. This means that it is "safe" for a contract to call another contract, as if A calls B with G gas then A's execution is guaranteed to lose at most G gas. Finally, note that there is an opcode, CREATE, that creates a contract; its execution mechanics are generally similar to CALL, with the exception that the output of the execution determines the code of a newly created contract.请注意,消息在回滚方面与交易相同:如果消息执行耗尽gas,那么该消息的执行以及该执行触发的所有其他执行都会回滚,但父执行不需要回滚。 这意味着合约调用另一份合约是“安全的”,就好像A用G gas调用B,那么可以确保A的执行最多会损失G gas。 最后,请注意,有一个操作码CREATE,它创建合约; 其执行机制通常与CALL类似,例外是执行的输出决定了新创建的合约代码。Code Execution 代码执行The code in Ethereum contracts is written in a low-level, stack-based bytecode language, referred to as "Ethereum virtual machine code" or "EVM code". The code consists of a series of bytes, where each byte represents an operation. In general, code execution is an infinite loop that consists of repeatedly carrying out the operation at the current program counter (which begins at zero) and then incrementing the program counter by one, until the end of the code is reached or an error or STOP or RETURN instruction is detected. The operations have access to three types of space in which to store data:以太坊合约中的代码采用低级,基于堆栈的字节码语言编写,被称为“以太坊虚拟机代码”或“EVM代码”。 该代码由一系列字节组成,其中每个字节表示一个操作。 一般来说,代码执行是一个无限循环,它包括在当前程序计数器(从零开始)重复执行操作,然后将程序计数器递增1,直到代码结束或错误或STOP 或RETURN指令被检测到。 这些操作可以访问三种类型的数据存储空间:The stack, a last-in-first-out container to which values can be pushed and popped 堆栈,数据压入弹出的后进先出的容器Memory, an infinitely expandable byte array 内存,一个无限扩展的字节数组The contract's long-term storage, a key/value store. Unlike stack and memory, which reset after computation ends, storage persists for the long term. 合约的长期存储,一个键/值存储,与堆栈和内存会在计算结束后重置不同,这一存储将会长期保持,The code can also access the value, sender and data of the incoming message, as well as block header data, and the code can also return a byte array of data as an output.代码还可以访问传入消息的值,发送者和数据以及块头数据,代码也可以返回一个字节数组作为输出。The formal execution model of EVM code is surprisingly simple. While the Ethereum virtual machine is running, its full computational state can be defined by the tuple (block_state, transaction, message, code, memory, stack, pc, gas), where block_state is the global state containing all accounts and includes balances and storage. At the start of every round of execution, the current instruction is found by taking the pcth byte of code (or 0 if pc >= len(code)), and each instruction has its own definition in terms of how it affects the tuple. For example, ADD pops two items off the stack and pushes their sum, reduces gas by 1 and increments pc by 1, and SSTORE pops the top two items off the stack and inserts the second item into the contract's storage at the index specified by the first item. Although there are many ways to optimize Ethereum virtual machine execution via just-in-time compilation, a basic implementation of Ethereum can be done in a few hundred lines of code.EVM代码的正式执行模型非常简单。 当以太坊虚拟机正在运行时,它的完整计算状态可以由元组(block_state,transaction,message,code,memory,stack,pc,gas)定义,其中block_state是包含所有帐户的全局状态,并包含余额和存储。 在每一轮执行开始时,当前指令可以通过获取代码的pc th(译者注:类似4th,5th 等)字节来找到(如果pc> = len(code),则为0),并且每条指令都有其自己的定义,以表明它如何影响元组。 例如,ADD从堆叠中弹出两个物品并推送其总和,将gas减少1,并将pc递增1,SSTORE将顶部两项品从堆栈中弹出,并将第二项插入到合约存储器中作为索引的第一项。 虽然有很多方法可以通过即时编译来优化以太坊虚拟机的执行,但以太坊的基本实现可以通过几百行代码完成。Blockchain and Mining 区块链和挖矿The Ethereum blockchain is in many ways similar to the Bitcoin blockchain, although it does have some differences. The main difference between Ethereum and Bitcoin with regard to the blockchain architecture is that, unlike Bitcoin, Ethereum blocks contain a copy of both the transaction list and the most recent state. Aside from that, two other values, the block number and the difficulty, are also stored in the block. The basic block validation algorithm in Ethereum is as follows:以太坊区块链在很多方面与比特币区块链相似,但它确实有一些区别。 以太坊和比特币在区块链架构方面的主要区别在于,与比特币不同,以太坊区块包含交易列表和最新状态的副本。 除此之外,区块块中还存储了其他两个值,区块号和难度。 以太坊中的基础的区块验证算法如下:Check if the previous block referenced exists and is valid. 检查被引用的前一区块是否存在并有效Check that the timestamp of the block is greater than that of the referenced previous block and less than 15 minutes into the future 检查时间戳是否大于被引用的前一区块并且小于未来15分钟Check that the block number, difficulty, transaction root, uncle root and gas limit (various low-level Ethereum-specific concepts) are valid. 检查区块号,难度,交易根,叔根和gas限制(各种各样底层的以太坊特有概念)是否有效。Check that the proof of work on the block is valid. 检查当前区块的工作量证明是否有效。Let S[0] be the state at the end of the previous block. 让 S[0] 作为前一区块末尾的状态Let TX be the block's transaction list, with n transactions. For all i in 0...n-1, set S[i+1] = APPLY(S[i],TX[i]). If any applications returns an error, or if the total gas consumed in the block up until this point exceeds the GASLIMIT, return an error. 让 TX 作为区块的交易列表,包含了 n 个交易。为所有在 0...n-1的 i 进行操作, 让 S[i+1] = APPLY(S[i],TX[i])。如果任何应用返回错误,或者 gas 消耗超过了 GASLINIT 的限制,返回错误。Let S_FINAL be S[n], but adding the block reward paid to the miner. 让S_FINAL 成为 S[n],但要增加支付给矿工的区块奖励。Check if the Merkle tree root of the state S_FINAL is equal to the final state root provided in the block header. If it is, the block is valid; otherwise, it is not valid. 检查 S_FINAL 中默克尔树根是否等于区块头部的最终状态根。如果相等则区块是有效的,否则区块无效。The approach may seem highly inefficient at first glance, because it needs to store the entire state with each block, but in reality efficiency should be comparable to that of Bitcoin. The reason is that the state is stored in the tree structure, and after every block only a small part of the tree needs to be changed. Thus, in general, between two adjacent blocks the vast majority of the tree should be the same, and therefore the data can be stored once and referenced twice using pointers (ie. hashes of subtrees). A special kind of tree known as a "Patricia tree" is used to accomplish this, including a modification to the Merkle tree concept that allows for nodes to be inserted and deleted, and not just changed, efficiently. Additionally, because all of the state information is part of the last block, there is no need to store the entire blockchain history - a strategy which, if it could be applied to Bitcoin, can be calculated to provide 5-20x savings in space.这种方法乍一看似乎效率很低,因为它需要在每个块中存储整个状态,但实际上效率应该与比特币相当。 原因是状态存储在树状结构中,并且在每个块之后只需要改变树的一小部分。 因此,通常在两个相邻块之间,绝大多数树应该是相同的,因此数据可以被存储一次并且使用指针(即子树的散列)被引用两次。 一种称为“Patricia树”的特殊树被用来实现这一点,包括对Merkle树概念的修改,允许节点被插入和删除,而不仅仅是改变,非常高效。 此外,由于所有状态信息都是最后一个区块的一部分,因此不需要存储整个区块链历史记录 - 这一策略如果应用于比特币,可以节省出节省5-20倍的空间。A commonly asked question is "where" contract code is executed, in terms of physical hardware. This has a simple answer: the process of executing contract code is part of the definition of the state transition function, which is part of the block validation algorithm, so if a transaction is added into block B the code execution spawned by that transaction will be executed by all nodes, now and in the future, that download and validate block B.对于物理硬件来说,一个常见问题是“在哪里”执行合约代码。一个简单的答案:执行合同代码的过程是状态转换函数的定义的一部分,函数是区块验证算法的一部分,所以如果将一个交易添加到区块B中,则该交易导致的代码执行将是:所有节点,现在和将来,都会下载和验证区块B。Applications 应用In general, there are three types of applications on top of Ethereum. The first category is financial applications, providing users with more powerful ways of managing and entering into contracts using their money. This includes sub-currencies, financial derivatives, hedging contracts, savings wallets, wills, and ultimately even some classes of full-scale employment contracts. The second category is semi-financial applications, where money is involved but there is also a heavy non-monetary side to what is being done; a perfect example is self-enforcing bounties for solutions to computational problems. Finally, there are applications such as online voting and decentralized governance that are not financial at all.总的来说,在以太坊之上有三种类型的应用程序。 第一类是金融应用程序,它为用户提供更强大的管理方式,让用户使用它们的资金签订合同。 这包括子货币,金融衍生品,套期保值合约,储蓄钱包,遗嘱以及最终甚至是一些类别的全面雇佣合同。 第二类是半金融应用,涉及金钱,但也有非常重要的非货币方面的工作。一个完美的例子就是为计算问题的解决自我实施奖励。 最后,还有诸如在线投票和分布式治理等应用程序,这些应用程序一点儿也没有财务属性。Token Systems 代币系统On-blockchain token systems have many applications ranging from sub-currencies representing assets such as USD or gold to company stocks, individual tokens representing smart property, secure unforgeable coupons, and even token systems with no ties to conventional value at all, used as point systems for incentivization. Token systems are surprisingly easy to implement in Ethereum. The key point to understand is that all a currency, or token system, fundamentally is a database with one operation: subtract X units from A and give X units to B, with the proviso that (1) A had at least X units before the transaction and (2) the transaction is approved by A. All that it takes to implement a token system is to implement this logic into a contract.区块链上的代币系统有许多应用,从代表资产(如美元或黄金)的子货币到公司股票,还有代表智能财产的单个代币,安全不可伪造的优惠券,甚至还有与常规价值完全不相干的代币,它被用做点激励系统。 代币系统在以太坊中实现起来非常简单。 要理解的关键点是,所有货币或代币系统基本上都是一个数据库,只有一个操作:从A中减去X个单位并将X个单位给予B,但条件是(1)在交易前,A至少有X个单位和(2)交易由A批准。实现代币系统所需的一切就是将该逻辑在合约中实施。The basic code for implementing a token system in Serpent looks as follows:用Serpent编写的实现代币系统的基本代码如下:def send(to, value):

if self.storage[msg.sender] >= value:

self.storage[msg.sender] = self.storage[msg.sender] - value

self.storage[to] = self.storage[to] + valueThis is essentially a literal implementation of the "banking system" state transition function described further above in this document. A few extra lines of code need to be added to provide for the initial step of distributing the currency units in the first place and a few other edge cases, and ideally a function would be added to let other contracts query for the balance of an address. But that's all there is to it. Theoretically, Ethereum-based token systems acting as sub-currencies can potentially include another important feature that on-chain Bitcoin-based meta-currencies lack: the ability to pay transaction fees directly in that currency. The way this would be implemented is that the contract would maintain an ether balance with which it would refund ether used to pay fees to the sender, and it would refill this balance by collecting the internal currency units that it takes in fees and reselling them in a constant running auction. Users would thus need to "activate" their accounts with ether, but once the ether is there it would be reusable because the contract would refund it each time.这实质上是对上文中进一步描述的“银行系统”状态转换函数的字面实现。需要添加一些额外的代码行,以便首先提供分配货币单位的第一步以及其他一些边缘情况;理想情况下,会添加一个函数以便让其他合同来查询地址的余额。但,这就是它的全部。从理论上讲,以太坊为基础的代币系统充当次级货币可能会包含,链式的以基于比特币元币所缺乏的,另一个重要特征:能够直接以该货币支付交易费用。这样做的方式是,合同将维护一个以太币账户,这样就可以用给发送人的以太币退款来支付交易费用,合约将通过收集被作为交易费的内部货币单位,并在一个不断运行的拍卖中再次卖掉,以实现为该账户注资。用户因此需要使用以太币来“激活”他们的账户,但是一旦以太会在那里就可以重用,因为合约每次都会退还。Financial derivatives and Stable-Value Currencies金融衍生品和价值稳定的货币Financial derivatives are the most common application of a "smart contract", and one of the simplest to implement in code. The main challenge in implementing financial contracts is that the majority of them require reference to an external price ticker; for example, a very desirable application is a smart contract that hedges against the volatility of ether (or another cryptocurrency) with respect to the US dollar, but doing this requires the contract to know what the value of ETH/USD is. The simplest way to do this is through a "data feed" contract maintained by a specific party (eg. NASDAQ) designed so that that party has the ability to update the contract as needed, and providing an interface that allows other contracts to send a message to that contract and get back a response that provides the price.金融衍生工具是“智能合约”中最常见的应用,也是最简单的代码实现之一。 实施金融合同的主要挑战是,其中大部分要求参考外部价格报价器; 例如,一个非常理想的应用程序是一种智能合约,可以抵御以太币(或另一种加密货币)相对于美元的波动性,但这样做需要合约知道ETH / USD的价值。 最简单的方法是通过由特定方(例如纳斯达克)维护的“数据反馈”合同,以便该方有权根据需要更新合同,并提供一个接口,以允许其他合同向那个合同发送消息并取回提供价格的响应。Given that critical ingredient, the hedging contract would look as follows:给定关键元素,对冲合约看起来如下:Wait for party A to input 1000 ether. 等待 A 方 输入1000 以太币Wait for party B to input 1000 ether. 等待 B 方输入1000以太币Record the USD value of 1000 ether, calculated by querying the data feed contract, in storage, say this is $x. 记录1000 以太币价值多少美元,这通过询问数据反馈合约后计算获得,保存,假如是 $x。After 30 days, allow A or B to "reactivate" the contract in order to send $x worth of ether (calculated by querying the data feed contract again to get the new price) to A and the rest to B. 30天后,允许A或者B再次激活合约,发送价值$x 的以太币给A,具体的以太币的数值当然也是在询问数据反馈合约后计算获得,余下的以太币发送给B。Such a contract would have significant potential in crypto-commerce. One of the main problems cited about cryptocurrency is the fact that it's volatile; although many users and merchants may want the security and convenience of dealing with cryptographic assets, they may not wish to face that prospect of losing 23% of the value of their funds in a single day. Up until now, the most commonly proposed solution has been issuer-backed assets; the idea is that an issuer creates a sub-currency in which they have the right to issue and revoke units, and provide one unit of the currency to anyone who provides them (offline) with one unit of a specified underlying asset (eg. gold, USD). The issuer then promises to provide one unit of the underlying asset to anyone who sends back one unit of the crypto-asset. This mechanism allows any non-cryptographic asset to be "uplifted" into a cryptographic asset, provided that the issuer can be trusted.这样的合同在密码商务中将具有巨大的潜力。 引用加密货币的主要问题之一是不稳定; 尽管许多用户和商家可能希望使用加密资产的安全性和便利性,但他们可能不希望一天内损失其资金价值23%的前景。 到目前为止,最常见的解决方案是发行人背书资产; 这个想法是,发行人创建了一个子货币,他们有权发行和撤回货币单位,并将任何一个单位的货币提供给那些给他们(离线)提供一个单位特定基础资产(例如,黄金 , 美元)的人。 然后,发行人承诺向发回一个单位加密资产的任何人返还一个基础资产单位。 该机制允许任何非密码资产被“提升”为密码资产,前提是发行人可以被信任。In practice, however, issuers are not always trustworthy, and in some cases the banking infrastructure is too weak, or too hostile, for such services to exist. Financial derivatives provide an alternative. Here, instead of a single issuer providing the funds to back up an asset, a decentralized market of speculators, betting that the price of a cryptographic reference asset (eg. ETH) will go up, plays that role. Unlike issuers, speculators have no option to default on their side of the bargain because the hedging contract holds their funds in escrow. Note that this approach is not fully decentralized, because a trusted source is still needed to provide the price ticker, although arguably even still this is a massive improvement in terms of reducing infrastructure requirements (unlike being an issuer, issuing a price feed requires no licenses and can likely be categorized as free speech) and reducing the potential for fraud.然而,在实践中,发行人并不总是值得信赖的,而且在某些情况下,银行业基础设施太脆弱,或者银行不够诚信,所以这样的服务不能存在。金融衍生产品提供了另一种选择。在这里,不是单一发行人提供资金来支撑一种资产,而是一个分布式的投机者市场,他们认为加密资产(例如ETH)的价格会上涨,而扮演了投机者这个角色。 与发行人不同,投机者没有讨价还价的余地,因为对冲合约持有他们的资金托管。 请注意,这种方法并不是完全分布式的,因为仍然需要一个可信赖的来源来提供报价,尽管可以说即使如此,这也仍然是一个在降低基础设施要求(与发行商不同,发布价格反馈不需要许可证,并可能被归类为言论自由)和减少欺诈的可能性方面的巨大进步。Identity and Reputation Systems 身份和信誉系统The earliest alternative cryptocurrency of all, Namecoin, attempted to use a Bitcoin-like blockchain to provide a name registration system, where users can register their names in a public database alongside other data. The major cited use case is for a DNS system, mapping domain names like "bitcoin.org" (or, in Namecoin's case, "bitcoin.bit") to an IP address. Other use cases include email authentication and potentially more advanced reputation systems. Here is the basic contract to provide a Namecoin-like name registration system on Ethereum:最早的替代加密货币,Namecoin试图使用类似比特币的区块链来提供名称注册系统,用户可以在公共数据库中将他们的名称与其他数据一起注册。 主要引用的用例是DNS系统,将域名(比如“bitcoin.org”)(或者在Namecoin的例子中是“bitcoin.bit”)映射到IP地址。 其他用例包括电子邮件认证和潜在的更高级的信誉系统。 以下是在以太坊提供类似Namecoin的名称注册系统的基本合约:def register(name, value):

if !self.storage[name]:

self.storage[name] = valueThe contract is very simple; all it is is a database inside the Ethereum network that can be added to, but not modified or removed from. Anyone can register a name with some value, and that registration then sticks forever. A more sophisticated name registration contract will also have a "function clause" allowing other contracts to query it, as well as a mechanism for the "owner" (ie. the first registerer) of a name to change the data or transfer ownership. One can even add reputation and web-of-trust functionality on top.合约非常简单; 所有这一切都是以太坊网络内的一个数据库,可以添加到但不能修改或删除。 任何人都可以注册一个具有一定价值的名称,然后该注册将永久保存。 一个更复杂的名称注册合同也会有一个“函数条款”,允许其他合同进行查询,以及一个为“所有者”而设的机制(即,第一注册者),所有者可以更改数据或转让所有权。 人们甚至可以在上面添加信誉和网络信任功能。Decentralized File Storage 分布式文件存储Over the past few years, there have emerged a number of popular online file storage startups, the most prominent being Dropbox, seeking to allow users to upload a backup of their hard drive and have the service store the backup and allow the user to access it in exchange for a monthly fee. However, at this point the file storage market is at times relatively inefficient; a cursory look at various existing solutions shows that, particularly at the "uncanny valley" 20-200 GB level at which neither free quotas nor enterprise-level discounts kick in, monthly prices for mainstream file storage costs are such that you are paying for more than the cost of the entire hard drive in a single month. Ethereum contracts can allow for the development of a decentralized file storage ecosystem, where individual users can earn small quantities of money by renting out their own hard drives and unused space can be used to further drive down the costs of file storage.在过去几年中,已经出现了一些流行的在线文件存储初创公司,其中最着名的是Dropbox,它试图允许用户上传他们硬盘的备份,提供保存备份和用户访问这些数据服务,他们为此收取月费。 但是,目前文件存储市场有时相对低效, 粗略看一下现有的各种解决方案,特别是在20-200 GB的“恐怖谷”水平上,既没有免费额度也没有企业级的折扣,你支付的主流文件存储成本的每月价格,要高于单月整个硬盘的成本。 以太坊合同可以允许开发分布式文件存储生态系统,个人用户可以通过出租自己的硬盘来赚取少量的资金,未使用的空间可以用来进一步降低文件存储成本。The key underpinning piece of such a device would be what we have termed the "decentralized Dropbox contract". This contract works as follows. First, one splits the desired data up into blocks, encrypting each block for privacy, and builds a Merkle tree out of it. One then makes a contract with the rule that, every N blocks, the contract would pick a random index in the Merkle tree (using the previous block hash, accessible from contract code, as a source of randomness), and give X ether to the first entity to supply a transaction with a simplified payment verification-like proof of ownership of the block at that particular index in the tree. When a user wants to re-download their file, they can use a micropayment channel protocol (eg. pay 1 szabo per 32 kilobytes) to recover the file; the most fee-efficient approach is for the payer not to publish the transaction until the end, instead replacing the transaction with a slightly more lucrative one with the same nonce after every 32 kilobytes.这种装置的关键部件我们称之为“分布式Dropbox合同”。该合同的如此工作。首先,将所需数据分成块,对每个块进行隐私加密,然后构建默克尔树。然后用以下规则形成合约:每N个块,合约将在Merkle树中选择一个随机索引(可从合同代码访问,使用之前的区块散列作为随机源),并将 X 以太币赋予第一个实体,为该交易提供一个简化的支付验证(SPV) - 就像在树中特定索引处的块的所有权证明。当用户想要重新下载他们的文件时,他们可以使用微支付通道协议(例如,支付每32千字节1个szabo)来恢复文件;最节省费用的方法是付款人不到最后不要发布交易,而是,在每32千字节之后,用一个更划算的带有同样随机数的交易取代原来的那个。An important feature of the protocol is that, although it may seem like one is trusting many random nodes not to decide to forget the file, one can reduce that risk down to near-zero by splitting the file into many pieces via secret sharing, and watching the contracts to see each piece is still in some node's possession. If a contract is still paying out money, that provides a cryptographic proof that someone out there is still storing the file.该协议的一个重要特点是,虽然看起来像一个人相信许多不会丢失文件的随机节点,但可以通过秘密共享将文件分割成许多块,从而将风险降低到接近于零,并通过监看合约来了解每个碎片仍然在某个节点中。 如果合约仍在支付金钱,那么它提供了一个某人仍在存储该文件的密码学证据。Decentralized Autonomous Organizations 分布式自治组织The general concept of a "decentralized autonomous organization" is that of a virtual entity that has a certain set of members or shareholders which, perhaps with a 67% majority, have the right to spend the entity's funds and modify its code. The members would collectively decide on how the organization should allocate its funds. Methods for allocating a DAO's funds could range from bounties, salaries to even more exotic mechanisms such as an internal currency to reward work. This essentially replicates the legal trappings of a traditional company or nonprofit but using only cryptographic blockchain technology for enforcement. So far much of the talk around DAOs has been around the "capitalist" model of a "decentralized autonomous corporation" (DAC) with dividend-receiving shareholders and tradable shares; an alternative, perhaps described as a "decentralized autonomous community", would have all members have an equal share in the decision making and require 67% of existing members to agree to add or remove a member. The requirement that one person can only have one membership would then need to be enforced collectively by the group.“分布式自治组织”的一般概念是拥有一定数量的成员或股东的虚拟实体,这些成员或股东可能拥有67%的多数股东权利,有权花费实体的资金和修改代码。成员将共同决定组织如何分配资金。分配DAO资金的方法可以,从赏金,工资,到更多如用内部货币以奖励工作这样的外来机制。这基本上复制了传统公司或非营利组织的法律外观,但仅使用加密区块链技术来执行。到目前为止,关于DAO的大部分讨论都围绕着“分布式自治公司”(DAC)的“资本主义”模式,其中包含接受分红的股东和可交易股票;另一种可能被称为“分布式自治社区”的替代方案,所有成员在决策中拥有平等的份额,增加或开除一名成员,需要得到67%现有成员的同意。一个人只能拥有一个会员资格的要求,将需要该团体共同强制执行。A general outline for how to code a DAO is as follows. The simplest design is simply a piece of self-modifying code that changes if two thirds of members agree on a change. Although code is theoretically immutable, one can easily get around this and have de-facto mutability by having chunks of the code in separate contracts, and having the address of which contracts to call stored in the modifiable storage. In a simple implementation of such a DAO contract, there would be three transaction types, distinguished by the data provided in the transaction:如何编写DAO的一般概要如下。 最简单的设计只是一个自我修改的代码,如果三分之二的成员同意修改就会发生变化。 尽管代码在理论上是不可变的,但人们可以很容易地解决这个问题,通过在单独的合同中包含大部分代码,并调用那些合同的地址存储在可修改的存储中,从而具有事实上的可变性。 在这种DAO合同的简单实现中,有三种交易类型,通过交易中提供的数据进行区分:[0,i,K,V] to register a proposal with index i to change the address at storage index K to value V 注册一个提议,用索引 i 来修改存储索引 K 到 V 的地址[0,i] to register a vote in favor of proposal i 注册一个赞成建议 i 的投票 [2,i] to finalize proposal i if enough votes have been made 如果足够的投票已经做出,敲定建议 i 。The contract would then have clauses for each of these. It would maintain a record of all open storage changes, along with a list of who voted for them. It would also have a list of all members. When any storage change gets to two thirds of members voting for it, a finalizing transaction could execute the change. A more sophisticated skeleton would also have built-in voting ability for features like sending a transaction, adding members and removing members, and may even provide for Liquid Democracy-style vote delegation (ie. anyone can assign someone to vote for them, and assignment is transitive so if A assigns B and B assigns C then C determines A's vote). This design would allow the DAO to grow organically as a decentralized community, allowing people to eventually delegate the task of filtering out who is a member to specialists, although unlike in the "current system" specialists can easily pop in and out of existence over time as individual community members change their alignments.合同的每一项都有条款。它将保存所有开放存储更改的记录以及谁投票给他们的清单。它也会有一个所有成员的名单。当任何存储变更得到三分之二的成员投票支持时,敲定的交易来执行变更。一个更复杂的框架可能也会具有内置投票功能,例如发送交易,增加成员和删除成员等功能,甚至可以提供流动民主风格的投票授权(即任何人都可以指定某人投票给他们,因此如果A指定B投票,B指定C,则C决定A的投票)。这种设计可以使DAO作为一个分布式的社区有机地发展起来,允许人们最终将挑选合适人选的任务委派给专家,但与“现有系统”不同,随着时间的推移,当个别社区成员改变他们的阵营时,专家很容易的加入或退出。An alternative model is for a decentralized corporation, where any account can have zero or more shares, and two thirds of the shares are required to make a decision. A complete skeleton would involve asset management functionality, the ability to make an offer to buy or sell shares, and the ability to accept offers (preferably with an order-matching mechanism inside the contract). Delegation would also exist Liquid Democracy-style, generalizing the concept of a "board of directors".另一种模式是分布式公司,任何账户可以有零或更多的股份,作出决定需要三分之二的股份支持。 一个完整的框架将涉及资产管理功能,提出购买或出售股份的能力,以及接受要约的能力(最好是在合同中使用订单匹配机制)。授权也存在流式民主风格,也就产生了“董事会”的概念。Further Applications 未来的应用1. Savings wallets. Suppose that Alice wants to keep her funds safe, but is worried that she will lose or someone will hack her private key. She puts ether into a contract with Bob, a bank, as follows: 储蓄钱包。假设Alice想安全的保管她的资金,但是却担心自己弄丢了私钥或者有人非法侵入获得她的私钥。她把以太币放在一个与Bob的合约里,一家银行,操作如下:Alice alone can withdraw a maximum of 1% of the funds per day. Alice每天可以独自取款最多1%Bob alone can withdraw a maximum of 1% of the funds per day, but Alice has the ability to make a transaction with her key shutting off this ability. Bob每天可以独自取款最多1%,但是Alice有权用她的钥匙发起一个交易关闭Bob的这个权利Alice and Bob together can withdraw anything. Alice和Bob一起可以提取任意额度的资金。Normally, 1% per day is enough for Alice, and if Alice wants to withdraw more she can contact Bob for help. If Alice's key gets hacked, she runs to Bob to move the funds to a new contract. If she loses her key, Bob will get the funds out eventually. If Bob turns out to be malicious, then she can turn off his ability to withdraw.通常情况下,Alice每天1%就足够了,如果Alice想要提取更多的资金,她可以联系鲍勃寻求帮助。 如果Alice的密钥遭到黑客攻击,她会去找Bob将资金转移到新的合约。 如果Alice失去了她的密钥,Bob将最终取出所有资金。 如果事实证明Bob是恶意的,那么她可以关闭他的取款资格。2. Crop insurance. One can easily make a financial derivatives contract but using a data feed of the weather instead of any price index. If a farmer in Iowa purchases a derivative that pays out inversely based on the precipitation in Iowa, then if there is a drought, the farmer will automatically receive money and if there is enough rain the farmer will be happy because their crops would do well. This can be expanded to natural disaster insurance generally.2.作物保险。 人们可以很容易地使用天气的数据反馈而不是任何价格指数来制定金融衍生品合约。 如果爱荷华州的农民购买与爱荷华州降水量相反支付的衍生合约,那么如果出现干旱,农民将自动获得收入,如果雨水充足,农民就会因为收成良好而开心。 这一般可以扩展到自然灾害保险。3. A decentralized data feed. For financial contracts for difference, it may actually be possible to decentralize the data feed via a protocol called "SchellingCoin". SchellingCoin basically works as follows: N parties all put into the system the value of a given datum (eg. the ETH/USD price), the values are sorted, and everyone between the 25th and 75th percentile gets one token as a reward. Everyone has the incentive to provide the answer that everyone else will provide, and the only value that a large number of players can realistically agree on is the obvious default: the truth. This creates a decentralized protocol that can theoretically provide any number of values, including the ETH/USD price, the temperature in Berlin or even the result of a particular hard computation.3.分布式数据反馈。 对于不同的金融合约,实际上可能通过一个名为“SchellingCoin”的协议进行分布式数据反馈。 SchellingCoin的基本工作原理如下:N方都将给定数据(例如ETH / USD价格)的值输入到系统中,对值进行排序,并且在第25和75百分位之间的每个人都获得一个代币奖励。 每个人都有动力提供其他人将提供的答案,而大量玩家可以切实达成一致的唯一价值就是明显的默认值:事实。 这创建了一个分布式的协议,理论上可以提供任意数量的值,包括ETH / USD价格,柏林温度或甚至特定的硬计算结果。4. Smart multisignature escrow. Bitcoin allows multisignature transaction contracts where, for example, three out of a given five keys can spend the funds. Ethereum allows for more granularity; for example, four out of five can spend everything, three out of five can spend up to 10% per day, and two out of five can spend up to 0.5% per day. Additionally, Ethereum multisig is asynchronous - two parties can register their signatures on the blockchain at different times and the last signature will automatically send the transaction.4.智能多重签名托管。 比特币允许多重签名交易合约,例如,给定五个密钥中的三个可以花费资金。 以太坊允许更多的粒度; 例如,五分之四的人可以消费任意数额,五分之三的人每天最高可花费10%,五分之二的人每天最高可花费0.5%。 此外,以太坊多重签名是异步的 - 双方可以在不同时间在区块链上注册其签名,最后一个签名将自动发送交易。5. Cloud computing. The EVM technology can also be used to create a verifiable computing environment, allowing users to ask others to carry out computations and then optionally ask for proofs that computations at certain randomly selected checkpoints were done correctly. This allows for the creation of a cloud computing market where any user can participate with their desktop, laptop or specialized server, and spot-checking together with security deposits can be used to ensure that the system is trustworthy (ie. nodes cannot profitably cheat). Although such a system may not be suitable for all tasks; tasks that require a high level of inter-process communication, for example, cannot easily be done on a large cloud of nodes. Other tasks, however, are much easier to parallelize; projects like SETI@home, folding@home and genetic algorithms can easily be implemented on top of such a platform.5.云计算。 EVM技术也可用于创建可验证的计算环境,这允许用户请求其他人进行计算,然后可选择的要求提供证据,这些证据来自正确完成的随机选择的检查点。 这允许创建一个云计算市场,任何用户都可以通过他们的台式机,笔记本电脑或专用服务器参与其中,现场检查和安全保证金可以确保系统是可信的(即节点不能因欺骗而获利)。 虽然这样的系统可能不适合所有的任务, 例如,需要高级别进程间通信的任务不能在大型节点云上轻松完成。 但是,其他任务更容易并行化; 诸如SETI @ home,folding @ home和遗传算法等项目可以很容易地在这样的平台之上实现。6. Peer-to-peer gambling. Any number of peer-to-peer gambling protocols, such as Frank Stajano and Richard Clayton's Cyberdice, can be implemented on the Ethereum blockchain. The simplest gambling protocol is actually simply a contract for difference on the next block hash, and more advanced protocols can be built up from there, creating gambling services with near-zero fees that have no ability to cheat.6.点对点赌博。 任何数量的点对点赌博协议,例如Frank Stajano和Richard Clayton的Cyberdice,都可以在以太坊区块链上实施。 事实上最简单的赌博协议只是下一个块哈希差异的合约,并且可以从那里建立更高级的协议,以几乎为零的费用创建赌博服务,而且这些服务无法作弊。7. Prediction markets. Provided an oracle or SchellingCoin, prediction markets are also easy to implement, and prediction markets together with SchellingCoin may prove to be the first mainstream application of futarchy as a governance protocol for decentralized organizations.7.预测市场。 提供一个预言或SchellingCoin,预测市场也很容易实现,有SchellingCoin的预测市场可能被证明是第一个分布式组织的组织管理协议的“futarchy”主流应用。8. On-chain decentralized marketplaces, using the identity and reputation system as a base. 8.链上分布式市场,以身份与信誉系统为基础Miscellanea And Concerns 杂项和相关Modified GHOST Implementation 改进版“幽灵”协议实现The "Greedy Heaviest Observed Subtree" (GHOST) protocol is an innovation first introduced by Yonatan Sompolinsky and Aviv Zohar in December 2013. The motivation behind GHOST is that blockchains with fast confirmation times currently suffer from reduced security due to a high stale rate - because blocks take a certain time to propagate through the network, if miner A mines a block and then miner B happens to mine another block before miner A's block propagates to B, miner B's block will end up wasted and will not contribute to network security. Furthermore, there is a centralization issue: if miner A is a mining pool with 30% hashpower and B has 10% hashpower, A will have a risk of producing a stale block 70% of the time (since the other 30% of the time A produced the last block and so will get mining data immediately) whereas B will have a risk of producing a stale block 90% of the time. Thus, if the block interval is short enough for the stale rate to be high, A will be substantially more efficient simply by virtue of its size. With these two effects combined, blockchains which produce blocks quickly are very likely to lead to one mining pool having a large enough percentage of the network hashpower to have de facto control over the mining process.“Greedy Heaviest Observed Subtree”(GHOST)幽灵协议是Yonatan Sompolinsky和Aviv Zohar于2013年12月首次提出的一项创新。提出GHOST协议的背后的动机是,由于高作废率,目前快速确认的区块链受累于降低的安全性 - 因为块的网络传播需要一定的时间,如果矿工A挖出一个区块,然后矿工B在矿工A的区块传播到B之前碰巧挖掘另一个区块,那么矿工B的区块将最终浪费并且不会有助于网络安全。此外,还有一个集中化问题:如果矿工A是一个拥有30%算力的采矿池,而B拥有10%算力,那么A将有70%的时间产生作废块的风险(因为另外30%的时间A产生了最后一个块,因此将立即获取挖掘数据),而B将有90%的时间产生作废块的风险。因此,如果区块产生的间隔足够短以使作废率较高,则仅凭借其大小的优势,A将显著的更加的高效。通过将这两种效应相结合,快速生成区块的区块链将很可能导致一个采矿池具有足够百分比的网络算力,以实际控制采矿过程。As described by Sompolinsky and Zohar, GHOST solves the first issue of network security loss by including stale blocks in the calculation of which chain is the "longest"; that is to say, not just the parent and further ancestors of a block, but also the stale descendants of the block's ancestor (in Ethereum jargon, "uncles") are added to the calculation of which block has the largest total proof of work backing it. To solve the second issue of centralization bias, we go beyond the protocol described by Sompolinsky and Zohar, and also provide block rewards to stales: a stale block receives 87.5% of its base reward, and the nephew that includes the stale block receives the remaining 12.5%. Transaction fees, however, are not awarded to uncles.正如Sompolinsky和Zohar所描述的那样,GHOST通过在计算哪个链是“最长”时包含作废块来解决网络安全损失的第一个问题; 也就是说,在计算哪个区块链具有最大的工作量证明时,所包含的区块,不仅仅是一个区块的父区块和进一步的祖先区块,而且也包括作废区块后代的祖先区块(在以太坊术语中称为“叔区块”)。 为了解决第二个——中心化偏见问题,我们超越了Sompolinsky和Zohar所描述的协议,为作废区块提供奖励:一个作废区块可以获得基本奖励的87.5%,包含该作废区块的侄区块获得剩余的12.5%。 但是,交易费用不会奖给叔区块。Ethereum implements a simplified version of GHOST which only goes down seven levels. Specifically, it is defined as follows:以太坊实现了一个只向下7层的简化版的GHOST。确切地说,它被定义成如下所述:A block must specify a parent, and it must specify 0 or more uncles 一个区块必须指定一个父区块,0或者多个叔区块An uncle included in block B must have the following properties: 一个被包含在B区块的叔区块必须拥有如下属性。It must be a direct child of the kth generation ancestor of B, where 2 <= k <= 7. 它必须是B区块的第k代祖先区块的直接子区块, 2 <= k <= 7。It cannot be an ancestor of B 它不能是B区块的祖先区块An uncle must be a valid block header, but does not need to be a previously verified or even valid block 叔区块必须是区块头有效的,但不必是先前验证的或者有效的区块An uncle must be different from all uncles included in previous blocks and all other uncles included in the same block (non-double-inclusion) 叔区块必须与所有的被包含在以前区块的叔区块不同,并且所有其他叔区块被包含在同一个区块中(非双重包含)For every uncle U in block B, the miner of B gets an additional 3.125% added to its coinbase reward and the miner of U gets 93.75% of a standard coinbase reward. 对每一个包含在B区块的叔区块U而言,挖掘出B区块的矿工获得额外的3.125%币基奖励,挖掘出U区块的矿工获得93.75%的标准的币基奖励。This limited version of GHOST, with uncles includable only up to 7 generations, was used for two reasons. First, unlimited GHOST would include too many complications into the calculation of which uncles for a given block are valid. Second, unlimited GHOST with compensation as used in Ethereum removes the incentive for a miner to mine on the main chain and not the chain of a public attacker.这个限制性的GHOST版本,只有7代可使用,原因有两个。 首先,无限制的GHOST会在计算给定块的哪些叔区块合法时包含太多复杂因素。 其次,在以太坊中使用的无限制GHOST的补偿消除了激励矿工在主链挖矿,而不是成为主链的公共攻击者。Fees 费用Because every transaction published into the blockchain imposes on the network the cost of needing to download and verify it, there is a need for some regulatory mechanism, typically involving transaction fees, to prevent abuse. The default approach, used in Bitcoin, is to have purely voluntary fees, relying on miners to act as the gatekeepers and set dynamic minimums. This approach has been received very favorably in the Bitcoin community particularly because it is "market-based", allowing supply and demand between miners and transaction senders determine the price. The problem with this line of reasoning is, however, that transaction processing is not a market; although it is intuitively attractive to construe transaction processing as a service that the miner is offering to the sender, in reality every transaction that a miner includes will need to be processed by every node in the network, so the vast majority of the cost of transaction processing is borne by third parties and not the miner that is making the decision of whether or not to include it. Hence, tragedy-of-the-commons problems are very likely to occur.由于发布到区块链中的每个交易都会向网络施加需要下载和验证的成本,因此需要一些管理机制(通常涉及交易费用)来防止滥用。在比特币中使用的默认方法是纯粹自愿收费,依靠矿工作为守门人并设置动态最小值。这种方法在比特币社区中非常受欢迎,特别是因为它是“基于市场”的,允许通过矿工和交易发送者之间的供求来决定价格。然而,这种推理的问题在于,交易处理并非一个市场;尽管将交易处理作为矿工提供给发送方的服务进行交易处理具有直观的吸引力,但实际上,矿工包括的每一笔交易都需要由网络中的每个节点来处理,因此绝大多数处理交易的成本由第三方承担,而不是由作出是否将其纳入区块的决定的矿工承担。因此,很可能会发生公地悲剧问题。However, as it turns out this flaw in the market-based mechanism, when given a particular inaccurate simplifying assumption, magically cancels itself out. The argument is as follows. Suppose that:然而,当给出一个特别不准确的简化假设时,这个基于市场的机制中证明了的缺陷,神奇地自行消除了。 论证如下。 假设:A transaction leads to k operations, offering the reward kR to any miner that includes it where R is set by the sender and k and R are (roughly) visible to the miner beforehand. 一个交易导致 k 个操作,提供 kR 奖励给任何收录交易的矿工,此处R是交易发送者设置的,同时k和R(大体上)事先对于矿工是可预见的。An operation has a processing cost of C to any node (ie. all nodes have equal efficiency) 对于任何节点来说,一步操作的处理成本是C(假设所有的节点具有相同的效率)There are N mining nodes, each with exactly equal processing power (ie. 1/N of total) 这里有N个拥有相同处理能力的挖矿节点,(例如,单个节点就是 1/N)No non-mining full nodes exist.(不存在不挖矿的全节点)A miner would be willing to process a transaction if the expected reward is greater than the cost. Thus, the expected reward is kR/N since the miner has a 1/N chance of processing the next block, and the processing cost for the miner is simply kC. Hence, miners will include transactions where kR/N > kC, or R > NC. Note that R is the per-operation fee provided by the sender, and is thus a lower bound on the benefit that the sender derives from the transaction, and NC is the cost to the entire network together of processing an operation. Hence, miners have the incentive to include only those transactions for which the total utilitarian benefit exceeds the cost.如果期望的回报大于成本,矿工会愿意处理交易。 因此,期望的回报是kR / N,因为矿工有1 / N处理下一个块的机会,并且矿工的处理成本仅为kC。 因此,矿工将在区块中包含 kR / N> kC或R> NC的交易。 请注意,R是交易发送人提供的每次的操作费用,因此是交易发送人(译注:可能此处为笔误,应该为矿工)从交易中获得的收益的下限,NC是整个网络一起处理操作的成本。 因此,矿工只有动机去包含收益超过成本的那些交易。However, there are several important deviations from those assumptions in reality:然而,在现实世界,这些假设还存在几处重要的偏差:The miner does pay a higher cost to process the transaction than the other verifying nodes, since the extra verification time delays block propagation and thus increases the chance the block will become a stale. 因为额外的验证时间延迟了块的传播,从而增加了区块成为废区块的可能性,所以矿工在处理交易上所耗费的成本比其他验证节点的高。There do exist nonmining full nodes. 存在不挖矿的全节点。The mining power distribution may end up radically inegalitarian in practice. 实际上,挖矿算力分布可能最终极度不平衡。Speculators, political enemies and crazies whose utility function includes causing harm to the network do exist, and they can cleverly set up contracts where their cost is much lower than the cost paid by other verifying nodes. 以破坏网络为己任的投机者,政治敌人和疯子确实存在,并且他们可以巧妙地设置合约,使得他们的成本远低于其他验证节点。(1) provides a tendency for the miner to include fewer transactions, and (2) increases NC; hence, these two effects at least partially cancel each other out.How? (3) and (4) are the major issue; to solve them we simply institute a floating cap: no block can have more operations than BLK_LIMIT_FACTOR times the long-term exponential moving average. Specifically:(1)使得矿工包含更少的交易成为趋势,(2)增加NC; 因此,这两种效应至少部分相互抵消了。如何? (3)和(4)是主要问题; 为了解决它们,我们只需设置一个浮动上限:任何块都不能有超过BLK_LIMIT_FACTOR 倍数的长期指数移动平均值的操作数。 具体地:blk.oplimit = floor((blk.parent.oplimit * (EMAFACTOR - 1) + floor(parent.opcount * BLK_LIMIT_FACTOR)) / EMA_FACTOR)BLK_LIMIT_FACTOR and EMA_FACTOR are constants that will be set to 65536 and 1.5 for the time being, but will likely be changed after further analysis.BLK_LIMIT_FACTOR和EMA_FACTOR是暂时设置为65536和1.5的常量,但在进一步分析后可能会更改。There is another factor disincentivizing large block sizes in Bitcoin: blocks that are large will take longer to propagate, and thus have a higher probability of becoming stales. In Ethereum, highly gas-consuming blocks can also take longer to propagate both because they are physically larger and because they take longer to process the transaction state transitions to validate. This delay disincentive is a significant consideration in Bitcoin, but less so in Ethereum because of the GHOST protocol; hence, relying on regulated block limits provides a more stable baseline.还有另一个因素阻碍大区块在比特币中存在:大区块需要更长的时间才能传播,因此有更高的可能性成为废区块。 在以太坊中,消耗gas较高的区块也可能需要较长的时间才能传播,因为它们物理上较大,并且处理事务状态转换需要较长的时间才能生效。 这种延迟抑制是比特币的重要考虑因素,但由于GHOST协议的存在,在Ethereum中这并不那么重要; 因此,依靠规定的区块限值可以提供更稳定的基线。Computation And Turing-Completeness计算和图灵完备An important note is that the Ethereum virtual machine is Turing-complete; this means that EVM code can encode any computation that can be conceivably carried out, including infinite loops. EVM code allows looping in two ways. First, there is a JUMP instruction that allows the program to jump back to a previous spot in the code, and a JUMPI instruction to do conditional jumping, allowing for statements like while x < 27: x = x * 2. Second, contracts can call other contracts, potentially allowing for looping through recursion. This naturally leads to a problem: can malicious users essentially shut miners and full nodes down by forcing them to enter into an infinite loop? The issue arises because of a problem in computer science known as the halting problem: there is no way to tell, in the general case, whether or not a given program will ever halt.一个重要的提醒是以太坊虚拟机是图灵完备的; 这意味着EVM代码可以编码任何可以实现的计算,包括无限循环。 EVM代码允许以两种方式循环。 第一种,有一个允许程序跳回到代码中的前一个点的JUMP指令,以及一个执行条件跳转的JUMPI指令,允许像x <27:x = x * 2这样的语句。第二种,合约可以调用其他合约,可能允许通过递归循环。 这自然会导致一个问题:恶意用户能否通过迫使他们进入无限循环来关闭矿池和完整节点? 出现这个问题是因为计算机科学中存在一个问题,称为停止问题:在一般情况下,无法说明给定的程序是否会停止。As described in the state transition section, our solution works by requiring a transaction to set a maximum number of computational steps that it is allowed to take, and if execution takes longer computation is reverted but fees are still paid. Messages work in the same way. To show the motivation behind our solution, consider the following examples:正如状态转换部分所述,我们的解决方案的运行是通过要求交易设置允许采用的最大计算步骤数,如果执行时间更长,那么计算将会反转,但费用仍需仍会支付。 消息以相同的方式工作。 为了展示我们解决方案背后的动机,请考虑以下示例:An attacker creates a contract which runs an infinite loop, and then sends a transaction activating that loop to the miner. The miner will process the transaction, running the infinite loop, and wait for it to run out of gas. Even though the execution runs out of gas and stops halfway through, the transaction is still valid and the miner still claims the fee from the attacker for each computational step.攻击者创建一个运行无限循环的合同,然后发送一个激活该循环的交易给矿工。 矿工将处理交易,运行无限循环,并等待它耗尽gas。 即使运行耗尽了gas,在运行到一半时停止了,交易仍然有效,并且矿工仍然可以要求攻击者为每个计算步骤支付费用。An attacker creates a very long infinite loop with the intent of forcing the miner to keep computing for such a long time that by the time computation finishes a few more blocks will have come out and it will not be possible for the miner to include the transaction to claim the fee. However, the attacker will be required to submit a value for STARTGAS limiting the number of computational steps that execution can take, so the miner will know ahead of time that the computation will take an excessively large number of steps.攻击者创建了一个非常长的无限循环,其目的是迫使矿工持续计算这么长时间,所以当计算完成时,会有更多的区块产生出来,因此对于矿工(译注:负责计算非常长无限循环的矿工)来说包含交易索取费用将不再可能。 然而,攻击者将被要求提交一个STARTGAS的值,以限制可以执行的计算步骤的数量,所以矿工会提前知道计算过程需要极其大量的步骤。An attacker sees a contract with code of some form like send(A,contract.storage[A]); contract.storage[A] = 0, and sends a transaction with just enough gas to run the first step but not the second (ie. making a withdrawal but not letting the balance go down). The contract author does not need to worry about protecting against such attacks, because if execution stops halfway through the changes get reverted.攻击者通过某种形式的代码来查看合约,如send(A,contract.storage [A]); contract.storage [A] = 0,并发送一个只有足够的gas来运行第一步但不是第二步的交易(即提款但不让余额下降)。 合约制定者不需要担心防范这种攻击,因为如果执行中途停止,更改将被恢复。A financial contract works by taking the median of nine proprietary data feeds in order to minimize risk. An attacker takes over one of the data feeds, which is designed to be modifiable via the variable-address-call mechanism described in the section on DAOs, and converts it to run an infinite loop, thereby attempting to force any attempts to claim funds from the financial contract to run out of gas. However, the financial contract can set a gas limit on the message to prevent this problem.金融合约通过采用九个专有数据反馈的中间值来降低风险。 攻击者接管其中一个数据反馈,该数据反馈旨在通过DAO部分中描述的可变地址呼叫机制进行修改,并将其转换为运行无限循环,从而强制任何尝试从金融合约索取利益的努力因耗尽gas而中止。 但是,金融合约可以设置消息的gas限制以防止此问题发生。The alternative to Turing-completeness is Turing-incompleteness, where JUMP and JUMPI do not exist and only one copy of each contract is allowed to exist in the call stack at any given time. With this system, the fee system described and the uncertainties around the effectiveness of our solution might not be necessary, as the cost of executing a contract would be bounded above by its size. Additionally, Turing-incompleteness is not even that big a limitation; out of all the contract examples we have conceived internally, so far only one required a loop, and even that loop could be removed by making 26 repetitions of a one-line piece of code. Given the serious implications of Turing-completeness, and the limited benefit, why not simply have a Turing-incomplete language? In reality, however, Turing-incompleteness is far from a neat solution to the problem. To see why, consider the following contracts:图灵完备性的替代是图灵不完备性,其中JUMP和JUMPI不存在,并且在任何给定时间只允许在调用堆栈中存在每个合约的一个副本。 在这个系统中,所描述的费用体系和我们解决方案效力的不确定性不再是必须,因为执行合同的成本将受到其规模的限制。 另外,图灵不完备性甚至也不是那么大的限制; 在我们内部构想的所有合约示例中,到目前为止,只有一个需要循环,即使那样也可以通过重复26行单行代码来消除该循环。 考虑到图灵完备性的严重影响以及有限的收益,为什么不简单地使用图灵不完备的语言呢? 然而,事实上,图灵不完备性并不能很好地解决这个问题。 要明白为什么,请考虑以下合约:C0: call(C1); call(C1);

C1: call(C2); call(C2);

C2: call(C3); call(C3);

...

C49: call(C50); call(C50);

C50: (run one step of a program and record the change in storage)Now, send a transaction to A. Thus, in 51 transactions, we have a contract that takes up 250computational steps. Miners could try to detect such logic bombs ahead of time by maintaining a value alongside each contract specifying the maximum number of computational steps that it can take, and calculating this for contracts calling other contracts recursively, but that would require miners to forbid contracts that create other contracts (since the creation and execution of all 26 contracts above could easily be rolled into a single contract). Another problematic point is that the address field of a message is a variable, so in general it may not even be possible to tell which other contracts a given contract will call ahead of time. Hence, all in all, we have a surprising conclusion: Turing-completeness is surprisingly easy to manage, and the lack of Turing-completeness is equally surprisingly difficult to manage unless the exact same controls are in place - but in that case why not just let the protocol be Turing-complete?现在,向A发送一笔交易。因此,在51笔交易中,我们有一份包含250个计算步骤的合约。矿工们可以尝试提前检测这种逻辑炸弹,方法是为每个合约保留一个值,限定其可以采取的最大计算步骤数,然后对递归调用其他合同的合同进行计算,但这要求矿工禁止合约创建其他合约(因为上述所有26份合约的创建和执行可以很容易地合并成一份合约)。另一个问题是,消息的地址字段是一个变量,所以一般情况下甚至不可能知道给定合约将提前调用哪些其他合约。因此,总而言之,我们得出了一个令人惊讶的结论:图灵完备性出奇地容易管理;除非有相同的控制措施,缺乏图灵完备性同样令人惊讶地难以管理 - 但在这种情况下,为什么不让协议成为图灵完备的呢?Currency And Issuance 货币和发行The Ethereum network includes its own built-in currency, ether, which serves the dual purpose of providing a primary liquidity layer to allow for efficient exchange between various types of digital assets and, more importantly, of providing a mechanism for paying transaction fees. For convenience and to avoid future argument (see the current mBTC/uBTC/satoshi debate in Bitcoin), the denominations will be pre-labelled:以太坊网络包括自己的内置货币,ether,它服务于如下双重目的,提供主要流动性层,以实现各种数字资产之间的有效交换,更重要的是,提供支付交易费用的机制。 为了方便和避免未来的争论(参见比特币当前的mBTC / uBTC / satoshi辩论),这些面值将被预先标记:1: wei10^12: szabo10^15: finney10^18: etherThis should be taken as an expanded version of the concept of "dollars" and "cents" or "BTC" and "satoshi". In the near future, we expect "ether" to be used for ordinary transactions, "finney" for microtransactions and "szabo" and "wei" for technical discussions around fees and protocol implementation; the remaining denominations may become useful later and should not be included in clients at this point.这应该被视为“美元”和“美分”或“BTC”和“satoshi”概念的扩展版本。 在不久的将来,我们期望“ether”用于普通交易,“finney”用于微交易,“szabo”和“wei”用于费用和协议实施的技术讨论; 其余的面值可能会稍后变得有用,此时不应包含在客户端中。The issuance model will be as follows:发行模型将会是如下这样:Ether will be released in a currency sale at the price of 1000-2000 ether per BTC, a mechanism intended to fund the Ethereum organization and pay for development that has been used with success by other platforms such as Mastercoin and NXT. Earlier buyers will benefit from larger discounts. The BTC received from the sale will be used entirely to pay salaries and bounties to developers and invested into various for-profit and non-profit projects in the Ethereum and cryptocurrency ecosystem.以太网将以 1000-2000ether/BTC 的价格进行货币销售,这一机制旨在为以太坊组织提供资金,并支付开发者报酬,这一方式已被其他平台(如Mastercoin和NXT)成功使用。 较早的买家将受益于较大的折扣。 从销售中获得的BTC将完全用于向开发者支付薪水和奖金,并投资于以太坊和加密货币生态系统中的各种营利和非盈利项目。0.099x the total amount sold (60102216 ETH) will be allocated to the organization to compensate early contributors and pay ETH-denominated expenses before the genesis block.已售出总金额(60102216 ETH)的0.099x将分配给组织,以补偿早期贡献者,用以太币计价的方式支付在创世块诞生前的花费。0.099x the total amount sold will be maintained as a long-term reserve.已售总额的0.099将作为长期储备而保持。0.26x the total amount sold will be allocated to miners per year forever after that point.已售总额的0.26将每年被矿工挖出。Long-Term Supply Growth Rate (percent) 长期供应增长率(百分比)Despite the linear currency issuance, just like with Bitcoin over time the supply growth rate nevertheless tends to zero除了线性的发行方式外,与比特币一样,随着时间的推移货币供应的增长率将无限接近0The two main choices in the above model are (1) the existence and size of an endowment pool, and (2) the existence of a permanently growing linear supply, as opposed to a capped supply as in Bitcoin. The justification of the endowment pool is as follows. If the endowment pool did not exist, and the linear issuance reduced to 0.217x to provide the same inflation rate, then the total quantity of ether would be 16.5% less and so each unit would be 19.8% more valuable. Hence, in the equilibrium 19.8% more ether would be purchased in the sale, so each unit would once again be exactly as valuable as before. The organization would also then have 1.198x as much BTC, which can be considered to be split into two slices: the original BTC, and the additional 0.198x. Hence, this situation is exactly equivalent to the endowment, but with one important difference: the organization holds purely BTC, and so is not incentivized to support the value of the ether unit.上述模型中的两个主要选择是(1)禀赋(译注:初始拥有的资源,详见知乎)池的存在和规模,以及(2)存在一个永久增长的线性供给,而不是像比特币那样的总量限制供给。 禀赋池存在的理由如下。 如果禀赋池不存在,线性发行量将减少到0.217x以提供相同的通货膨胀率,那么ether的总量将减少16.5%,因此每个单位的价值将增加19.8%。 因此,在平衡销售中,19.8%的ether将会被购买,所以每个单位将再次与以前一样有价值。 组织还将拥有与BTC等值的1.198x以太币,这可以被认为分为两部分:最初的BTC和额外的0.198x。 因此,这种情况与禀赋完全相同,但有一个重要区别:组织持有的是纯粹的BTC,因此并不支持以太币单位的价值。The permanent linear supply growth model reduces the risk of what some see as excessive wealth concentration in Bitcoin, and gives individuals living in present and future eras a fair chance to acquire currency units, while at the same time retaining a strong incentive to obtain and hold ether because the "supply growth rate" as a percentage still tends to zero over time. We also theorize that because coins are always lost over time due to carelessness, death, etc, and coin loss can be modeled as a percentage of the total supply per year, that the total currency supply in circulation will in fact eventually stabilize at a value equal to the annual issuance divided by the loss rate (eg. at a loss rate of 1%, once the supply reaches 26X then 0.26X will be mined and 0.26X lost every year, creating an equilibrium).永久性线性供给增长模型降低了一些人认为比特币中财富过度集中的风险,并且使得生活在当前和未来时代的个人有一个获得货币的公平机会,同时保留强烈的获取和持有动机,因为随着时间的推移,“供应增长率”百分比将趋近于零。 我们还可以从理论上证明,因为粗心大意,死亡等原因,以太币总是会随时间而减少,而以太币的流失可以模拟为每年总供给的百分比,因此流通中的货币总量实际上最终会稳定在一个数值,等于年发行额除以损失率(例如损失率为1%,一旦供应量达到26X,那么将开采0.26X,每年损失0.26X,创造均衡)。Note that in the future, it is likely that Ethereum will switch to a proof-of-stake model for security, reducing the issuance requirement to somewhere between zero and 0.05X per year. In the event that the Ethereum organization loses funding or for any other reason disappears, we leave open a "social contract": anyone has the right to create a future candidate version of Ethereum, with the only condition being that the quantity of ether must be at most equal to 60102216 * (1.198 + 0.26 * n) where n is the number of years after the genesis block. Creators are free to crowd-sell or otherwise assign some or all of the difference between the PoS-driven supply expansion and the maximum allowable supply expansion to pay for development. Candidate upgrades that do not comply with the social contract may justifiably be forked into compliant versions.请注意,在未来,以太坊很可能会转而采用权益证明模式来确保安全性,将发行要求降低至每年0至0.05X之间。 如果以太坊组织失去资金或出于任何其他原因而消失,我们将开放一个“社会契约”:任何人都有权创建一个未来候选版本的以太坊,唯一的条件是以太币的数量必须是 最多等于60102216 *(1.198 + 0.26 * n),其中n是创始块产生后的年数。 创建者可以自由地通过众筹或以其他方式分配PoS驱动的供应扩展和最大允许供应扩展之间的部分或全部差异,以支付开发费用。 不符合社区合约的候选版本的升级可能被合理地分叉为兼容版本。Mining Centralization 挖矿中心化The Bitcoin mining algorithm works by having miners compute SHA256 on slightly modified versions of the block header millions of times over and over again, until eventually one node comes up with a version whose hash is less than the target (currently around 2192). However, this mining algorithm is vulnerable to two forms of centralization. First, the mining ecosystem has come to be dominated by ASICs (application-specific integrated circuits), computer chips designed for, and therefore thousands of times more efficient at, the specific task of Bitcoin mining. This means that Bitcoin mining is no longer a highly decentralized and egalitarian pursuit, requiring millions of dollars of capital to effectively participate in. Second, most Bitcoin miners do not actually perform block validation locally; instead, they rely on a centralized mining pool to provide the block headers. This problem is arguably worse: as of the time of this writing, the top three mining pools indirectly control roughly 50% of processing power in the Bitcoin network, although this is mitigated by the fact that miners can switch to other mining pools if a pool or coalition attempts a 51% attack.比特币挖掘算法的工作原理是,让矿工们一次又一次地对块头进行修改过的版本进行SHA256计算,直到一个节点产生一个散列值小于目标的值(当前大约在2^192)。但是,这种挖掘算法容易受到两种形式的集中管理的伤害。第一种,挖矿生态系统已经被ASIC(专用集成电路),计算机芯片所主宰,这些芯片被设计用于比特币挖矿的特定任务,因此效率高出数千倍。这意味着比特币挖掘不再是一种高度分散的和平等的追求,需要数百万美元的资金才能有效参与。第二种,大多数比特币矿工实际上并未在本地进行块验证;相反,他们依靠中央采矿池来提供块头。这个问题可以说是更糟的:截至撰写本文时,前三位的矿池共同间接控制了比特币网络中大约50%的处理能力,虽然在有矿池或联盟试图发起51%攻击时,矿工们可以转移到其他矿池,来减轻这个问题。The current intent at Ethereum is to use a mining algorithm where miners are required to fetch random data from the state, compute some randomly selected transactions from the last N blocks in the blockchain, and return the hash of the result. This has two important benefits. First, Ethereum contracts can include any kind of computation, so an Ethereum ASIC would essentially be an ASIC for general computation - ie. a better CPU. Second, mining requires access to the entire blockchain, forcing miners to store the entire blockchain and at least be capable of verifying every transaction. This removes the need for centralized mining pools; although mining pools can still serve the legitimate role of evening out the randomness of reward distribution, this function can be served equally well by peer-to-peer pools with no central control.以太坊目前的意图是使用挖掘算法,矿工需要从状态中提取随机数据,计算区块链中最后N个块的一些随机选择的交易,并返回结果的散列值。 这有两个重要的好处。 首先,以太坊合约可以包括任何种类的计算,因此以太坊ASIC本质上只能当成一般计算的ASIC -例如, 一个更好的CPU。 其次,采矿需要访问整个区块链,迫使矿工存储整个区块链,并至少能够验证每笔交易。 这消除了对集中式矿池的需求; 虽然矿池仍然可以起到平衡奖励分配随机性的合法作用,但这种功能可以通过没有中央控制的对等池进行同样的服务。This model is untested, and there may be difficulties along the way in avoiding certain clever optimizations when using contract execution as a mining algorithm. However, one notably interesting feature of this algorithm is that it allows anyone to "poison the well", by introducing a large number of contracts into the blockchain specifically designed to stymie certain ASICs. The economic incentives exist for ASIC manufacturers to use such a trick to attack each other. Thus, the solution that we are developing is ultimately an adaptive economic human solution rather than purely a technical one.该模型未经测试,在使用合约执行作为挖掘算法时,避免某些巧妙的优化方法可能会遇到困难。 然而,这种算法的一个值得注意的特点是,它允许任何人通过将大量合约引入专门设计用于阻碍特定ASIC的运行,这好比“井里下毒”。由于经济激励措施存在,ASIC制造商会使用这种技巧来进行互相攻击。 因此,我们正在开发的解决方案最终是一种,适应的经济人,而非纯粹的技术解决方案。Scalability 可扩展性One common concern about Ethereum is the issue of scalability. Like Bitcoin, Ethereum suffers from the flaw that every transaction needs to be processed by every node in the network. With Bitcoin, the size of the current blockchain rests at about 15 GB, growing by about 1 MB per hour. If the Bitcoin network were to process Visa's 2000 transactions per second, it would grow by 1 MB per three seconds (1 GB per hour, 8 TB per year). Ethereum is likely to suffer a similar growth pattern, worsened by the fact that there will be many applications on top of the Ethereum blockchain instead of just a currency as is the case with Bitcoin, but ameliorated by the fact that Ethereum full nodes need to store just the state instead of the entire blockchain history.关于以太坊的一个常见问题是可扩展性问题。 和比特币一样,以太坊也面临着每个交易需要由网络中的每个节点处理的缺陷。 使用比特币,目前区块链的规模约为15 GB,每小时增长约1 MB。 如果比特币网络每秒处理Visa 2000次交易,则每三秒钟增长1MB(每小时1GB,每年8TB)。 以太坊可能会遭受类似的增长模式,事实上更糟糕的是,在以太坊区块链上将会有许多应用程序,而不仅仅是像比特币一样的货币,但是由于事实上的改进,以太坊全节点需要存储的只是状态而不是整个区块链历史。The problem with such a large blockchain size is centralization risk. If the blockchain size increases to, say, 100 TB, then the likely scenario would be that only a very small number of large businesses would run full nodes, with all regular users using light SPV nodes. In such a situation, there arises the potential concern that the full nodes could band together and all agree to cheat in some profitable fashion (eg. change the block reward, give themselves BTC). Light nodes would have no way of detecting this immediately. Of course, at least one honest full node would likely exist, and after a few hours information about the fraud would trickle out through channels like Reddit, but at that point it would be too late: it would be up to the ordinary users to organize an effort to blacklist the given blocks, a massive and likely infeasible coordination problem on a similar scale as that of pulling off a successful 51% attack. In the case of Bitcoin, this is currently a problem, but there exists a blockchain modification suggested by Peter Todd which will alleviate this issue.如此大的区块链的问题是集中化风险。如果区块链大小增加到100TB,那么可能的情况是只有极少数的大型企业会运行全节点,所有普通用户都使用轻型SPV节点。在这种情况下,可能会出现这样的担忧:全部节点可以连接在一起,并且都同意以某种有利的方式作弊(例如,改变块奖励,给自己BTC)。轻节点将无法立即检测到这一点。当然,至少有一个诚实的完整节点可能存在,几个小时后,关于欺诈的信息将通过像Reddit这样的渠道流淌出来,但那时就太迟了:要由普通用户组织起来努力将给定的区块列入黑名单,这是一个巨大而且不可行的协调问题,在类似的规模上,这相当于成功抵御51%攻击。就比特币而言,目前这是一个问题,但是彼得托德提出的区块链修改建议会缓解这个问题。In the near term, Ethereum will use two additional strategies to cope with this problem. First, because of the blockchain-based mining algorithms, at least every miner will be forced to be a full node, creating a lower bound on the number of full nodes. Second and more importantly, however, we will include an intermediate state tree root in the blockchain after processing each transaction. Even if block validation is centralized, as long as one honest verifying node exists, the centralization problem can be circumvented via a verification protocol. If a miner publishes an invalid block, that block must either be badly formatted, or the state S[n] is incorrect. Since S[0] is known to be correct, there must be some first state S[i] that is incorrect where S[i-1] is correct. The verifying node would provide the index i, along with a "proof of invalidity" consisting of the subset of Patricia tree nodes needing to process APPLY(S[i-1],TX[i]) -> S[i]. Nodes would be able to use those nodes to run that part of the computation, and see that the S[i] generated does not match the S[i] provided.在短期内,以太坊将采用另外两种策略来解决这个问题。首先,由于基于区块链的挖掘算法,至少每个矿工将被迫成为一个完整的节点,从而在全节点的数量上形成了一个下限。其次,更重要的是,在处理每个交易之后,我们将在区块链中包含一个中间状态树根。即使块验证是集中式的,只要存在一个诚实的验证节点,集中问题就可以通过验证协议规避。如果一个矿工发布了一个无效块,那么该块必须格式化得很差,或者状态S [n]不正确。由于已知S [0]是正确的,所以在S [i-1]正确的情况下,必定有一些第一状态S [i]不正确。验证节点将提供索引 i 以及由需要处理APPLY(S [i-1],TX [i]) - > S [i]的Patricia树节点的子集组成的“无效证明”。节点将能够使用这些节点来运行该部分计算,并且看到生成的S [i]与提供的S [i]不匹配。Another, more sophisticated, attack would involve the malicious miners publishing incomplete blocks, so the full information does not even exist to determine whether or not blocks are valid. The solution to this is a challenge-response protocol: verification nodes issue "challenges" in the form of target transaction indices, and upon receiving a node a light node treats the block as untrusted until another node, whether the miner or another verifier, provides a subset of Patricia nodes as a proof of validity.另一个更复杂的攻击将涉及恶意的矿工发布不完整的块,因此甚至不存在全部信息来确定块是否有效。 对此的解决方案是 质疑-响应 协议:验证节点以目标交易索引的形式发出“质疑”,接收到信息的节点,轻节点将该块视为不可信,直到另一节点(无论是矿工还是另一验证者)提供Patricia 节点的一个子集作为有效性的证明。Conclusion 结论The Ethereum protocol was originally conceived as an upgraded version of a cryptocurrency, providing advanced features such as on-blockchain escrow, withdrawal limits, financial contracts, gambling markets and the like via a highly generalized programming language. The Ethereum protocol would not "support" any of the applications directly, but the existence of a Turing-complete programming language means that arbitrary contracts can theoretically be created for any transaction type or application. What is more interesting about Ethereum, however, is that the Ethereum protocol moves far beyond just currency. Protocols around decentralized file storage, decentralized computation and decentralized prediction markets, among dozens of other such concepts, have the potential to substantially increase the efficiency of the computational industry, and provide a massive boost to other peer-to-peer protocols by adding for the first time an economic layer. Finally, there is also a substantial array of applications that have nothing to do with money at all.以太坊协议最初被设想为加密货币的升级版本,通过高度通用的编程语言提供高级功能,如区块链托管,取款限制,金融合约,赌博市场等。以太坊协议不会直接“支持”任何应用程序,但是图灵完备的编程语言的存在意味着可以在理论上为任何交易类型或应用程序创建任意合约。然而,以太坊更有趣的是以太坊协议远远超出了货币。有关分布式文件存储,分布式计算和分布式预测市场的协议,以及其他几十种这样的概念,都有可能极大提高计算行业的效率,并首次通过添加经济层为其他P2P协议提供有力的支撑。最后,还有大量与金钱无关的应用程序。The concept of an arbitrary state transition function as implemented by the Ethereum protocol provides for a platform with unique potential; rather than being a closed-ended, single-purpose protocol intended for a specific array of applications in data storage, gambling or finance, Ethereum is open-ended by design, and we believe that it is extremely well-suited to serving as a foundational layer for a very large number of both financial and non-financial protocols in the years to come.由以太坊协议实施的任意状态转换功能的概念提供了一个具有独特潜力的平台; 而不是一个封闭式的单一用途协议,专门用于数据存储,赌博或金融领域的特定应用。以太坊在设计上是开放式的,在今后几年中,我们相信它非常适合作为大量的财务和非财务协议的基础协议。Notes and Further Reading 注释与延伸阅读Notes 注释A sophisticated reader may notice that in fact a Bitcoin address is the hash of the elliptic curve public key, and not the public key itself. However, it is in fact perfectly legitimate cryptographic terminology to refer to the pubkey hash as a public key itself. This is because Bitcoin's cryptography can be considered to be a custom digital signature algorithm, where the public key consists of the hash of the ECC pubkey, the signature consists of the ECC pubkey concatenated with the ECC signature, and the verification algorithm involves checking the ECC pubkey in the signature against the ECC pubkey hash provided as a public key and then verifying the ECC signature against the ECC pubkey.一个有经验的读者可能会注意到,实际上比特币地址是椭圆曲线公钥的散列值,而不是公钥本身。 然而,事实上,将公钥散列作为公钥本身就是完全合法的加密术语。 这是因为比特币的密码学可以被认为是一种自定义的数字签名算法,其中公钥由ECC公钥的散列组成,签名由与ECC签名串联的ECC公钥组成,并且验证算法涉及检查ECC 签名中的公钥与作为公钥提供的ECC 公钥哈希签名,然后根据ECC pubkey验证ECC签名。Technically, the median of the 11 previous blocks. 从技术上来看,前11个区块的中位数Internally, 2 and "CHARLIE" are both numbers, with the latter being in big-endian base 256 representation. Numbers can be at least 0 and at most 2256-1.在内部,2和“CHARLIE”都是数字,后一个有巨大的base256编码格式。 数字从0到2^256-1不等。Further Reading 延伸阅读Intrinsic value: http://bitcoinmagazine.com/8640/an-exploration-of-intrinsic-value-what-it-is-why-bitcoin-doesnt-have-it-and-why-bitcoin-does-have-it/Smart property: https://en.bitcoin.it/wiki/Smart_PropertySmart contracts: https://en.bitcoin.it/wiki/ContractsB-money: http://www.weidai.com/bmoney.txtReusable proofs of work: http://www.finney.org/~hal/rpow/Secure property titles with owner authority: http://szabo.best.vwh.net/securetitle.htmlBitcoin whitepaper: http://bitcoin.org/bitcoin.pdfNamecoin: https://namecoin.org/Zooko's triangle: http://en.wikipedia.org/wiki/Zooko's_triangleColored coins whitepaper: https://docs.google.com/a/buterin.com/document/d/1AnkP_cVZTCMLIzw4DvsW6M8Q2JC0lIzrTLuoWu2z1BE/editMastercoin whitepaper: https://github.com/mastercoin-MSC/specDecentralized autonomous corporations, Bitcoin Magazine: http://bitcoinmagazine.com/7050/bootstrapping-a-decentralized-autonomous-corporation-part-i/Simplified payment verification: https://en.bitcoin.it/wiki/Scalability#SimplifiedpaymentverificationMerkle trees: http://en.wikipedia.org/wiki/Merkle_treePatricia trees: http://en.wikipedia.org/wiki/Patricia_treeGHOST: https://eprint.iacr.org/2013/881.pdfStorJ and Autonomous Agents, Jeff Garzik: http://garzikrants.blogspot.ca/2013/01/storj-and-bitcoin-autonomous-agents.htmlMike Hearn on Smart Property at Turing Festival: http://www.youtube.com/watch?v=Pu4PAMFPo5YEthereum RLP: https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLPEthereum Merkle Patricia trees: https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-Patricia-TreePeter Todd on Merkle sum trees: http://sourceforge.net/p/bitcoin/mailman/message/31709140/编辑于 2018-02-23 16:09白皮书​赞同 86​​5 条评论​分享​喜欢​收藏​申请转载​文章被以下专栏收录BTC深入浅出BTC是最大的共识链链布网区块链知

翻译人员指南 | ethereum.org

指南 | ethereum.org跳转至主要内容学习用法构建参与研究搜索​​​​语言 ZH帮助更新此页面本页面有新版本,但现在只有英文版。请帮助我们翻译最新版本。翻译页面没有错误!此页面未翻译,因此特意以英文显示。不再显示首页/参与贡献/翻译计划/translators-guide页面最后更新: 2023年12月8日在本页面使用 Crowdin抓取信息的实质内容正式与非正式简单明了的词汇和意思书写系统翻译页面元数据外文标题Crowdin 警告处理标签和代码片段简短与完整形式/缩写没有既定翻译的术语按钮与行动号召翻译包容性特定语言的翻译标点、格式格式总结Ethereum.org 翻译风格指南Ehereum.org 翻译风格指南包含一些最重要的指南、说明和翻译技巧,帮助我们对网站进行本地化。本文档是一份一般性指南,并不特定于任何一种语言。如果您有任何问题、建议或反馈,请随时通过 translations@ethereum.org(opens in a new tab) 与我们联系,在 Crowdin 上向 @ethdotorg 发送消息,或 加入我们的 Discord(opens in a new tab),您可以在其中通过#translations 频道向我们发送消息或联系任何团队成员。使用 Crowdin您可以在翻译计划页面上找到有关如何在 Crowdin 中加入项目以及如何使用 Crowdin 在线编辑器的基本说明。如果您想了解更多关于 Crowdin 并使用它的一些高级功能,Crowdin 知识库(opens in a new tab)包含很多所有 Crowdin 功能的深入指南和概述。抓取信息的实质内容当翻译 ethereum.org 内容时,避免直译。重要的是翻译要抓住信息的本质。 这可能意味着改写某些短语,或者使用描述性翻译而不是逐字翻译内容。不同的语言有不同的语法规则、约定和词序。 翻译时,请注意目标语言中句子的结构,避免按字面翻译英文源,因为这会导致句子结构和可读性差。建议您阅读整个句子并对其进行调整以适应目标语言的惯例,而不是逐字翻译源文本。正式与非正式我们使用正式的地址形式,这对所有访客来说始终是礼貌和适当的。使用正式地址可以让我们避免听起来不官方或冒犯,并且无论访客的年龄和性别如何都可以工作。大多数印欧语和亚非语语言使用特定性别的第二人称人称代词,以区分男性和女性。 在称呼用户或使用所有格代词时,我们可以避免假设访问者的性别,因为正式的地址形式通常适用且一致,无论他们如何识别。简单明了的词汇和意思我们的目标是让尽可能多的人能够理解网站上的内容。在大多数情况下,这可以通过使用易于理解的简短单词轻松实现。 如果您的语言中具有相同含义的某个单词有多种可能的翻译,那么最好的选择通常是清楚地反映含义的最短单词。书写系统Ethereum.org 提供多种语言版本,使用替代拉丁文的书写系统(或书写脚本)。所有内容都应使用适合您的语言的正确书写系统进行翻译,并且不应包含使用拉丁字符书写的任何单词。翻译内容时,应确保翻译内容一致且不包含任何拉丁字符。一个常见的误解是,Ethereum 一直是用拉丁文书写。 这大部分是不正确的,请使用您的母语拼写 Ethereum(例如:中文的以太坊,阿拉伯语的 إيثيريوم 等)。以上规则不适用于通常不应翻译专有名词的语言。翻译页面元数据某些页面包含页面上的元数据,例如“title”、“lang”、“description”、“sidebar”等。在将新页面上传到 Crowdin 时,我们隐藏了翻译人员不应翻译的内容,这意味着 Crowdin 中翻译人员可见的所有元数据都应该被翻译。翻译源文本为“en”的任何字符串时,请特别注意。 这表示页面可用的语言,应翻译为您的语言的 ISO 语言代码(opens in a new tab)。 这些字符串应始终使用拉丁字符而不是目标语言原生的书写脚本进行翻译。如果您不确定要使用哪种语言代码,您可以查看 Crowdin 中的翻译记忆库,或在 Crowdin 在线编辑器的页面 URL 中找到您的语言的语言代码。使用最广泛的语言的语言代码示例:阿拉伯语 - ar简体中文 - zh法语 - fr印地语 - hi西班牙语 - es外文标题一些字符串包含外部文章的标题。 我们的大多数开发人员文档页面都包含指向外部文章的链接,以供进一步阅读。 无论文章的语言如何,都需要翻译包含文章标题的字符串,以确保以他们的语言查看页面的访问者获得更一致的用户体验。您可以在下面找到一些示例,说明这些字符串对于翻译人员的外观以及如何识别它们(文章链接主要位于这些页面的底部,位于“进一步阅读”部分): Crowdin 警告Crowdin 有一个内置功能,可以在翻译人员即将出错时发出警告。 在保存翻译之前,如果您忘记在译文中加上原文中的标签、翻译了不应翻译的元素、添加了多个连续的空格、忘记结尾标点等,Crowdin 会自动提醒您。 如果您看到这样的警告,请返回并仔细检查建议的翻译。永远不要忽略这些警告,因为它们通常意味着有问题,或者翻译缺少源文本的关键部分。当您忘记在翻译中添加标签时出现 Crowdin 警告的示例: 处理标签和代码片段许多源内容包含标签和变量,它们在 Crowdin 编辑器中以黄色突出显示。 它们具有不同的功能,应该正确处理。Crowdin 设置为了更轻松地管理标签并直接从源中复制它们,我们建议你在 Crowdin 编辑器中更改你的设置。打开“设置” 向下滚动到“HTML 标签显示”部分选择“隐藏” 点击“保存”通过选择此选项,完整的标签文本将不再显示,而是由一个数字代替。 翻译时,点击此标签会自动将确切的标签复制到翻译字段。链接你可能会注意到 ethereum.org 或其他网站上的页面的完整链接。这些链接应该与源相同,并且不要更改或翻译。 如果你翻译了链接或以任何方式更改了链接,即使只是删除其中的一部分,如斜杠 (/),也将导致链接损坏且不可用。处理链接的最佳方法是直接从源中复制它们,方法是点击它们或使用“复制源”按钮 (Alt+C)。链接也以标签的形式出现在源文本中(即 <0> )。 如果你将鼠标悬停在标签上,编辑器将显示其全部内容 - 有时这些标签将代表链接。从源复制链接而不要更改其顺序,这一点非常重要。如果标签的顺序发生变化,它们所代表的链接将被破坏。标签和变量源文本包含许多不同类型的标签,这些标签应始终从源中复制并且永远不要更改。 与上述类似,这些标签在翻译中的顺序也应与源相同。标签总是包含一个开始和结束标签。 在大多数情况下,应该翻译开始和结束标签之间的文本。示例:Decentralized - 使文本变粗的开始标签Decentralized - 可翻译文本 - 结束标签代码片段的处理方式与其他标签略有不同,因为它们包含不应翻译的代码。示例:nonce - 开始标签,其中包含一段代码nonce - 不可翻译的文本 - 结束标签源文本还包含缩短的标签,这些标签只包含数字,这意味着它们的功能不是很明显。 你可以将鼠标悬停在这些标签上,以准确查看它们提供的功能。在下面的示例中,你可以看到,将鼠标悬停在 <0> 标签显示,它代表 并包含代码片段,因此不应翻译这些标签内的内容。简短与完整形式/缩写网站上使用了很多缩写,例如 dApp、NFT、DAO、DeFi 等。 这些缩写通常用于英语,并且大多数网站访问者都熟悉它们。由于它们通常没有其他语言的既定翻译,处理这些和类似术语的最佳方法是提供完整形式的描述性翻译,并在括号中添加英文缩写。不要翻译这些缩写,因为大多数人不熟悉它们,而且本地化版本对大多数访问者来说没有多大意义。如何翻译 dApp 的示例:Decentralized applications (dapps) → 完整的翻译形式 (括号中为英文缩写)没有既定翻译的术语某些术语在其他语言中可能没有既定翻译,并且以原始英语术语而广为人知。 这些术语主要包括较新的概念,如工作量证明、权益证明、信标链、质押等。虽然翻译这些术语听起来不自然,但由于英文版本也常用于其他语言,因此强烈建议将它们翻译。翻译它们时,请随意发挥创意,使用描述性翻译,或直接按字面翻译。大多数术语应该翻译而不是将其中一些保留英文的原因是,随着越来越多的人开始使用以太坊和相关技术,这种新术语将在未来变得更加普遍。 如果我们想让来自世界各地的更多人加入这个领域,我们需要以尽可能多的语言提供易于理解的术语,即使我们需要自行创建它。按钮与行动号召网站包含许多按钮,其翻译方式应与其他内容不同。可以通过查看上下文屏幕截图、与大多数字符串连接或通过检查编辑器中的上下文(包括短语“button”)来识别按钮文本。按钮的翻译应尽可能简短,以防止格式不匹配。 此外,按钮翻译应该是必要的,即呈现命令或请求。翻译包容性Ethereum.org 的访问者来自世界各地和不同的背景。 因此,网站上的语言应该是中立的,欢迎所有人而不是排他性的。其中一个重要方面是性别中立。 这可以通过使用正式的地址形式并避免在翻译中使用任何特定性别的词来轻松实现。另一种形式的包容性是,尝试面向全球观众翻译,而不是面向任何国家、种族或地区。最后,语言应该适合所有大众和年龄段的读者。特定语言的翻译翻译时,重要的是要遵循你的语言中使用的语法规则、约定和格式,而不是从源复制。 源文本遵循英语语法规则和约定,而这不适用于许多其他语言。你应该了解你的语言规则并进行相应的翻译。 如果你需要帮助,请与我们联系,我们将帮助你找到一些有关如何在你的语言中使用这些元素的资源。一些需要特别注意的例子:标点、格式大写不同语言的大小写存在巨大差异。在英语中,通常将标题和名称、月份和日期、语言名称、假期等中的所有单词大写。 在许多其他语言中,这在语法上是不正确的,因为它们具有不同的大小写规则。一些语言也有关于人称代词、名词和某些形容词大写的规则,这些在英语中是不大写的。间距正字法规则定义了每种语言的空格使用。 因为到处都使用空格,所以这些规则是最独特的,而空格是最容易误译的元素。英语和其他语言之间的一些常见间距差异:计量单位和货币前的空格(例如 USD、EUR、kB、MB)度数符号前的空格(例如 °C、℉)一些标点符号前的空格,尤其是省略号 (...)斜杠前后的空格 (/)列表每种语言都有一套多样化和复杂的规则来编写列表。 这些可能与英语有很大不同。在某些语言中,每个新行的第一个单词需要大写,而在其他语言中,新行应该以小写字母开头。 许多语言对列表中的大小写也有不同的规则,具体取决于每行的长度。这同样适用于行项目的标点符号。 列表中的结束标点可以是句点 (.)、逗号 (,) 或分号 (;)具体取决于语言引号语言使用许多不同的引号。 简单地从源中复制英文引号通常是不正确的。一些最常见的引号类型包括:“示例文本”‘示例文本’»示例文本«“示例文本”‘示例文本’«示例文本»连字符和破折号在英语中,连字符 (-) 用于连接单词或单词的不同部分,而破折号 (-) 用于表示范围或停顿。许多语言对使用连字符和破折号有不同的规则,应遵守这些规则。格式数字用不同语言书写数字的主要区别在于用于小数和千位的分隔符。 对于千数来说,这可以是句号、逗号或空格。 同样,一些语言使用小数点,而另一些语言使用小数点逗号。一些大数的例子:英语 - 1,000.50西班牙语 - 1.000,50法语 - 1 000,50翻译数字时的另一个重要考虑因素是百分号。 它可以用不同的方式编写:100%、100 % 或 %100。最后,负数可以不同地显示,具体取决于语言:-100、100-、(100) 或 [100]。日期在翻译日期时,有许多基于语言的考虑因素和差异。 这些包括日期格式、分隔符、大写和前导零。 全长日期和数字日期之间也存在差异。不同日期格式的一些示例:英语(英国)(dd/mm/yyyy) – 1st January, 2022英语(美国)(mm/dd/yyyy) – January 1st, 2022中文 (yyyy-mm-dd) – 2022 年 1 月 1 日法语 (dd/mm/yyyy) – 1er janvier 2022意大利语 (dd/mm/yyyy) – 1º gennaio 2022德语 (yyyy/mm/dd) – 1. Januar 2022货币由于格式、惯例和转换不同,货币转换可能具有挑战性。 作为一般规则,请保持货币与来源相同。 为了读者的利益,您可以在括号中添加您的当地货币和转换。用不同语言书写货币的主要区别包括符号位置、小数逗号与小数点、间距以及缩写与符号。符号放置:美元 100 或 100 美元小数逗号和。小数点:100,50$ 或 100.50$间距:100 美元或 100 美元缩写和符号:100$ 或 100 USD计量单位作为一般规则,请根据来源保留计量单位。 如果您所在的国家/地区使用不同的系统,您可以将转换包括在括号中。除了度量单位的本地化之外,注意语言处理这些单位的方式的差异也很重要。 主要区别在于数字和单位之间的间距,可以根据语言而有所不同。 这方面的示例包括 100kB 与 100 kB 或 50ºF 与 50ºF。总结翻译 ethereum.org 是了解以太坊不同方面的绝佳机会。翻译时尽量不要着急。 放轻松,玩得开心!感谢你参与翻译计划并帮助我们让更广泛的受众可以访问网站。 以太坊社区是全球性的,我们很高兴你也成为其中的一员!本文对你有帮助吗?是否编辑页面(opens in a new tab)在本页面使用 Crowdin抓取信息的实质内容正式与非正式简单明了的词汇和意思书写系统翻译页面元数据外文标题Crowdin 警告处理标签和代码片段简短与完整形式/缩写没有既定翻译的术语按钮与行动号召翻译包容性特定语言的翻译标点、格式格式总结网站最后更新: 2024年2月16日(opens in a new tab)(opens in a new tab)(opens in a new tab)使用以太坊查找钱包获取以太币Dapps - 去中心化应用二层网络运行节点稳定币质押ETH学习学习中心什么是以太坊?什么是以太币 (ETH)?以太坊钱包Gas fees以太坊安全和预防欺诈措施什么是 Web3?智能合约以太坊能源消耗以太坊路线图以太坊改进提案 (Eip)以太坊的历史以太坊白皮书以太坊词汇表以太坊治理区块链桥零知识证明测试中心开发者开始体验相关文档教程通过编码来学习设置本地环境生态系统社区中心以太坊基金会以太坊基金会的博客(opens in a new tab)生态系统支持方案(opens in a new tab)以太坊漏洞悬赏计划生态系统资助计划以太坊品牌资产Devcon(opens in a new tab)企业级应用主网以太坊私密以太坊企业级应用关于ethereum.org关于我们工作机会参与贡献语言支持隐私政策使用条款缓存政策联系我们(opens in a new t

你好,世界 | 为我们的全球社区翻译 Ethereum.org | 以太坊基金会博客

界 | 为我们的全球社区翻译 Ethereum.org | 以太坊基金会博客以太坊基金会博客搜索跳转到内容分类研发 研究与开发活动 活动组织 组织内部资料生态系统支持计划 生态系统支持计划ETH.org Ethereum.org安全 安全性NxBn Next Billion协议 协议公告语言搜索该帖子有 7 语言 版本: 简体中文你好,世界 | 为我们的全球社区翻译 Ethereum.org由 Ethereum.org Team 发布于 2019年8月20日Ethereum.org我们很高兴地宣布启动一项大规模的 Ethereum.org 翻译计划,该网站和其他资源最终将翻译为 15 种以上的语言。

以太坊是一个全球项目,因此 ethereum.org 有必要反映我们全球社区的特点。自该网站重新上线以来,我们的团队已优先筹备了一项翻译计划,该计划可确保每个人无论其国籍或语言是什么,都能获得关于以太坊的资源。

今天,我们无比激动地推出首个全文译本:网站的韩语版,现在可访问 ethereum.org/ko 获取。 接下来的几周,我们的计划将继续推进,首批主要完成简体中文、日语、俄语、德语和意大利语的翻译。选择这第一批语言的依据是以太坊和相关词语的搜索量以及访问以太坊相关网站的流量。

虽然这项工作最初主要是翻译 Ethereum.org,但将逐渐扩大范围,纳入文档、指南、博文等重要第三方资源的翻译。

该翻译计划将志愿者参与的翻译、以太坊基金会团队进行的项目管理以及专业翻译服务(如需填补空缺或提供审核)相结合。

您是否有兴趣帮助开展某种特定语言的翻译工作? 我们正在从全球的以太坊社区寻找志愿者加入特定语言的翻译团队。我们希望您在此提出申请,随后我们的翻译团队会与您联系。

以太坊是全人类的重要基础设施,因此 Ethereum.org 应反映世界各地定期举行的编程马拉松和其他活动中展现的多元化。通过今天推出 ethereum.org/ko 和 Ethereum.org 翻译计划,我们已经朝着反映我们生态系统中最重要的一环—我们的社区—更进了一步。

特别感谢主持该翻译计划的 Taeyeon Kim 以及翻译 ethereum.org/ko 的志愿者团队:Daniel Jee、Hyungsuk Kang、Jeongmoo Heo、Jumin Lee、Sangphil Kim、Suhun Kim、Wanseob Lim、Yeong Hun Ryu。这篇帖子从英文翻译而来,因此可能不完全准确,也不是最新内容。原版可在 英语 中找到。上一个帖子下一个帖子订阅协议公告注册以接收协议相关公告的电子邮件通知,如网络升级、常见问题或安全问题。你可以随时选择不接收这些通知。注册以太坊基金会•Ethereum.org•生态系统支持计划•漏洞奖励计划•不跟踪•存档分类研究与开发•活动•组织内部资料•生态系统支持计划•Ethereum.org•安全性•Next Billion•协

以太坊白皮书 | ethereum.org

皮书 | ethereum.org跳转至主要内容学习用法构建参与研究搜索​​​​语言 ZH帮助更新此页面本页面有新版本,但现在只有英文版。请帮助我们翻译最新版本。翻译页面没有错误!此页面未翻译,因此特意以英文显示。不再显示首页/whitepaper页面最后更新: 2023年9月25日在本页面下一代智能合约和去中心化应用平台比特币及现有概念简介历史比特币是一个状态转换系统挖矿默克尔树其它的区块链应用脚本以太坊以太坊帐户消息和交易消息以太坊状态转换函数代码执行区块链和挖矿应用代币系统金融衍生品和价值稳定的货币身份和信誉系统去中心化文件存储去中心化自治组织更多应用杂项和关注改进版 GHOST 协议的实现费用计算和图灵完备货币和发行长期供应增长率(百分比)挖矿中心化可扩展性结论注释与延伸阅读注释延伸阅读以太坊白皮书这篇介绍性论文最初由以太坊创始人 Vitalik Buterin 在 2014 年发表,前于 2015 年的项目正式发布时间。 值得一提的是,和其他社区驱动的开源软件项目一样,以太坊自发布以来一直不断发展。虽然已经过数年,但由于本文仍然可提供有用的参考并能够准确表述以太坊及其愿景,我们仍然在维护它。 若想了解以太坊的最新进展,以及以太坊协议的更新情况,我们推荐您阅读本指南。寻求此白皮书早期版本或规范版本 [自 2014 年 12 月起] 的研究人员和学者应使用此 PDF。下一代智能合约和去中心化应用平台中本聪 2009 年开发的比特币常被誉为资金和货币的一次革命性变革,作为数字资产的首个实例,它同时具有以下特点:没有实物或内在价值(opens in a new tab)支撑,也没有一个中心化的发行机构或控制者。 然而,比特币实验有另一个可以说是更重要的部分,即作为分布式共识工具的底层区块链技术,并且人们的注意力正迅速地开始转移到比特币的这个方面。 经常被提到的其他区块链技术应用包括:使用链上数字资产表示自定义货币和金融工具(“彩色币(opens in a new tab)”)、底层物理设备的所有权(“智能资产(opens in a new tab)”)、非同质化资产例如域名(“域名币(opens in a new tab)”),以及一些更复杂的应用,例如让数字资产由一段实现任意规则的代码(“智能合约(opens in a new tab)”)甚至由基于区块链的“去中心化自治组织(opens in a new tab)”(DAO) 直接控制。 以太坊打算提供一种内置完全成熟的图灵完备编程语言的区块链,这种语言可用来创建“合约”,而合约可用于编码任意状态转换函数,让用户可以创建上述任何系统以及我们尚未想象到的许多其他内容,只需用几行代码编写出想实现的逻辑即可。比特币及现有概念简介历史去中心化数字货币的概念以及财产登记等其他应用已经存在了几十年。 1980 年代和 1990 年代的匿名电子现金协议主要依赖于称为 Chaumian 盲签名的密码学原语,提供了一种具有高度隐私性的货币,但这些协议基本上未能获得关注,因为它们依赖于中心化中介。 1998 年,戴伟 (Wei Dai) 的 b-money(opens in a new tab) 成为第一个提出通过解决计算难题来创造货币及去中心化共识等想法的协议,但该协议缺乏关于如何实际实施去中心化共识的细节。 2005 年,Hal Finney 引入了“可重复使用的工作量证明(opens in a new tab)”这一概念,该系统将 b-money 的想法与 Adam Back 有计算难度的哈希现金难题相结合来创建加密货币的概念,但由于依赖可信计算作为后端,又一次未能做到完美。 2009 年,中本聪将通过公钥密码学管理所有权的成熟原语与用于跟踪货币所有者的共识算法相结合,首次真正意义上实现了一种去中心化货币,被称为“工作量证明”。工作量证明机制是该领域的一项突破,因为它同时解决了两个问题。 首先,它提供了一种简单且比较有效的共识算法,让网络中的节点能够全体对比特币账本状态的一组规范更新达成一致。 其次,它提供了一种允许自由进入共识过程的机制,解决了决定谁来影响共识的政治问题,同时防止了女巫攻击。 为此,在工作量证明中,将正式的参与壁垒(例如要求在特定清单上注册成为唯一实体)替换成经济壁垒,即共识投票过程中单个节点的权重与该节点的算力成正比。 此后,还提出了另一种称为权益证明的方法,节点权重与其货币持有量而非计算资源成正比;针对这两种方法相对优点的讨论不在本文范围内,但应该注意,这两种方法都可以作为加密货币的支柱。比特币是一个状态转换系统从技术角度讲,诸如比特币等加密货币账本可视作一种状态转换系统,该系统有一个“状态”,由全部现存比特币的所有权状态和一个“状态转换函数”组成,状态转换函数以状态和交易为输入并输出新状态作为结果。 例如,在标准的银行系统中,状态就是一个资产负债表,一笔交易是一个从 A 帐户向 B 帐户转账$X的请求,状态转换函数将从A帐户中减去$X,向 B 帐户增加$X。 如果A帐户的余额在第一步中小于$X,状态转换函数就会返回错误提示。 所以,可以如此定义:APPLY(S,TX) -> S' or ERROR

上面提到的银行系统中,状态转换函数如下:APPLY({ Alice: $50, Bob: $50 },"send $20 from Alice to Bob") = { Alice: $30, Bob: $70 }

但是:APPLY({ Alice: $50, Bob: $50 },"send $70 from Alice to Bob") = ERROR

比特币中的“状态”是指所有已铸造但尚未使用的货币(技术上称为“未使用的交易输出”或 UTXO)的集合,每个 UTXO 都有面额和所有者(由一个 20 字节的地址定义,本质上是一个加密公钥 [fn1](注释编号))。 一个交易包括一个或多个输入以及一个或多个输出,每个输入都包含对现有 UTXO 的引用以及所有者地址相关的私钥创建的加密签名;每个输出都包含一个要添加到状态中的新 UTXO。状态转换函数 APPLY(S,TX) -> S' 的定义大体如下:对于 TX 中的每个输入:如果引用的 UTXO 不在 S 范围内,则返回错误。如果提供的签名与 UTXO 的所有者不符合,则返回错误。如果所有输入 UTXO 面值总额小于所有输出 UTXO 面值总额,则返回错误。在移除所有输入 UTXO 且添加所有输出 UTXO 后,返回 S。第一步的第一部分防止交易发送者花费不存在的比特币,第二部分防止交易发送者花费其他人的比特币,第二步确保价值守恒。 为了用于支付,比特币协议如下。 假设 Alice 想给 Bob 发送 11.7 BTC。 首先,Alice 将寻找她拥有的一组总数至少为 11.7 BTC 的可用 UTXO。 事实上,Alice 不太可能正好有 11.7 BTC;假设她能得到的最小数额是 6+4+2=12。 所以,她可以创建一笔有三个输入和两个输出的交易。 第一个输出为 11.7 BTC,所有者是 Bob 的地址,第二个输出为剩下的 0.3 BTC 找零,所有者是 Alice 自己。挖矿如果我们拥有可信任的中心化服务机构,状态转换系统可以很容易地实现;可以简单地将上述功能准确编码,使用中心化服务器的硬盘来记录状态。 然而,我们想把比特币构建成去中心化货币系统,为了确保每个人都同意交易的顺序,我们需要将状态转换系统与一个共识系统结合起来。 比特币的去中心化共识进程要求网络中的节点不断尝试将交易打包成“区块”。 网络计划大约每十分钟产生一个区块,每个区块包含一个时间戳、一个随机数、一个对上一个区块的引用(即哈希)和上一区块生成以来发生的所有交易列表。 随着时间推移就创建出了一个持续增长的区块链,它不断地更新,从而能够代表比特币账本的最新状态。检查一个区块是否有效的算法,如以下范式所示:检查该区块引用的上一个区块是否存在且有效。检查该区块的时间戳是否大于上一个区块 [fn2](注释编号)的时间戳并且在将来 2 小时以内检查区块上的工作量证明是否有效。令前一个区块末尾的态为 S[0]。假设 TX 是该区块的交易列表,其中包含 n 个交易。 对于 0...n-1 中的所有 i,如果有任何应用程序返回错误,退出并返回 false,请设置 S[i+1] = APPLY(S[i],TX[i])。返回 true,并将 S[n] 登记为该区块末尾的状态。本质上,区块中的每笔交易都必须提供一个有效的状态转换,从交易执行前的规范状态转换到某个新状态。 注意,状态并未编码到区块。它纯粹只是校验节点记住的抽象概念,只能被任意区块从创世状态开始,按顺序加上每一个区块的每一笔交易,(安全地)计算出当前状态。 另外,需要注意矿工将交易收录进区块的顺序。如果一个区块中有 A、B 两笔交易,B 花费的是 A 创建的 UTXO,如果 A 在 B 之前,这个区块是有效的,否则,这个区块无效。“工作量证明”是出现在上表而其他系统没有的验证条件。 具体验证方法为,对每个区块进行两次 SHA256 哈希处理,得到一个 256 位的数值,该数值必须小于不断动态调整的目标数值,本文写作时目标数值大约是 2187。 工作量证明的目的是使创建区块有算力困难,从而阻止女巫攻击者恶意重新生成区块链。 因为 SHA256 是完全不可预测的伪随机函数,创建有效区块的唯一方法就是简单地不断试错,不断地增加随机数的数值,查看新的哈希数是否小于目标值。当前的目标数值是~2187,网络必须平均尝试 ~269次才能生成有效的区块。一般而言,比特币网络每隔 2016 个区块重新设定目标数值,从而保证网络中的节点平均每十分钟生成一个区块。 为了对矿工的计算工作进行激励,每一个成功生成区块的矿工有权在区块中包含一笔凭空发给他们自己 12.5 BTC 的交易。 另外,如果交易的输入额大于输出,差额部分就作为“交易费”付给矿工。 顺便提一下,这也是比特币发行的唯一机制,创世状态中并没有比特币。为了更好地理解挖矿的目的,让我们分析比特币网络出现恶意攻击者时会发生什么。 因为比特币的密码学基础是非常安全的,所以攻击者会选择攻击没有被密码学直接保护的部分:交易顺序。 攻击者的策略非常简单:向商家发送 100 个比特币以换取某种产品(最好是快速交付的数字商品)等待商品交付创建另一笔交易,将这 100 个比特币发送给自己试图让网络相信他对自己的交易是先发生的。一旦步骤 (1) 发生,几分钟后矿工将这笔交易收录到区块中,假设是编号为 270000 的区块。 大约一小时后,此区块后面将会有五个区块,每个区块间接地指向这笔交易,从而确认这笔交易。 这时卖家收到货款,并向买家发货。因为我们假设这是数字商品,交付将瞬间完成。 现在,攻击者创建另一笔交易,将相同的 100BTC 发送到自己的帐户。 如果攻击者只是单纯地向全网广播这一消息,该笔交易不会被处理;矿工将运行状态转换函数 APPLY(S,TX) ,发现这笔交易要花费已经不在状态中的 UTXO。 所以,攻击者会对区块链进行分叉,将第 269 个区块作为父区块重新生成第 270 个区块,在此区块中用新交易取代旧的。 因为区块数据是不同的,这要求重新进行工作量证明。 另外,攻击者的新版 270 区块有不同的哈希,原来的 271 到 275 的区块不指向它,所以原链和攻击者的新链是完全分离的。 规定,在发生区块链分叉时,最长链被认为是诚实的区块链,合法的矿工将会沿着原有的 275 区块挖矿,只有攻击者一人在新的 270 区块后挖矿。 攻击者为了使其区块链最长,他需要拥有比除了他以外的全网更多的算力来追赶(即“51%攻击”)。默克尔树左:仅提供默克尔树上的少量节点已经足够给出分支的合法证明。右:对默克尔树任意部分进行改变的尝试最终都会导致链上某处不一致。比特币一个重要的可扩展特性是:它的区块存储在多层次数据结构中。 一个区块的哈希实际上只是区块头的哈希,区块头是一段约 200 字节的数据,包含时间戳、随机数、上个区块的哈希和默克尔树根的哈希,而默克尔树是一个存储了该区块所有交易的数据结构。 默克尔树是一种二叉树,由一组叶节点、一组中间节点和一个根节点构成。最下面是大量包含基础数据的叶节点,每个中间节点是其两个子节点的哈希,顶部的根节点也是其两个子节点的哈希。 默克尔树的目的是允许区块数据可以零散地传送:节点可以从一个源下载区块头,从其它源下载相关树的一小部分,而依然能够确认所有的数据都是正确的。 之所以如此是因为哈希向上传播:如果一个恶意用户尝试替换一个伪造的交易到树的底部,此改动将导致树的上层节点的改动,以及更上层节点的改动,最终导致根节点的改动以及区块哈希的改动,这样协议就会将其记录为一个完全不同的区块(几乎可以肯定是带着无效的工作量证明)。默克尔树协议可以说是比特币长期持续性的基础。 比特币网络中的一个全节点——存储和处理所有区块全部数据的节点,在 2014 年 4 月需要占用 15GB 的磁盘空间,而且还以每个月超过 1GB 的速度增长。 目前,对台式计算机来说尚可接受,但是手机已经负载不了如此巨大的数据了,未来只有商业机构和爱好者才会充当完整节点。 简化支付确认协议(SPV)允许另一种节点存在,这样的节点被称为“轻节点”,它下载区块头,使用区块头确认工作量证明,然后只下载与其交易相关的默克尔树分支。 这使得轻节点只要下载整个区块链的一小部分,就可以安全地确定任何一笔比特币交易的状态和帐户的当前余额。其它的区块链应用将区块链思想应用到其它领域的想法早就出现了。 2005 年,Nick Szabo 提出了“利用所有者权限确保财产权(opens in a new tab)”这一概念,该文件描述了“复制数据库技术的新进展”将如何允许基于区块链的系统存储谁拥有哪些土地的登记表,创建了一个包括宅基地、违法占有和佐治亚州土地税等概念的复杂框架。 然而,不幸的是在那时还没有实用的复制数据库系统,所以这个协议没有被付诸实践。 不过,自 2009 年比特币的去中心化共识开发成功以来,大量区块链的其它应用开始快速出现。域名币 - 创建于 2010 年,域名币(opens in a new tab)描述成去中心化的名称注册数据库最为恰当。 在 Tor、比特币和比特信等去中心化协议中,需要某种方式来识别帐户,以便其他人可以与帐户交互,但在所有现有解决方案中,唯一可用的标识符是伪随机哈希,如 1LW79wp5ZBqaHW1jL5TCiBCrhQYtHagUWy。 理想情况下,人们希望能够拥有名称的帐户,比如“george”。 但是,问题在于如果一个人可以创建名为“george”的帐户,那么其他人也可以按相同流程为自己注册“george”来冒充。 唯一的解决方案是“成果优先原则”范式,即第一个注册者成功后第二个注册者将失败,这个问题非常适合比特币共识协议。 域名币是应用这种想法的最早、最成功的名称注册系统实现。彩色币 - 彩色币(opens in a new tab)的作用是充当一种协议,让人们在比特币区块链上创建自己的数字货币,或者在货币只有一个单位的这种重要但琐碎情况下,创建数字代币。 在彩色币协议中,通过公开为特定的比特币 UTXO 分配一种颜色来“发行”新货币,并且该协议以递归方式将其他 UTXO 的颜色定义为与创建它们的交易所花费的输入的颜色相同(一些特殊规则适用于混合颜色输入的情况)。 这样,用户可以维护仅包含特定颜色 UTXO 的钱包,像发送普通比特币一样发送它们,并通过区块链回溯以确定他们收到的任何 UTXO 的颜色。元币 - 元币是想要拥有一个基于比特币的协议,使用比特币交易来存储元币交易,但具有不同的状态转换函数 APPLY'。 因为元币协议无法阻止无效元币交易出现在比特币区块链中,所以增加了一条规则,如果 APPLY'(S,TX) 返回错误,该协议默认为 APPLY'( S,TX) = S。 这为创建任意加密货币协议提供了一种简单的机制,可能有无法在比特币内部实现的高级功能,但开发成本非常低,因为比特币协议已经处理了挖矿和网络的复杂性。 元币已被用于实现某些类别的金融合约、名称注册和去中心化交易所。因此,一般而言,建立共识协议有两种方法:建立一个独立网络或把协议建立在比特币网络上。 前一种方法在域名币这样的应用中相当成功,但是该方法的实施非常困难,每个应用都要创建独立的区块链,建立并测试所有必须的状态转换函数和网络代码。 另外,我们预测去中心化共识技术应用将会服从幂律分布,大多数的应用太小不足以保证自身的安全,我们还注意到大量的去中心化应用,尤其是去中心化自治组织,需要进行应用之间的交互。另一方面,基于比特币的方法存在缺点,它没有继承比特币简化确认支付(SPV) 的特性。 比特币可以实现简化确认支付,因为比特币可以用区块链深度代表有效性;某种程度上,当一笔交易的祖先们距离现在足够远时,就可以安全地认为它们是合法状态的一部分。 与之相反,基于比特币区块链的元币协议不能强迫区块链剔除违反元币协议的交易。 因此,完全安全的元币协议的简化支付确认需要后向扫描所有的区块,直到比特币区块链的初始点,以确认某一交易是否有效。 目前,所有基于比特币的元币协议的“轻”实施都依赖可信任的服务器提供数据,这对主要目的之一是消除信任需要的加密货币而言,可能是一个相当次优的结果。脚本即使不对比特币协议进行扩展,它也能在一定程度上实现”智能合约”。 比特币的 UTXO 并非只能被公钥拥有,也可以被用基于堆栈的编程语言所编写的更加复杂的脚本所拥有。 在这一模式下,花费这样的 UTXO,必须提供满足脚本的数据。 事实上,甚至基本的公钥所有权机制也是通过脚本实现的:脚本将椭圆曲线签名作为输入,验证该交易和拥有此 UTXO 的地址,如果验证成功则返回 1,否则返回 0。 其它更复杂的脚本用于各种不同的应用情况。 例如,人们可以创建要求集齐三个私钥签名中的两个才能进行交易确认的脚本(多重签名),对公司帐户、安全储蓄帐户和某些商业代理来说,这种脚本是非常有用的。 脚本也能用来支付解决计算问题的奖励,人们甚至可以创建这样的脚本“如果你能够提供你已经发送一定数额的狗币给我的简化确认支付证明,该比特币 UTXO 就是你的了”,本质上,比特币系统允许不同的加密货币进行去中心化交易。然而,比特币系统的脚本语言存在一些严重的限制:缺乏图灵完备性 - 也就是说,虽然比特币脚本语言支持一个很大的计算子集,但它基本上不支持所有计算。 缺少的主要类别是循环。 这样做是为了避免交易验证期间出现无限循环;理论上,对脚本程序员来说循环是一个可以克服的障碍,因为任何循环都可以通过简单地使用 if 语句多次重复执行底层代码来模拟,但这确实会导致脚本的空间效率非常低下。 例如,实现另一种椭圆曲线签名算法可能需要 256 次重复的乘法,而每次都需要单独写在代码里。价值盲 - UTXO 脚本无法对可提取金额进行精细控制。 例如,预言机合约的一个强有力的用例是对冲合约,其中 A 和 B 存入价值 $1000 的比特币,30 天后脚本将价值 $1000 的比特币发送给 A,其余的发送给 B。这需要预言机来确定 1 个比特币的美元价值,但即便如此,与现有完全集中化的解决方案相比,这在信任和基础设施要求方面仍是一个巨大的进步。 然而,由于 UTXO 要么是全部要么是零,要实现这一目标,只能使用非常低效的破解方法,即持有许多不同面额的 UTXO(例如,面额为 2k 的 UTXO,每个 k 值都可以达到 30)并让预言机选择发送给 A 和发送给 B 的 UTXO。缺少状态 - UTXO 可以是已使用或未使用;用于保存任何其他内部状态的多阶段合约或脚本是没有机会出现的。 这使得多阶段期权合约、去中心化交易报价或两阶段加密承诺协议(这是安全计算赏金所必需的)难以创建。 这也意味着 UTXO 只能用于构建简单的一次性合约,而不是去中心化组织等更复杂的“有状态”合约,使得元协议难以实现。 二进制状态加之价值盲也意味着另一个重要应用 — 提款限制 — 是不可能实现的。区块链盲 - UTXO 看不到区块链的数据,例如随机数、时间戳和上一个区块的哈希。 由于该脚本语言无法通过随机性来创造可能的价值,它在博彩和其他几个类别的应用受到了严重限制。至此,我们已经考察了在加密货币上建立高级应用的三种方法:建立一个新的区块链、在比特币区块链上使用脚本、在比特币区块链上建立元币协议。 建立新区块链的方法可以自由地实现任意的特性,但要付出开发时间、引导工作和安全性的代价。 使用脚本的方法容易实施和标准化,但是它的功能有限。元币协议尽管非常容易实现,但是存在扩展性差的缺陷。 在以太坊系统中,我们打算建立一个替代框架,使得开发更便捷、轻客户端性能更强大,同时允许应用程序共享经济环境和区块链安全性。以太坊以太坊的目的是创建一个用于建立去中心化应用的替代协议,我们认为提供一套不同的折衷方案对大量去中心化应用非常有用,尤其是那些强调快速开发、小型和不常用应用的安全性,以及应用间高效交互能力的程序。 以太坊通过构建本质上是最终的抽象基础层来实现这一点:一种内置图灵完备编程语言的区块链,允许任何人编写智能合约和去中心化应用,并在其中设立他们自由定义的所有权规则、交易方式和状态转换函数。 域名币的主体框架只需要两行代码就可以实现,诸如货币和信誉系统等其它协议只需要不到二十行代码就可以实现。 智能合约,即包含价值、只有在满足特定条件时才能解锁的加密“盒子”,也可以在平台上构建,并且因为图灵完备性、价值知晓(value-awareness)、区块链知晓(blockchain-awareness)和多状态所增加的力量,而比比特币脚本所能提供的智能合约强大得多。以太坊帐户在以太坊中,状态由称为“帐户”的对象组成,而每个帐户都有一个 20 字节的地址,状态转换是指帐户之间价值和信息的直接转移。 一个以太坊帐户包含四个字段:nonce,用于确保每笔交易只能处理一次的计数器帐户当前的以太币余额帐户的合约代码(若有)帐户的存储(默认为空)以太币是以太坊内部的主要加密燃料,用于支付交易费。 通常有两类帐户:由私钥控制的外部帐户以及由其合约代码控制的合约帐户。 外部帐户没有代码,持有者可以通过创建和签署交易从外部帐户发送消息;在合约帐户中,每次合约帐户收到消息时,其代码都会激活,允许该帐户读取和写入内部存储,继而发送其他消息或创建合约。注意,以太坊中的“合约”不应被视为要“履行”或“遵守”的东西;相反,合约更像是存在于以太坊执行环境中的“自治代理”。当被交易或消息“触发”时,合约总是执行特定的代码段,并直接控制自已的以太币余额和键/值存储,以跟踪永久变量。消息和交易在以太坊中,术语“交易”用来指代已签名的数据包,数据包存储着将要从外部帐户发送的消息。 交易包含:消息接收者用于识别发送者身份的签名从发送者转账到接收者的以太币金额一个可选数据字段STARTGAS 值,表示允许交易运行的最大计算步骤数GASPRICE 值,表示发送者每个计算步骤支付的费用前三个是任何加密货币都有的标准字段。 默认情况下,数据字段没有函数,但虚拟机有一个操作码,合约可以使用该操作码访问数据;以这样的用例为例:如果一个合约作为区块链上的域名注册服务,那么它可能希望将传送给它的数据解释为包含两个“字段”,第一个字段是要注册的域名,第二个字段将域名注册到 IP 地址。 合约将从消息数据中读取这些值,并将其适当地存储。STARTGAS 及 GASPRICE 字段对于以太坊的反拒绝服务模型至关重要。 为了防止代码中出现无意或恶意的无限循环或其他计算浪费,要求每笔交易对代码可以执行的计算步骤设置一个限制。 计算的基本单位是燃料;通常,一个计算步骤消耗 1 份燃料,但某些操作会消耗更多燃料,因为它们在计算上更加昂贵或者增加了必须存储到状态中的数据量。 交易数据中的每个字节还需支付的费用为 5 份燃料。 收费系统的意图是要求攻击者相应支付他们消耗的每一种资源,包括计算、带宽和存储;因此,任何导致网络消耗更多这些资源的交易,都必须支付大致与增加量成比例的燃料费用。消息合约能够向其他合约发送“消息”。 消息是从未序列化的虚拟对象,只存在于以太坊执行环境中。 消息包含:消息发送者(隐含的)消息接收者随消息一起转账的以太币金额一个可选数据字段STARTGAS 值本质上消息类似于交易,只是消息是由合约而非外部参与者产生的。 当前正在运行代码的合约执行 CALL 操作码时会产生一条消息,该操作码就是用于产生并执行消息。 像交易一样,信息导致接收者帐户运行其代码。 因此,合约之间可以建立关系,方式完全与外部参与者之间建立关系相同。请注意,为交易或合约分配的燃料配额适用于该交易和所有子执行消耗的总燃料量。 例如,如果外部参与者 A 向 B 发送一笔配额为 1000 份燃料的交易,B 在向 C 发送消息需要消耗 600 份燃料,而 C 在内部执行需要消耗 300 份燃料才能返回结果,那么 B 再发送 100 份燃料就会消耗完燃料。以太坊状态转换函数以太坊状态转换函数 APPLY(S,TX) -> S' 可如下定义:检查交易格式是否正确(即具有正确数量的值)、签名是否有效以及 Nonce 值是否与发送者帐户中的 Nonce 值匹配。 若否,则返回错误。通过 STARTGAS * GASPRICE 计算出交易费,并从签名中确定发送地址。 从发送者的帐户余额中减去费用,并增加发送者的 nonce 值。 如果帐户余额不足,则返回错误。初始化 GAS = STARTGAS,并根据交易中的字节数量为每个字节扣除相应数量的燃料。将交易数值从发送者帐户转移至接收帐户。 如果接收帐户尚不存在,则创建此帐户。 如果接收帐户是合约,运行该合约的代码,直到代码运行结束或燃料耗尽。如果由于发送者资金不足或者代码运行耗尽了燃料,而导致转账失败,则回滚除支付费用之外的所有状态变化,并将费用支付给矿工帐户。否则,将所有剩余燃料的费用退还发送者,并把为所消耗燃料而支付的费用发送给矿工。例如,假设合约的代码如下:if !self.storage[calldataload(0)]:

self.storage[calldataload(0)] = calldataload(32)

注意,合约代码实际上是用低级以太坊虚拟机代码编写的;为了清晰起见,此示例是用我们的一种高级语言 Serpent 编写的,它可以编译为以太坊虚拟机代码。 假设合约的存储一开始是空的,发送了一个价值为 10 个以太币的交易,消耗 2000 份燃料,燃料价格为 0.001 个以太币,并且数据包含 64 个字节,字节 0-31 代表数字 2,字节 32-63 代表字符串 CHARLIE。 在这种情况下,状态转换函数的执行过程如下:检查交易是否有效、格式是否正确。检查交易发送者是否至少有 2000 * 0.001 = 2 个以太币。 若有,则从发送者帐户中扣除 2 个以太币。初始化燃料 = 2000 份,假设交易长度为 170 个字节,每字节费用 5 份燃料,减去 850 份燃料,剩下 1150 份燃料。从发送者帐户再减去 10 个以太币并增加到合约帐户。运行代码。 在本例中,运行比较简单:代码检查是否使用合约的索引 2 处的存储,若未使用,则通知;若使用,代码将索引 2 处的存储设置为值 CHARLIE。 假设该运行花费了 187 份燃料,所以余下的燃料数量是 1150 - 187 = 963 份燃料。向发送者帐户增加 963 * 0.001 = 0.963 个以太币,同时返回产生的状态。如果交易的接收一端没有合约,那么总交易费就等于提供的 GASPRICE 乘以交易的字节长度,并且和随交易发送的数据无关。注意,消息在回滚方面与交易相同:如果消息执行耗尽燃料,那么该消息的执行以及该执行触发的所有其他执行都会回滚,但父执行不需要回滚。 这意味着合约调用另一份合约是“安全的”,就好像 A 使用 G 份燃料调用 B,那么可以保证 A 的执行最多损耗 G 份燃料。 最后请注意,有一个创建合约的操作码 CREATE;它的执行机制通常类似于 CALL,不同之处在于执行的输出决定了新创建合约的代码。代码执行以太坊合约中的代码用一种基于堆栈的低级字节码语言编写,被称为“以太坊虚拟机代码”或“EVM 代码”。 该代码由一系列字节组成,每个字节代表一种操作。 通常,代码执行是一个无限循环,即重复执行当前程序计数器(从零开始)处的操作,然后将程序计数器增加一,直到代码执行完毕或出现错误,或者检测到 STOP 或 RETURN 指令。 操作可以访问三种数据存储空间:堆栈,一种后进先出容器,值可以在其中入栈和出栈内存,一种可无限扩展的字节数组合约的长期存储,一个键/值存储。 与堆栈和内存会在计算结束后重置不同,存储将长期持续存在。代码可以访问传入消息的值、发送者信息和数据,可以访问区块头数据,而且代码还可以返回数据字节数组作为输出。以太坊虚拟机码的正式执行模型简单得令人吃惊。 当以太坊虚拟机运行时,其完整计算状态可以由元组 (block_state, transaction, message, code, memory, stack, pc, gas) 来定义,其中 block_state 是包含所有帐户的全局状态并包括余额和存储。 在每一轮执行开始时,可以通过调用 code 的第 pc 个字节(或者如果 pc >= len(code),则调用 0)来找到当前指令,并且每条指令在元组影响方式方面都有自己的定义。 例如,ADD 将两个项目出栈并将它们的和入栈,将 gas 减少 1 并将 pc 增加 1,SSTORE 将顶部的两个项目出栈并将第二个项目插入到合约存储中第一个项目指定的索引处。 尽管有很多通过 JIT 编译来优化以太坊虚拟机执行的方法,但只需几百行代码就可以完成以太坊的基本实现。区块链和挖矿以太坊区块链在许多方面与比特币区块链相似,但确实存在一些差异。 以太坊和比特币在区块链架构方面的主要区别在于,与比特币不同,以太坊区块包含交易列表和最新状态的副本。 此外,其他两个值、区块编号和难度也存储在区块中。 以太坊中的基本区块验证算法如下:检查被引用的前一个区块是否存在并有效。检查区块的时间戳是否大于被引用的前一个区块的时间戳,并且在将来 15 分钟以内。检查区块编号、难度、交易根、叔根和燃料限制(各种以太坊特定的低级概念)是否有效。检查区块上的工作量证明是否有效。令前一个区块末尾的态为 S[0]。令区块的交易列表为 TX,并包含 n 笔交易。 对于 0...n-1 中的所有 i,设置 S[i+1] = APPLY(S[i],TX[i])。 如果任何应用程序返回错误,或者直到此时区块中消耗的总燃料量超过 GASLIMIT,则返回错误。令 S_FINAL 为 S[n],但添加支付给矿工的区块奖励。检查状态 S_FINAL 的默克尔树根是否等于区块头中提供的最终状态根。 如果等于,则该区块有效;否则该区块无效。这种方法乍一看效率似乎极低,因为它需要存储每个区块的全部状态,但实际上效率应该与比特币相当。 原因是状态存储在树结构中,而且在添加每个区块后只需要更改树的一小部分。 因此一般来说,在两个相邻区块之间,树的绝大部分应该是相同的,因此数据可以用指针(即子树的哈希)存储一次和引用两次。 一种称为“帕特里夏树”的特殊类型的树用于实现此目的,它包括对默克尔树概念的修改,允许高效地插入和删除节点,而不仅仅是更改。 此外,由于所有状态信息都存在于最后一个区块内,因此无需存储整个区块链历史,如果可以应用于比特币,使用这种策略计算可以节省 5-20 倍空间。一个常见的问题是合约代码在物理硬件的“哪里”执行。 该问题有一个简单的答案:合约代码的执行过程是状态转换函数定义的一部分,而该函数是区块验证算法的一部分,因此如果将交易添加到区块 B 中,由该交易产生的代码执行将在现在和将来由所有节点执行,由此下载并验证区块 B。应用通常,以太坊上有三种类型的应用。 第一类是金融应用,为用户提供更有效的方式来使用资金管理和签订合约。 包括子货币、金融衍生品、对冲合约、储蓄钱包、遗嘱,甚至最终包括某些类别的完整雇佣合约。 第二类是半金融应用,它们涉及金钱,但很大一部分功能也与资金无关;一个恰当的示例是针对解决计算难题的自动执行的赏金。 最后还有一些应用与金融毫不想关,例如在线投票和去中心化治理。代币系统区块链上的代币系统有许多应用,从代表美元或黄金等资产的子货币到公司股票等等,单个代币可以代表智能资产、不可伪造的安全优惠券,甚至可代表作为激励积分系统并与传统价值完全没有联系的代币系统。 代币系统在以太坊中非常容易实现,让人吃惊。 要理解的重点是,从根本上讲,所有货币或代币系统都是具有这样一种操作的数据库:从 A 中减去 X 个单位并将 X 个单位添加给 B,条件是 (1) A 在交易之前至少有 X 个单位并且 (2) 交易由 A 批准。实现代币系统所需要做的就是将此逻辑实现到合约中。使用 Serpent 语言实现代币系统的基本代码如下所示:def send(to, value):

if self.storage[msg.sender] >= value:

self.storage[msg.sender] = self.storage[msg.sender] - value

self.storage[to] = self.storage[to] + value

此代码本质上是本文档前面部分详细描述的“银行系统”状态转换函数的字面实现。 需要额外添加几行代码来规定在最初以及其他一些特殊情况下分配货币单位的初始步骤,理想情况下,应该添加一个函数让其他合约查询地址的余额。 但这就足够了。 理论上,基于以太坊的代币系统在作为子货币时可能具有另一个重要特征,该特征是基于比特币的链上元货币所缺乏的,那就是直接以该货币支付交易费的能力。 实现这一点的方式是:合约会保持一定数量的以太币余额,用来向发送者退还用于支付费用的以太币;合约也会通过收取费用来收集内部货币,并在持续不断的拍卖中转售货币,以此补充以太币余额。 因此,用户需要用以太币“激活”他们的帐户,但一旦帐户中有以太币,就可以重复使用,因为合约每次都会向帐户退还资金。金融衍生品和价值稳定的货币金融衍生品是“智能合约”最常见的应用,也是通过代码实现的最简单的应用之一。 实现金融合约的主要挑战在于,其中大多数合约都需要引用外部价格自动收报机;例如,一个非常理想的应用是对冲以太币(或其他加密货币)相对于美元波动的智能合约,但对冲需要合约知道以太币/美元的价值。 要实现这一点,最简单的方法是借助由特定方(例如纳斯达克)维护的“数据馈送”合约,这种合约的设计使得特定方能够根据需要更新合约并提供一个接口,允许其他合约向该合约发送消息并返回包含价格的响应。鉴于这一关键因素,对冲合约将如下所示:等待 A 方输入 1000 个以太币。等待 B 方输入 1000 个以太币。在存储中记录 1000 个以太币的美元价值(通过查询数据馈送合约计算得出),假设价值是 $x。30 天后,允许 A 或 B“重新激活”该合约,以便将价值 $x 的以太币(通过再次查询数据馈送合约获取新价格并且计算得出)发送给 A,剩余以太币发送给 B。这种合约在加密货币交易中潜力巨大。 加密货币的主要问题之一是它的波动性。尽管许多用户和商家可能希望获得处理加密资产的安全性和便利性,但他们中许多人不希望面临在一天内资金价值损失 23% 的景象。 迄今为止,最常见的解决方案是发行人支持的资产;其想法是发行人创建一种子货币,他们有权发行和撤销这种子货币单位,并且发行人可以向给他们(离线)提供一个单位指定基础资产(例如黄金、美元)的任何人提供一个单位的货币。 然后,发行人承诺向返还一个单位加密资产的任何人提供一个单位基础资产。 这种机制使得任何非加密资产“升级”为加密资产,前提是发行人是可信的。但实际上,发行人并不总是值得信赖,在某些情况下,银行基础设施过于薄弱或过于不友好,以至于无法提供此类服务。 金融衍生品提供了一种替代方案。 在这种方案中,不是由单个发行人提供资金来支持资产,而是由一个去中心化的投机者市场承担了这一角色,他们押注加密参考资产(例如以太币)的价格会上涨。 与发行人不同,投机者无法在交易中违约,因为对冲合约托管他们的资金。 请注意,这种方法不是完全去中心化的,因为仍然需要一个可信来源提供价格自动收报机,但可以说在降低基础设施要求(与成为发行者不同,发布价格馈送不需要许可证并且可能被归类为自由言论)以及减少欺诈的可能性方面,这仍是一次巨大的改进。身份和信誉系统最早的替代加密货币域名币(opens in a new tab)尝试使用类似比特币的区块链提供一种名称注册系统,通过该系统,用户可以在公共数据库中注册他们的姓名和其他数据。 主要用例是 DNS(opens in a new tab) 系统,它将诸如“bitcoin.org”等域名(在域名币的情况下,“bitcoin.bit”)映射到一个 IP 地址。 其它用例包括电子邮件身份验证系统和可能更为先进的信誉系统。 下面是一个基础合约,它在以太坊中提供与域名币类似的名称注册系统:def register(name, value):

if !self.storage[name]:

self.storage[name] = value

该合约非常简单;它完全是以太坊网络中的一个数据库,可以向其中添加但不能修改或移除。 任何人都可以把名称注册为一个值,该注册将永久保存。 更复杂的名称注册合约还包含一个“函数子句”以及一种机制,前者允许其他合约查询它,后者允许名称的“所有者”(即第一个注册者)更改数据或转让所有权。 甚至可以在该合约上添加信誉和信任网络功能。去中心化文件存储过去几年,大批受欢迎的在线文件存储初创公司不断涌现,其中最著名的是 Dropbox。Dropbox 想让用户可以上传硬盘备份、提供备份存储服务并允许用户访问备份,而用户需按月付费。 然而,在这一点上,文件存储市场有时效率相对较低。在粗略了解各种现有解决方案后会发现,主流文件存储的每月价格比整个硬盘驱动器的成本还要高,特别是在被称为“恐怖谷”的 20-200 GB 级别,既没有免费额度也没有企业级折扣。 以太坊合约让去中心化文件存储生态系统得以发展,个人用户可以在该系统中将自己的硬盘租出去以获得少量收益,而未使用的空间可用来进一步降低文件存储的成本。该系统的基础性构件就是我们所谓的“去中心化 Dropbox 合约”。 该合约的工作原理如下。 首先,用户将需要存储的数据拆分成几个区块并对每个区块加密以保护隐私,然后以此构建一个默克尔树。 然后创建一个含以下规则的合约,对于每 N 个区块,合约将从默克尔树中选择一个随机索引(使用能够被合约代码访问的上一个区块的哈希作为随机性来源),然后给予第一个实体 X 个以太币,以提供具有简化支付确认(例如证明树中特定索引处区块的所有权)的交易。 当用户想重新下载他们的文件时,可以使用微支付通道协议(例如每 32 KB 支付 1 个 szabo)收回文件;最节省费用的方法是支付者不到最后不发布交易,而是每 32 KB 之后,用一个更划算的具有相同 nonce 的交易取代原来的交易。该协议的一个重要特点是,虽然似乎用户相信许多随机节点不会丢失文件,但可以通过以下方法将这种风险降低到接近于零:通过私钥共享将文件拆分成许多部分,并通过监控合约确定每一部分仍在某个节点中。 如果合约仍在支付款项,则提供了一个加密证明,证明有人仍在存储该文件。去中心化自治组织通常意义上“去中心化自治组织”是指拥有一定数量成员或股东的虚拟实体,他们大概拥有 67% 的大多数股权,有权使用实体的资金并修改其代码。 成员集体决定组织的资金分配方式。 去中心化自治组织的资金分配方式可以是奖金、薪资或者更奇特的机制等等,比如用内部货币去奖励工作。 这在本质上复制了传统公司或者非营利组织的合法手段,但仅使用加密区块链技术进行了加强。 目前为止,许多关于去中心化自治组织的讨论都围绕着去中心化自治公司的“资本家”模式,其中有可获得红利的股东和可交易的股份;作为替代方案,有一种可能被称为“去中心化自治社区”的实体将使所有成员在决策时拥有同等权利,并在增减成员时要求 67% 的现有成员多数同意。 由于每个人只能拥有一个成员资格,所以需要群体来集体执行。下面概括了如何用代码实现去中心化自治组织。 最简单的设计就是一段自动修改的代码,如果三分之二的成员同意更改,该代码就更改。 理论上代码是不可更改的,然而通过把代码片段放入不同的合约并将合约调用的地址存储在可更改的存储中,用户可以轻易解决这一问题,使代码事实上变得可修改。 在这种去中心化自治组织合约的简单实现中,有三种交易类型,可通过交易中提供的数据行区分:[0,i,K,V] 在索引 i 处注册提案,以便将存储索引 K 的地址更改为值 V[1,i] 注册一张赞成提案 i 的投票[2,i] 如果投票有足够票数,则确认提案 i合约为每一种交易都提供有子句。 它将维护所有开放存储更改的记录以及投票支持者的列表。 合约还包括所有成员的列表。 当任何存储更改获得三分之二成员投票赞成时,一个确认交易将执行这项更改。 更复杂的框架可能还有针对发送交易、增减成员等功能的内置投票功能,甚至可以提供委任式民主(opens in a new tab)投票委托(即任何人都可以委托另外一个人代表自己投票,而且这种委托关系是可以传递的,如果 A 委托了 B,然后 B 委托了 C,那么 C 将决定 A 的投票)。 这种设计将使去中心化自治组织作为一个去中心化社区有机地成长,允许人们最终将筛选成员的任务委派给专家,但与“现有系统”不同,随着时间的推移,当个别社区成员改变他们的阵营时,专家可以很容易地加入或退出。另一个模型是去中心化公司,其中任何帐户可以拥有零份或多份股份,决策需要持有三分之二多数股份。 完整框架将包括资产管理功能,即能够出价购买或出售股份并且能够接受报价(最好是合约里有订单匹配机制)。 委托还提供委任制民主形式,普及了“董事会”的概念。更多应用1. 储蓄钱包。 假设 Alice 想安全地保管她的资金,但她担心自己的私钥丢失或被破解。 她把以太币放到和银行 Bob 签订的一个合约里,如下所示:Alice 每天最多可以单独提取 1% 的资金。Bob 每天最多可以单独提取 1% 的资金,但 Alice 可以用她的密钥创建一个交易取消 Bob 的提取权限。Alice 和 Bob 一起可以任意提取资金。通常,每天 1% 的额度对于 Alice 足够了,如果 Alice 想提取更多资金,她可以联系 Bob 寻求帮助。 如果 Alice 的密钥被破解,她可以立即找到 Bob,帮她将资金转移到一个新合约里。 如果 Alice 丢失了密钥,Bob 最终会取出资金。 如果最终发现 Bob 是恶意的,她可以取消他的提取权限。2. 作物保险。 用户可以轻松地制订金融衍生品合约,但使用的是天气而不是任何价格指数的数据馈送。 如果爱荷华州的一位农民购买了一项金融衍生品,该产品基于爱荷华的降雨情况进行反向赔付,那么如果遇到干旱,该农民将自动收到赔付资金,而且如果降雨充沛,他会很开心,因为他的作物收成会很好。 通常,这种保险可以扩展到自然灾害保险。3. 去中心化数据馈送。 对于金融差价合约,实际上有可能通过一种名为“谢林币(opens in a new tab)”的协议将数据馈送去中心化。 谢林币的基本工作原理如下。N 个相关方都向系统输入给定数据的值(以太币/美元价格),对这些值进行排序,在第 25 和第 75 百分位之间的每个人都会得到一个代币作为奖励。 每个人都有动力提供其他人都会提供的答案,而唯一能让众多参与者实际达成一致的值是显而易见的:真相。 这样就创建了一种去中心化的协议,它理论上可以提供任何数量的值,包括以太币/美元的价格、柏林的温度、甚至某个硬计算的结果。4. 智能多重签名托管。 比特币允许多重签名交易合约,例如,提供了给定五个密钥中的三个便可以使用资金。 以太坊允许更精细的控制;例如,提供五个密钥中的四个可以使用任意数额的资金,提供五个密钥中的三个可以每天最多使用 10% 的资金,提供五个密钥中的两个可以每天最多使用 0.5% 的资金。 此外,以太坊的多重签名是异步的 — 双方可以在不同时间在区块链上注册他们的签名,最后一个签名将自动发送交易。5. 云计算。 以太坊虚拟机技术还可以用来创建一个可验证的计算环境,让用户可以要求他人执行计算,然后有选择地索要证明,证实计算在某些随机选定的检查点处正确完成。 这就可以创建一个云计算市场,任何用户都可以用他们的台式机、笔记本电脑或专用服务器来参与,并且抽查与保证金双管齐下确保系统是值得信赖的(即节点不能通过欺骗获利)。 但是,这样的系统可能并不适合所有任务;例如,需要进行大量进程间通信的任务无法在大型节点云上轻易实现。 然而,其他任务则更容易实现并行;例如 SETI@home、folding@home 和遗传算法等项目可以方便地在这类平台上实现。6. 点对点赌博。 任意数量的点对点赌博协议都可以在以太坊区块链上实现,例如 Frank Stajano 和 Richard Clayton 的 Cyberdice(opens in a new tab)。 最简单的赌博协议实际上只是一种关于下一个区块哈希的差价合约,并且可以在其基础上创建更高级的协议,创建接近零费用且无法作弊的赌博服务。7. 预测市场。 如果有预言机或谢林币,预测市场也很容易实现,预测市场与谢林币一起有可能被证明是 futarchy(opens in a new tab) 的第一个主流应用,作为去中心化组织的治理协议。8. 链上去中心化市场,基于身份和信誉系统。杂项和关注改进版 GHOST 协议的实现“贪婪最重可观察子树”(GHOST) 协议是由 Yonatan Sompolinsky 和 Aviv Zohar 在 2013 年 12 月(opens in a new tab)首次提出的一项创新。 提出 GHOST 的动机是,具有快速确认时间的区块链目前由于过时率高而安全性降低 — 因为区块需要一定的时间才能通过网络传播,如果矿工 A 开采了一个区块,然后矿工 B 碰巧在矿工 A 的区块传播到 B 之前开采了另一个区块,那么矿工 B 的区块最终会被作废,不会增加网络安全。 此外,还有一个中心化问题:如果矿工 A 是一个拥有 30% 算力的矿池,而 B 拥有 10% 算力,那么 A 将面临 70% 的时间生产陈腐区块的风险(因为在其他 30% 的时间 A 产生了最后一个区块,所以会立即获得挖矿数据),而 B 将面临 90% 的时间生产陈腐区块的风险。 因此,如果区块间隔短到足以使过时率较高,则 A 将仅仅凭借其规模而显着提高效率。 结合这两种影响,快速产生区块的区块链很可能造就一个拥有足够高比例网络算力的矿池,从而对挖矿过程拥有事实上的控制。正如 Sompolinsky 和 Zohar 所描述的,GHOST 通过在计算哪条链“最长”时包含陈腐区块来解决第一个问题 - 网络安全降低;也就是说,在计算哪个区块具有最大的总工作量证明支持它时,不仅区块的父块和更远的祖先,而且该区块祖先(在以太坊行话中称为“叔块”)的陈腐子代也都被添加到计算中。 为了解决第二个问题 - 中心化偏差,我们跳出了 Sompolinsky 和 Zohar 描述的协议范畴,并且还为陈腐区块提供区块奖励:陈腐区块获得其基础奖励的 87.5%,而包含陈腐区块的侄块获得剩余的 12.5%。 不过,交易费不奖励给叔块。以太坊实现了一个简化版的 GHOST 协议,它仅仅深入七个层级。 具体而言,它的定义如下:一个区块必须指定一个父块,并且必须指定零个或多个叔块包含在区块 B 中的叔块必须具有以下属性:它必须是区块 B 的第 k 代祖先的直系子代,其中 2 <= k <= 7。它不能是 B 的祖先叔块必须是有效的区块头,但不需要是之前验证过的甚至是有效的区块叔块必须不同于前面区块中包含的所有叔块,并且不同于同一区块中包含的所有其他叔块(非双重包含)对于区块 B 中的每个叔块 U,区块 B 的矿工获得额外 3.125% 的铸币奖励,而叔块 U 的矿工获得 93.75% 的标准铸币奖励。这种限制版的 GHOST 协议,最多只能包含 7 代叔块,采用它有两个原因。 首先,无限制 GHOST 协议让计算给定区块的哪些叔块有效时过于复杂。 其次,无限制 GHOST 协议采用了以太坊中使用的补偿,取消了促使矿工在主链而不是公共攻击者的链上挖矿的激励措施。费用由于发布到区块链中的每笔交易都会给网络带来下载和验证成本,因此需要一些监管机制(通常涉及交易费)以防滥用。 比特币中使用的默认方法是收取完全自愿性质的费用,依靠矿工充当守门人并设置动态最低费用。 这种方法在比特币社区中非常受欢迎,特别是因为它是“基于市场的”,允许由矿工和交易发送者之间的供需决定价格。 然而,这种思路的问题在于,交易处理并不符合市场规律。尽管将交易处理解释为矿工向发送者提供的服务直观上很有吸引力,但实际上矿工收录的每笔交易都需要由网络中的每个节点处理,因此绝大部分交易处理成本由第三方承担,而不是由决定是否收录交易的矿工承担。 因此,公地悲剧的问题很可能发生。然而结果却是,基于市场机制中的这个缺陷,在给出一个不准确的特定简化假设时,会神奇地自我抵消。 论证如下。 假设:交易导致 k 个操作,将提供奖励 kR 给收录它的任何矿工,其中 R 由发送者设置,k 和 R 事先(大体上)对矿工可见。操作在任何节点的处理成本均为 C(即所有节点效率相同)有 N 个挖矿节点,每个节点的处理能力完全相同(即为总处理能力的 1/N)没有不挖矿的完整节点。如果预期奖励大于成本,矿工将愿意处理交易。 因此,预期奖励是 kR/N,因为矿工有 1/N 几率处理下一个区块,而矿工的处理成本仅仅是 kC。 所以,当 kR/N > kC 或者 R > NC 时,矿工将会收录交易。 请注意,R 是发送者提供的每个操作的费用,因此是发送者从交易中获得的收益的下限,NC 是整个网络共同处理一个操作的成本。 因此,矿工有动力仅收录那些总实际收益超过成本的交易。然而,现实中这些假设会存在几个重要偏差:与其他验证节点相比,矿工处理交易的成本确实更高,因为额外的验证时间会延迟区块传播,因而增加区块变陈腐的几率。确实存在不挖矿的完整节点。实际中挖矿能力的分配最终可能极端不平等。热衷于破坏网络的投机者、政敌和疯子确实存在,他们可以巧妙地设置合约,使得他们的成本远低于其他验证节点支付的成本。(1) 让矿工趋向于收录更少的交易,并且 (2) 增加 NC;因此,这两种作用会相互抵消 一部分 。如何抵消?(opens in a new tab) (3) 和 (4) 是主要问题,为了解决它们,我们简单地制订了一个 浮动上限:没有区块能够包含比 BLK_LIMIT_FACTOR 乘以长期指数移动平均值更多的操作数。 具体如下:blk.oplimit = floor(

(blk.parent.oplimit * (EMAFACTOR - 1) +

floor(parent.opcount * BLK_LIMIT_FACTOR)) /

EMA_FACTOR

)

BLK_LIMIT_FACTOR 和 EMA_FACTOR 是常量,暂时设置为 65536 和 1.5,但可能会在进一步分析后更改。还有一个因素会抑制比特币中的大区块大小:大区块将需要更长时间来传播,因此变陈腐的概率更高。 在以太坊中,燃料消耗量高的区块也可能需要更长的传播时间,因为它们的物理大小更大,而且因为它们需要更长时间来处理交易状态转换以进行验证。 这种延迟抑制因素在比特币中是一个重要的考虑因素,但在以太坊中由于 GHOST 协议而较少考虑;因此,依靠受监管的区块限制可提供更稳定的基线。计算和图灵完备重要的一点是,以太坊虚拟机是图灵完备的;这意味着以太坊虚拟机代码可以对任何设想可执行的计算进行编码,包括无限循环。 以太坊虚拟机代码以两种方式实现循环。 首先,使用一个 JUMP 指令,允许程序跳回至代码中的前一个位置,还使用一个 JUMPI 指令进行条件跳转,允许诸如 while x < 27: x = x * 2 之类的语句。 其次,合约可以调用其他合约,有可能通过递归进行循环。 这很自然地导致了一个问题:恶意用户能够通过迫使矿工和完整节点进入无限循环而不得不关机吗? 这个问题的出现源于计算机科学中的一个难题,称为停机问题:在一般情况下,没有办法知道一个特定的程序是否会停止运行。正如状态转换部分所述,我们的解决方案要求交易设置一个允许执行的最大计算步骤数,如果超过执行时间,计算就会被回滚,但仍要支付费用。 消息的工作原理相同。 为显示我们解决方案背后的动机,请看下面的示例:攻击者创建一个运行无限循环的合约,然后向矿工发送激活该循环的交易。 矿工将处理该交易,运行无限循环直到燃料耗尽。 即使执行耗尽了燃料并中途停止,交易仍然有效,矿工仍然向攻击者索取每个计算步骤的费用。攻击者创建一个非常长的无限循环,目的是迫使矿工持续计算很长时间,以至于计算结束时,将有更多区块产生出来,这样矿工就不可能通过收录该交易来索取费用。 然而,攻击者需要为 STARTGAS 提交一个值,限制执行可以进行的计算步骤数,因此矿工将提前知道该计算将进行相当多的步骤数。攻击者看到一个合约,其中的代码形式为 send(A,contract.storage[A]); contract.storage[A] = 0,然后发送一个交易,但燃料只够运行第一步而不足以运行第二步(即进行提款但不让余额减少)。 合约作者无需担心防卫此类攻击,因为如果执行中途停止,更改会被回滚。金融合约使用九个专有数据馈送的中位数,以便最大限度降低风险。 攻击者接管其中一个数据馈送,该数据馈送设计为可通过去中心化自治组织部分描述的变量-地址-调用机制修改,并将其转换为运行无限循环,从而强制任何从金融合约索取资金的尝试都因燃料耗尽而中止。 然而,金融合约可以为消息设置一个燃料限制,防止这个问题发生。图灵完备的替代方案是图灵不完备,其中 JUMP 和 JUMPI 不存在,并且在任何给定时间每个合约只允许有一个副本存在于调用堆栈内。 在这样的系统里,上述收费系统和关于我们解决方案效果的不确定性可能都是不需要的,因为执行一个合约的成本将被它的大小决定。 此外,图灵不完备甚至不是一个很大的限制;在我们内部构想的所有合约示例中,到目前为止只有一个需要循环,甚至那个循环也可以通过将一行代码重复 26 次来消除。 考虑到图灵完备带来的严重影响和有限的益处,为什么不简单地使用一种图灵不完备语言呢? 然而,在现实中,图灵不完备还远远不能有效地解决问题。 要想知道原因,请思考以下合约:C0: call(C1); call(C1);

C1: call(C2); call(C2);

C2: call(C3); call(C3);

...

C49: call(C50); call(C50);

C50: (run one step of a program and record the change in storage)

现在,向 A 发送一笔交易。这样,在 51 笔交易中,我们有一个合约需要进行多达 250 个计算步骤。 矿工可以尝试提前检测这种逻辑炸弹,方法是为每个合约维护一个值,指定合约可以进行的最大计算步骤数,然后对递归调用其他合约的合约进行计算,但是这需要矿工禁止创建其他合约的合约(因为上面 26 个合约的创建和执行可以很容易地汇集到一个单独合约内)。 另一个问题是,消息的地址字段是一个变量,所以在一般情况下,甚至不可能提前知道某个合约将调用哪些其他合约。 于是,最终我们有了一个惊人的结论:图灵完备的管理惊人地容易,而在缺乏同样的控制时图灵不完备的管理惊人地困难,那为什么不直接让协议图灵完备呢?货币和发行以太坊网络包括自己的内置货币以太币,以太币扮演双重角色:提供一个主要流动资金层,实现各种数字资产之间的高效交易;更重要的是,提供一种支付交易费的机制。 为了方便起见并避免将来出现争议(参考比特币当前的 mBTC、uBTC、satoshi 争论),不同面值的名称将提前设置如下:1: wei1012:Szabo1015:finney1018:ETH这应该被视为“美元”和“美分”或“BTC”和“satoshi”概念的扩展版本。 在不久的将来,我们期望“ETH”用于普通交易,“finney”用于微型交易,“szabo”和“wei”可以在围绕费用和协议实现的技术讨论中使用;其余的面额可能会在以后变得有用,但目前不应包含在客户端中。发行模型如下:以太币将以货币销售的形式发行,价格为一个比特币可购买 1000-2000 个以太币,这种机制旨在为以太坊组织筹资和支付开发费用,且已被其他平台(如 Mastercoin 和 NXT)成功应用。 早期的购买者将从较大的折扣中获益。 发售所得的比特币将全部用来支付开发者的薪资和奖金,并用来投资以太坊和加密货币生态系统中的各种营利和非营利项目。0.099 倍的发售总量(60102216 个以太币)将分配给以太坊组织,以补偿早期贡献者,并用以太币计价的方式支付创世块诞生前的开销。0.099 倍的发售总量将作为长期储备金保留。发售后,将永久性地每年为矿工分配 0.26 倍的发售总量。分组启动时一年后5 年后货币单位1.198X1.458X2.498X购买者83.5%68.6%40.0%已支用的预售准备金8.26%6.79%3.96%已使用的售后准备金8.26%6.79%3.96%矿工0%17.8%52.0%长期供应增长率(百分比)尽管采用了线性发行方式,然而和比特币一样,以太币的长期供应增长率也趋于零。上述模型提供了两个主要选项:(1) 捐赠池的存在和规模,以及 (2) 永久增长的线性供应的存在,而比特币采用了限制供应的方法。 捐赠池存在的理由如下。 如果捐赠池不存在,并且线性发行量减少到总发售量的 0.217 倍以实现相同的通货膨胀率,那么以太币总量将减少 16.5%,而每个单位的价值将增加 19.8%。 因此为了均衡,将会多发售 19.8% 的以太币,所以每个单位的价值将再次与以前完全一样。 之后,该组织还将拥有 1.198 倍的比特币,可以考虑将其分成两部分:原有的比特币和增加的 0.198 倍比特币。 因此,这种情况完全等同于捐赠,但有一个重要区别:该组织仅持有比特币,因而没有动力支持以太币单位的价值。永久性线性供应增长模型降低了有些人认为比特币财富过度集中的风险,并为生活在当前和未来的人提供了获取货币单位的公平机会,同时又保留了让人获取并持有以太币的强效激励措施,因为长期来看,用百分比表示的“供应增长率”将趋于零。 我们还推测,由于加密货币总是会因为不小心、死亡等原因而丢失,而加密货币的损失可以被模拟为每年总供应量的百分比,因此流通中的货币总供应量实际上最终会稳定在一个等于每年发行量除以损失率的数值上(例如,在损失率为 1% 时,一旦供应量达到 26 倍,那么每年将有 0.26 倍被开采,0.26 倍丢失,形成一个平衡点)。注意,未来以太坊可能过渡到权益证明模型以确保安全,将每年发行量降低到 0 至 0.05 倍之间。 如果以太坊组织失去资助或出于任何其他原因而消失,我们将开放一个“社区合约”:任何人都有权创建未来的以太坊候选版本,唯一的条件是太币数量必须最多为 60102216 * (1.198 + 0.26 * n) 个,其中 n 是创世块产生后的年数。 创建者可以自由地通过众筹或其他方式,分配权益证明驱动的供应增加与最大允许供应增加之间的部分或全部差额,以支付开发费用。 不符合社区合约的候选版本升级可能被合理地分叉为兼容版本。挖矿中心化比特币挖矿算法的原理是,让矿工一次又一次地对区块头稍作修改的版本进行数百万次 SHA256 计算,直到最终某个节点所产生版本的哈希小于目标值(目前大约为 2192)。 然而,这种挖矿算法容易遭受两种形式的中心化攻击。 第一种,挖矿生态系统已经被 ASIC(专用集成电路)所支配,这些计算机芯片专门为特定的比特币挖矿任务而设计,因此效率提高了数千倍。 这意味着比特币挖矿不再是一种高度去中心化和平等的事业,需要巨额资本才能有效参与。 第二种,大部分比特币矿工事实上不在本地完成区块验证;而是依赖中心化矿池提供区块头。 这个问题可以说更糟:截至撰写本文时,排名前三的矿池间接控制了比特币网络中大约 50% 的处理能力,尽管当矿池或联盟试图进行 51% 攻击时,矿工可以转换到其他矿池这一事实缓解了该问题。以太坊现在的目的是使用一种挖掘算法,要求矿工从状态中获取随机数据,从区块链的最后 N 个区块中计算一些随机选择的交易,并返回结果的哈希值。 这有两个重要好处。 首先,以太坊合约可以包含任何类型的计算,因此以太坊 ASIC 本质上是用于一般计算的 ASIC,即更好的 CPU。 其次,挖矿需要访问整个区块链,这迫使矿工存储整个区块链并至少能够验证每笔交易。 这样就消除了对中心化矿池的需求;虽然矿池仍然可以起到平衡奖励分配随机性的合法作用,但没有中心化控制的点对点矿池同样也可以很好地发挥此功能。该模型未经测试,在将合约执行作为挖矿算法使用时,在避免某些巧妙优化的过程中可能会遇到困难。 然而,这种算法有一个值得注意的特点,任何人都可以通过将专用于抑制某些 ASIC 的大量合约引入区块链中,在“井里下毒”。 由于存在经济激励,ASIC 制造商会使用这种方法互相攻击。 因此,我们正在开发的解决方案最终是一种适应性人为经济解决方案,而不是纯粹的技术解决方案。可扩展性可扩展性问题是以太坊常被关注的一个方面。 像比特币一样,以太坊也有缺陷,即网络中的每个节点都需要处理每笔交易。 使用比特币,当前区块链的大小约为 15 GB,每小时增长约 1 MB。 如果比特币网络像 Visa 一样每秒处理 2000 笔交易,它将每三秒增长 1 MB(每小时 1 GB,每年 8 TB)。 以太坊可能也会经历相似甚至更糟的增长模式,因为以太坊区块链之上还有很多应用,不像比特币区块链上只有货币,但以太坊完整节点只需存储状态而不是完整的区块链历史,这一事实让情况得到了改善。大区块链的问题是中心化风险。 如果区块链大小增加到 100 TB,可能的情况是只有极少数大型企业能运行完整节点,而所有普通用户将使用轻 SPV 节点。 在这种情况下,可能会出现这样的担忧:完整节点合伙欺诈牟利(例如更改区块奖励,给他们自己比特币等)。 轻节点无法立即检测到这一点。 当然,可能至少存在一个诚实的完整节点,几个小时之后有关诈骗的信息会通过 Reddit 这样的渠道泄露,但这时已为时过晚:将由普通用户相互组织协作将指定区块列入黑名单,这种大规模的、很可能不切实际的协作在规模上无异于发动一次成功的 51% 攻击。 就比特币而言,目前这是一个问题,但 Peter Todd 建议(opens in a new tab)对区块链进行修改,以缓解这一问题。在短期内,以太坊将使用两种其他策略来应对这个问题。 首先,因为基于区块链的挖矿算法,至少每个矿工都会被强制成为一个完整节点,为完整节点的数量创建了一个下限。 其次,更重要的是,处理完每笔交易后,我们会把一个中间状态树根收录到区块链中。 即使区块验证是中心化的,只要存在一个诚实的验证节点,就可以通过验证协议规避中心化问题。 如果矿工发布了无效区块,该区块必定是格式错误,或者是状态 S[n] 不正确。 由于已知 S[0] 是正确的,因此必然存在第一个不正确的状态 S[i],但状态 S[i-1] 是正确的。 验证节点将提供索引 i 以及“无效证明”,该证明包括处理 APPLY(S[i-1],TX[i]) -> S[i] 所需的帕特里夏树节点的子集。 节点将能够使用这些节点来运行该部分计算,并查看生成的 S[i] 与提供的 S[i] 是否不匹配。另一种更复杂的攻击涉及恶意矿工发布不完整的区块,因此甚至不存在完整信息,致使无法确定区块是否有效。 解决方案是质询-应答协议:验证节点对目标交易索引发起“质疑”,接受到质疑信息的轻节点会对相应的区块取消信任,直到另外的节点(无论是矿工还是另一个验证者)提供一个帕特里夏树节点子集作为有效性证明。结论以太坊协议最初被设想为加密货币的升级版本,通过高度通用的编程语言提供高级功能,如区块链托管、提款限制、金融合约、博彩市场等。 以太坊协议不会直接“支持”任何应用,但图灵完备编程语言的存在意味着,理论上可以为任何交易类型或应用创建任意合约。 然而,关于以太坊更有趣的方面是,以太坊协议远远超出了货币的范畴。 围绕去中心化文件存储、去中心化计算和去中心化预测市场的协议以及许多其他这类概念,有可能大大提高计算行业的效率,并首次通过添加经济层来大力促进其他点对点协议的发展。 最后,还有大量与金钱完全无关的应用程序。以太坊协议实现的任意状态转换函数的概念提供了一个具有独特潜力的平台;而不是一种专门针对数据存储、赌博或金融领域内一系列特定应用的封闭式单用途协议,以太坊在设计上是开放式的,我们相信在今后几年中它非常适合作为大量金融和非金融协议的基础层。注释与延伸阅读注释有经验的读者可能会注意到,事实上比特币地址是椭圆曲线公钥的哈希,而非公钥本身。 然而事实上从密码学术语角度把公钥哈希称为公钥完全合理。 这是因为比特币密码学可以视为一种定制的数字签名算法。在数字签名算法中,公钥由 ECC(椭圆曲线加密算法)公钥的哈希组成,签名由连接了 ECC 签名的 ECC 公钥组成。而验证算法涉及用 ECC 公钥哈希(作为公钥提供)来检查签名中的 ECC 公钥,然后用 ECC 公钥来验证 ECC 签名。技术上来说,前 11 个区块的中位数。在内部,2 和 "CHARLIE" 都是数字 [fn3](注释编号),后者采用大端序基数 256 表示。 数字可以至少为 0,最大为 2256-1。延伸阅读内在价值(opens in a new tab)智能资产(opens in a new tab)智能合约(opens in a new tab)B-money(opens in a new tab)可重复使用的工作量证明(opens in a new tab)利用所有者权限确保财产权(opens in a new tab)比特币白皮书(opens in a new tab)域名币(opens in a new tab)佐科三角(opens in a new tab)彩色币白皮书(opens in a new tab)万事达币白皮书(opens in a new tab)去中心化自治公司,比特币杂志(opens in a new tab)简化支付确认(opens in a new tab)默克尔树(opens in a new tab)帕特里夏树(opens in a new tab)GHOST 协议(opens in a new tab)StorJ 和自治代理,Jeff Garzik(opens in a new tab)Mike Hearn 在图灵节上谈论智能资产(opens in a new tab)以太坊递归长度前缀编码 (RLP)(opens in a new tab)以太坊默克尔帕特里夏树(opens in a new tab)Peter Todd 论默克尔求和树(opens in a new tab)有关本白皮书的历史,请参阅此维基文章(opens in a new tab)。和众多社区驱动的开源软件项目一样,以太坊自启动以来一直不断发展。 若想了解以太坊的最新进展以及如何更改以太坊协议,我们推荐您阅读本指南。本文对你有帮助吗?是否在本页面下一代智能合约和去中心化应用平台比特币及现有概念简介历史比特币是一个状态转换系统挖矿默克尔树其它的区块链应用脚本以太坊以太坊帐户消息和交易消息以太坊状态转换函数代码执行区块链和挖矿应用代币系统金融衍生品和价值稳定的货币身份和信誉系统去中心化文件存储去中心化自治组织更多应用杂项和关注改进版 GHOST 协议的实现费用计算和图灵完备货币和发行长期供应增长率(百分比)挖矿中心化可扩展性结论注释与延伸阅读注释延伸阅读网站最后更新: 2024年2月16日(opens in a new tab)(opens in a new tab)(opens in a new tab)使用以太坊查找钱包获取以太币Dapps - 去中心化应用二层网络运行节点稳定币质押ETH学习学习中心什么是以太坊?什么是以太币 (ETH)?以太坊钱包Gas fees以太坊安全和预防欺诈措施什么是 Web3?智能合约以太坊能源消耗以太坊路线图以太坊改进提案 (Eip)以太坊的历史以太坊白皮书以太坊词汇表以太坊治理区块链桥零知识证明测试中心开发者开始体验相关文档教程通过编码来学习设置本地环境生态系统社区中心以太坊基金会以太坊基金会的博客(opens in a new tab)生态系统支持方案(opens in a new tab)以太坊漏洞悬赏计划生态系统资助计划以太坊品牌资产Devcon(opens in a new tab)企业级应用主网以太坊私密以太坊企业级应用关于ethereum.org关于我们工作机会参与贡献语言支持隐私政策使用条款缓存政策联系我们(opens in a new t

首页 | 以太坊基金会博客

以太坊基金会博客以太坊基金会博客搜索跳转到内容分类研发 研究与开发活动 活动组织 组织内部资料生态系统支持计划 生态系统支持计划ETH.org Ethereum.org安全 安全性NxBn Next Billion协议 协议公告语言搜索共有 24 / 498 个帖子有 简体中文 版本。切换到英语2024年2月27日研发主网 Dencun 升级公告作者:协议支持团队

主网二进制大对象即将上线:在 ETHDenver 启动两年后,经过数十次测试调用和开发者网络测试,protodanksharding 终于要在主网上线了!

2024 年 3 月 13 日 13:55(协调世界时),Dencun 升级将于时段269568在以太坊主网启动。 节点运营商和质押人必须将软件升级到本公告中列出的版本。

要接收未来网络升级公告的电子邮件提醒,请在此处订阅。

Dencun 网络升级已在所有测试网成功启动。 现在,该升级已准备就绪,可以在以太坊主网上部署,2024 年 3 月 13 日 13:55(协调世界时),Dencun 升级将于时段269568在主网启动。

此次升级是继去年 Shapella 升级之后的又一次升级,其中包括多项变更,最引人注目的是通过 EIP-4844 引入了临时数据二进制大对象(也称为“protodanksharding”),这将有助于降低二层网络交易费。

如果想观看升级过程,请加入社区直播。

2024年1月31日ETH.orgEthereum.org 年度回顾作者:Ethereum.org 团队

回顾 2023 年,展望 2024 年。

对于 [ethereum.org 网站] (http\://ethereum.org) 的团队及其社区来说,2023 年是辉煌的一年 — 这给我们带来了些许怀旧之情,但我们还是要庆祝 ethereum.org 社区 2023 年帮助我们取得的成就,并在 2024 年继续保持这一势头。

为此,我们准备了一份 2023 年 ethereum.org 社区亮点回顾 — 请尽情阅读!

2024年1月24日研发Sepolia 与 Holesky 测试网 Dencun 升级公告作者:Protocol Support Team

Goerli 测试网的二进制大对象来了: 2024 年 1 月 17 日 6:32(协调世界时),Dencun 升级在 Goerli 测试网上线。 现在,可以在该测试网使用二进制大对象了!

Sepolia 和 Holesky 测试网将在未来两周内升级。 Dencun 升级将于时段“132608”(协调世界时 1 月 30 日 22:51)在 Sepolia 测试网启动,并于时段“29696”(协调世界时 2 月 17 日 11:35)在 Holesky 测试网上线。

本公告中述及的客户端版本适用于这两个测试网升级。

如果在 Sepolia 和 Holesky 测试网上升级进展顺利,将下来将计划在以太坊主网进行 Dencun 升级。

要接收有关网络升级公告(包括主网上的 Dencun 升级)的电子邮件提醒,请在此处 订阅。

Dencun 网络升级已于 2024 年 1 月 17 日在 Goerli 测试网成功启动。 现在计划在另外两个测试网 Sepolia 和 Holesky 上进行该升级,时间安排如下:

2023年9月20日ETH.orgEthereum.org 翻译马拉松回顾作者:Ethesum.org 团队

Ethereum.org 是一个以太坊教育和门户网站 - 许多人在这里第一次接触以太坊,找到自己的第一个钱包或去中心化应用程序,是开始学习或升级知识的必备可靠资源。

为了最好地实现这一目标,我们自 2019 年 7 月起一直在运行 ethereum.org 翻译计划,以便让所有人都能访问本网站的内容,包括超过 60 亿非英语使用者。

我们以尽可能多的语言提供有关以太坊的教育内容和基本入门页面,让说任何语言的人都能尽量轻松地了解以太坊,成为以太坊用户或开发者。

由于这项工作,我们向网站添加的翻译内容越来越多,非英语页面浏览量稳步增长,目前英语以外的语言的 ethereum.org 访问量占该网站所有访问量的四分之一以上。

!非英语和英语页面浏览量在不同时间的对比

本网站是开源的,任何人都可以为本网站的代码、内容、功能、设计、翻译或任何其他方面做贡献。 你可以登录我们的贡献页面,了解不同的贡献方式。

2023年3月28日研发主网 Shapella 升级公告作者:协议支持团队

提款功能即将推出! Shapella 网络升级计划于 2023 年 4 月 12 日 22:27:35(协调世界时)在以太坊网络启动,时段为 194048。

质押人和节点运营商应阅读本帖和提款回常见问题。

从现在起到 4 月 5 日期间,针对 Shapella 漏洞的以太坊漏洞悬赏计划奖励将翻倍。

现在可以注册,以接收有关这些升级公告的电子邮件。 要订阅,请滚动到页面底部

在顺利完成 Goerli 过渡后,客户端团队提出在主网启动 Shapella 升级的计划。 在第 157 次 AllCoreDevs 执行层会议期间,各方很快就 4 月 12 日这一日期达成共识。

此次升级将在合并之后启动,可以让验证者将其质押从信标链提取到执行层。 它还为执行层和共识层引入了新功能,详见下文。

2023年3月16日NxBn“下一批十亿”伙伴计划群组 3 - 申请征集作者:“下一批十亿”团队

以太坊是一个鲜活的实体,分布于不同时间和空间,可以通过我们的屏幕和通信设备访问。 赋予它生命的是已经与以太坊状态树的根、枝和叶交织在一起的无数人际关系。 这棵树蕴含着巨大价值、数字资产和实用的去中心化应用程序 -- 不是人类活动一个微不足道的部分。

但是,目前赋予以太坊生命的人类并不能代表所有人类 -- 仍有许多文化、民族和阶级鸿沟需要弥合。 Web3 建设者截至目前所开发、宣传和推广的用例和新颖解决方案还不能体现以太坊促进人类繁荣的真正潜力 -- 我们还没有触及可能性空间的表面。

我们相信,有远见的人可以看到这一点。 我们相信,了解并努力解决协调失效的人可以看到希望的曙光。 他们拥有想用来撬动世界的杠杆,而以太坊可以是其中的支点。 为了让以太坊触及下一批十亿人,它必须不仅对技术乐观主义者有用,还要对这一凌乱、复杂的人类星球上的每个人有用。

2023年2月28日活动宣布举办 Devcon 7!作者:Devcon 团队

在停办长达三年之后,去年我们终于摆脱了疫情困扰,变得比以前更强大,大家重聚在波哥大,举办了规模最大、也有人 会 说是“迄今为止最好的 Devcon。” 从那以后,我们经常会被问到“何时举办 Devcon 7?” 今天,终于有消息了!

2023年1月18日ETH.orgethereum.org 2022 年回顾作者:Ethereum.org 团队

从大规模扩容和二层网络生态系统,到三年内首次 Devcon 开发者大会以及合并的进行,以太坊和 ethereum.org 都经历了无比振奋的一年。 我们呈现了许多影响深远的功能和内容,这一路走来得到了成千上万优秀贡献者的帮助。

让我们来盘点一下 2022 年的精彩里程碑:

2022年1月16日协议宣布启动 KZG 仪式作者:EF 协议支持团队

高昂的费用使得旅行者难以走出这片黑森林。 内存池曾托管在云端,而 1559 过滤器现已问世,这表明内存池不够深,难以维持。

据传闻,社会将在 DankShard 带来的丰富性下繁荣发展,在滋养数据集 Blob 的领域正掀起一股巨浪,每个 Blob 都在为自己的分维营养层提供支持。

为了召唤 DankShard 的力量,我们的指南将带领我们完成仪式。 我们鼓励以太坊内外的所有成员做出贡献。 每位成员都将为集体做出独特的贡献,并以此照亮前进的道路。

较新的帖子较早的帖子订阅协议公告注册以接收协议相关公告的电子邮件通知,如网络升级、常见问题或安全问题。你可以随时选择不接收这些通知。注册以太坊基金会•Ethereum.org•生态系统支持计划•漏洞奖励计划•不跟踪•存档分类研究与开发•活动•组织内部资料•生态系统支持计划•Ethereum.org•安全性•Next Billion•协

翻译以太坊基金会博客 | 以太坊基金会博客

坊基金会博客 | 以太坊基金会博客以太坊基金会博客搜索跳转到内容分类研发 研究与开发活动 活动组织 组织内部资料生态系统支持计划 生态系统支持计划ETH.org Ethereum.org安全 安全性NxBn Next Billion协议 协议公告语言搜索该帖子有 16 语言 版本: 简体中文翻译以太坊基金会博客由 Ethereum.org Team 发布于 2022年8月31日Ethereum.org自从 2013 年 12 月发布第一篇文章以来,**以太坊基金会 (EF) **博客一直是以太坊基金会内部团队相互沟通的主要方式。 从活动公告到资助项目、协议升级、特定团队提供的定期更新或者讨论以太坊的愿景和路线图等,博客对于想要了解相关最新消息的人员来说是非常有用的资源。

但有一个很大的问题:尽管以太坊社区是一个全球性社区,而绝大多数此类信息只提供英语版本。 全球数十亿非英语人士很难获得这些信息。

ethereum.org 和翻译计划

Ethereum.org 展现了一个由社区驱动的以太坊翻译成功典范。 在 2019 年,Ethereum.org 开始将它的教育类开源内容翻译成多种语言。 随着时间推移,这项工作已经扩展到 48 种语言,数千位自愿贡献者每年会完成数百万字词的翻译。

社区参与

翻译计划的关键成功要素是,它有数千名热情的贡献者。 对很多人来说,翻译是最有意义的方式之一,他们可以通过翻译为以太坊生态系统做贡献,从而学习、传播知识并回馈社区。

Ethereum.org 目前:

有 3,800 名为社区做贡献的翻译人员网站支持 48 种语言在 2021 年翻译了 290 万个字词2022 年至今已翻译 190 万个字词

人们会使用翻译内容吗?

Ethereum.org 团队的翻译实践清楚地表明,以多种语言提供以太坊内容具有非常重要的价值。 结果显而易见:翻译内容越多,转到翻译页面的流量占总体流量的百分比越高。 这种趋势一直很稳定,翻译内容在 2019 年年底带来 5% 的页面浏览量,而这一数字现在已达到页面总浏览量的 22%。 此现象其实很容易理解,即使精通英语的社区成员也自称他们更喜欢阅读母语版相关内容。

翻译成简体中文的 Ethereum.org 内容是最完整的。 结果如何呢? 在访问 ethereum.org 的所有流量当中,有 8% 跳转到简体中文版网站。

翻译所有内容!

随着 ethereum.org 网站翻译的成功越发明显,其他翻译机会也日益显现出来。

以太坊质押启动板是成为单独质押人以及设置验证者的交互式指南,它已被翻译成 20 种语言。

从 2022 年年初开始,我们也为一些精选博客文章(如,最近的测试网升级)增加了一些翻译版本。 不过,这只是不太理想的临时解决办法,因为博客本身并不支持国际化。 翻译内容无法轻松地编入索引、搜索,或者不易查找。

博客更新:有哪些变化?

我们接下来要简短地总结到目前为止所做的工作,以及下一步改进计划。

国际化支持

自今天推出起,以太坊博客提供完整的国际化支持,这意味着当您选择查看博客的语言(如 blog.ethereum.org/zh/)后,您将能够使用您的目标语种查看所有文章。 这项支持还对从右到左语言(如阿拉伯语)的布局进行了优化。

性能提升

作为博客重建的一部分,我们将代码迁移到全新的技术栈(从 Jekyll 到 Next.js)。 Next.js 是经过最终用户性能优化的现代化 Web 框架。 我们希望每个人都可以注意到性能升级,但互联网访问速度较慢的用户会在加载速度和用户体验方面感受到最明显的改善。

辅助功能改进

重建工作还优化了博客的辅助功能。 由于我们使用的底层样式框架严格遵循 Web 内容辅助功能准则 (WCAG),因此在辅助功能方面实现了大幅提升,尤其对于使用屏幕阅读器的用户。

未来计划

虽然相对于原来版本,新博客有非常显著的改善,但我们仍希望进一步对其进行升级。

电子邮件订阅

在博客重建期间,我们还强化了对 RSS 阅读器的支持。 您可以订阅 RSS 源来了解最新消息,而不用定期查看博客或依靠 Twitter 推送的内容。

但在 2022 年,人们希望有更简洁的选项:电子邮件通知。 它是我们下一个优先待办事项,因为我们相信该选项能够为所有用户显著地改善博客的用户体验。

增加语种

Ethereum.org 清楚地表明用户需要各种语言支持。 我们今天推出了 16 种语言的支持,但希望在不久的将来增加这些选项。 这就引出了我们的下一个话题...

参与贡献!

你想帮助翻译以太坊基金会博客吗?

了解加入我们的翻译计划需要知道的全部信息。

提前感谢您帮助我们为全球数百万读者优化信息的可访问性!这篇帖子从英文翻译而来,因此可能不完全准确,也不是最新内容。原版可在 英语 中找到。上一个帖子下一个帖子订阅协议公告注册以接收协议相关公告的电子邮件通知,如网络升级、常见问题或安全问题。你可以随时选择不接收这些通知。注册以太坊基金会•Ethereum.org•生态系统支持计划•漏洞奖励计划•不跟踪•存档分类研究与开发•活动•组织内部资料•生态系统支持计划•Ethereum.org•安全性•Next Billion•协

语言资源 | ethereum.org

| ethereum.org跳转至主要内容学习用法构建参与研究搜索​​​​语言 ZH帮助更新此页面本页面有新版本,但现在只有英文版。请帮助我们翻译最新版本。翻译页面没有错误!此页面未翻译,因此特意以英文显示。不再显示首页/社区/语言资源页面最后更新: 2024年1月18日在本页面Ethereum.org 资源社区资源巴西葡萄牙语中文捷克语法语德语意大利语俄语西班牙语土耳其语越南语日语语言资源以太坊社区是全球性的,包括数以百万计的非英语人士。我们的目标是提供所有语言的教育内容,帮助世界各地的人们克服语言障碍,成功加入以太坊社区。如果你更喜欢用你的母语阅读或者知道某人不会说英语,你可以在下面找到有用的非英语资源列表。 数十万以太坊爱好者齐聚这些在线论坛,分享消息、谈论近来的发展、热烈讨论技术问题并畅想未来。知道一个你语言的教育资源? 创建问题(opens in a new tab),以将其添加到列表!Ethereum.org 资源Ethereum.org 被地道地翻译成 40 多种语言,请参阅我们的语言页面。如果你会使用两种语言,而且想帮助我们宣传到更多的人,你也可以参与 ethereum.org 翻译计划,帮助我们翻译该网站。社区资源巴西葡萄牙语新闻BeInCrypto(opens in a new tab) - 提供有关加密货币的新闻和文章,包括一个巴西交易所列表Cointelegraph(opens in a new tab) - 巴西版 Cointelegraph,一个主要的加密货币新闻机构Livecoins(opens in a new tab) - 提供有关加密货币的新闻和工具Seudinheiro(opens in a new tab) - 提供有关加密货币的新闻和报告教育web3dev(opens in a new tab) - Web3 开发者们的内容中心和 Discord 社区。Web3Brasil(opens in a new tab) - 提供有关 Web3 和去中心化金融的学习资源CriptoFacil(opens in a new tab) - 提供有关加密货币的新闻和教育,包括“以太坊入门”和“去中心化金融入门”CriptoAtivos(opens in a new tab) - 提供来自加密货币空间、教育和博客的洞察Cointimes(opens in a new tab) - 提供有关加密货币的新闻和教育Web3 starter pack(opens in a new tab) - 提供有关加密货币最常见和最基础问题解答的指南中文通用资源Ethereum.cn(opens in a new tab) - 由社区维护网站内容,内容包括共识层升级、所有核心开发者会议记录、以太坊第二层等EthFans(opens in a new tab) - 从以太坊基础知识到高级主题,各种学习材料应有尽有Untimes(opens in a new tab) - 由社区维护内容,内容涵盖以太坊、去中心化金融、非同质化代币和 Web3 相关知识123ETH(opens in a new tab) - 以太坊生态系统的一个门户网站Zhen Xiao(肖臻)(opens in a new tab) - 关于加密货币及其应用的免费在线课程以太坊白皮书(opens in a new tab) - 以太坊白皮书中文版以太坊生态系统ETHPlanet(opens in a new tab) - 可在线或现场参加黑客马拉松,为大学生提供培训PrimitivesLane(opens in a new tab) - 一个以区块链技术为重点的非营利研究小组Ethereum Translation Community CN(opens in a new tab) - 一个致力于翻译以太坊教育类内容的社区适用于开发人员DappLearning(opens in a new tab) - 一个学习主流去中心化应用程序项目的学习小组,每周都会分享想法和意见LearnBlockchain(opens in a new tab) - 一个分享区块链技术相关信息的开发者社区试用于加密研究人员安比实验室(opens in a new tab) - 一个解释加密和安全等内容的微信公众号星想法(opens in a new tab) - 一个解释零知识证明技术的微信公众号捷克语Gwei.cz(opens in a new tab) - 当地 Web3 社区,制作教育内容,组织在线和现场活动Gwei.cz Příručka(opens in a new tab) - 以太坊初学者指南DAO Příručka(opens in a new tab) - 去中心化自治组织初学者指南精通以太坊(opens in a new tab) - 精通以太坊(捷克语)法语Ethereum France(opens in a new tab) - Ethereum France 组织各种活动、制作内容并鼓励围绕以太坊展开讨论Ethereum.fr(opens in a new tab) - 提供有关以太坊的新闻和教育BanklessFR(opens in a new tab) - Bankless 新闻通讯(法语)CryptoFR(opens in a new tab) - 以太坊子页面上的加密货币论坛德语Microsoft Learn (Solidity)(opens in a new tab) - 使用 SolidityMicrosoft Learn(智能合约)(opens in a new tab) - 用 Solidity 编写以太坊智能合约Microsoft Learn(以太坊网络)(opens in a new tab) - 连接并部署以太坊网络Microsoft Learn(区块链)(opens in a new tab) - 区块链开发入门意大利语Ethereum Italia(opens in a new tab) - 提供有关以太坊的教育、活动和新闻,专注于智能合约和区块链技术Ethereum Italia Podcast(opens in a new tab) - 以太坊播客(意大利语)Microsoft Learn (Solidity)(opens in a new tab) - 学习使用 SolidityMicrosoft Learning(智能合约)(opens in a new tab) - 学习用 Solidity 编写智能合约Microsoft Learn(用去中心化应用程序)(opens in a new tab) - 使用去中心化应用程序创建用户界面俄语Cyber Academy(opens in a new tab) - 面向 web3 构建者的教育空间西班牙语Ethereum Madrid(opens in a new tab) - 区块链、去中心化金融与治理课程、活动和博客Cointelegraph(opens in a new tab) - 以太坊初学者指南(西班牙语)在线教程(opens in a new tab) - 在以太坊上学习 Solidity 和编程以太坊开发课程介绍(opens in a new tab) - Solidity 基础知识以及测试和部署你的首个智能合约以太坊安全与黑客攻击课程介绍(opens in a new tab) - 了解真实智能合约中常见的漏洞和安全问题去中心化金融开发课程介绍(opens in a new tab) - 了解去中心化金融智能合约如何在 Solidity 中运作,并创建自己的自动化做市商应用Cryptoversidad(opens in a new tab) - 非技术类区块链教育(面向初学者到高阶学习者)。 全面学习加密货币和以太坊。土耳其语BTK Akademi(opens in a new tab) - 专注于区块链和加密货币的课程重要的重命名:以太坊 2 有何变化?(opens in a new tab) - 《重要的重命名》博文的土耳其语译作,解释了“以太坊 2”术语的变化越南语Tino Group(opens in a new tab) - 以太坊、去中心化应用程序、钱包和常见问题概览Tap Chi Bitcoin(opens in a new tab) - 包含以太坊新闻和教育子页面的网站平台Coin68(opens in a new tab) - 提供以太坊新闻和教育内容的加密货币门户网站日语日本数字资产交易业协会(opens in a new tab)日本加密货币商业协会(opens in a new tab)区块链开发入门 - 学习 | Microsoft 文档(opens in a new tab) - 此学习路径介绍区块链和以太坊平台上的开发精通以太坊(opens in a new tab) - 精通以太坊(日文)Solidity 智能合约开发和以太坊实战(opens in a new tab) - Solidity 智能合约开发和以太坊实战(日文)本文对你有帮助吗?是否编辑页面(opens in a new tab)在本页面Ethereum.org 资源社区资源巴西葡萄牙语中文捷克语法语德语意大利语俄语西班牙语土耳其语越南语日语网站最后更新: 2024年2月16日(opens in a new tab)(opens in a new tab)(opens in a new tab)使用以太坊查找钱包获取以太币Dapps - 去中心化应用二层网络运行节点稳定币质押ETH学习学习中心什么是以太坊?什么是以太币 (ETH)?以太坊钱包Gas fees以太坊安全和预防欺诈措施什么是 Web3?智能合约以太坊能源消耗以太坊路线图以太坊改进提案 (Eip)以太坊的历史以太坊白皮书以太坊词汇表以太坊治理区块链桥零知识证明测试中心开发者开始体验相关文档教程通过编码来学习设置本地环境生态系统社区中心以太坊基金会以太坊基金会的博客(opens in a new tab)生态系统支持方案(opens in a new tab)以太坊漏洞悬赏计划生态系统资助计划以太坊品牌资产Devcon(opens in a new tab)企业级应用主网以太坊私密以太坊企业级应用关于ethereum.org关于我们工作机会参与贡献语言支持隐私政策使用条款缓存政策联系我们(opens in a new t