简体   繁体   English

如果我可以更改节点的代码并正常运行,那么区块链系统(例如以太坊)如何?

[英]How is the blockchain system(for instance ethereum) if i can change the code of the node and run it usually?

Lets take ethereum for instance(this question is general for all the public blockchains). 以以太坊为例(这个问题对于所有公共区块链都是通用的)。 Can i change the code (like sending transactions but not deducing account balance) and just run it as usual. 我可以更改代码(例如发送交易但不减少帐户余额)并像往常一样运行它。 Is there any underlying mechanism that prevents this? 有没有阻止这种情况的潜在机制? I mean how is the system secure if i could run a modified version of it? 我的意思是,如果我可以运行它的修改版,那么系统如何安全?

As for your first question unless you fork and modify the ethereum code you can't make the changes you demand (send transactions without deducting balance). 至于第一个问题,除非您分叉并修改以太坊代码,否则您将无法进行所需的更改(在不扣除余额的情况下发送交易)。 That pretty much answers your last question too, you can find all help you need to deploy code or get the origial source code here. 这也几乎回答了您的最后一个问题,您可以在此处找到部署代码或获取原始源代码所需的所有帮助。 Feel free to modify it. 随时修改它。
https://github.com/ethereum https://github.com/ethereum

Also the working or Ethereum is not as simple as you think. 同样,工作或以太坊也不如您想象的那么简单。 You can't just write code (smart contracts) and deploy them in the Ethereum-Blockchain and expect them to run for free. 您不能只是编写代码(智能合约)并将其部署在以太坊区块链中,并期望它们免费运行。 You need ether for that which acts as a fuel for ether. 您需要以醚作为醚的燃料。 To understand how security of Ethereum works you need to first understand the security of blockchain. 要了解以太坊的安全性如何工作,您需要首先了解区块链的安全性。 I wouldn't go into the details but keep note that as you go further back into the chain it gets more and more difficult to modify the codes. 我不会详细介绍,但是请注意,随着您进一步深入研究链,修改代码变得越来越困难。 Also Ethereum is quite secure, at least as much as you can expect from blockchain although there are security holes that seem to pop up every now and then, but after 50M hack back in 2016 and the following hard-fork Ethereum is pretty secure from average hackers. 同样,以太坊是相当安全的,至少与您对区块链的期望一样多,尽管似乎有时会突然出现安全漏洞,但是在2016年发生了5000万次黑客攻击之后以及随后的硬叉以太坊从平均水平来看是相当安全的黑客。

So to sum it up, to modify the code you need to make a fork. 综上所述,修改代码需要创建一个fork。 And this fork is not at all related to the main Ethereum. 而且这个分叉与主要的以太坊根本不相关。 SO you aren't running a modified version of Ethereum on the chain itself and hence it remains secure. 因此,您不在链上运行以太坊的修改版,因此它仍然安全。 Also you are quite limited when making smart contracts and they don't allow direct modification of the block-chain. 同样,在进行智能合约时您非常有限,并且它们不允许直接修改区块链。

Say, you run an unmodified ethereum node, and you get 3 ethers from somewhere in your account. 假设您运行了一个未经修改的以太坊节点,并且从帐户中的某处获取了3个以太币。 Now you rebuild your own modified node so that you send 2 ethers to me, but does not reduce 2 from your balance. 现在,您重建自己的修改节点,以便向我发送2个以太币,但不会减少2个以太币。 What happens is that me and the rest of the world will verify and process the transaction that you signed and reduce 2 ethers from your balance. 发生的是,我和世界其他地方将验证并处理您签署的交易,并从余额中减少2个以太币。 We don't run the modified version, right? 我们不运行修改后的版本,对吧? You see what's going on? 你知道发生了什么吗? The next time you try to spend another 2 ethers, your node will think you still have 3 ethers and will sign and broadcast a transaction, but everyone else in the world will not accept your transaction, since they know you only have 1 ether. 下次您尝试再花费2个以太币时,您的节点会认为您仍然有3个以太币,并且将签署并广播交易,但是世界上其他所有人都不接受您的交易,因为他们知道您只有1个以太币。 So you harm just to yourself. 因此,您只会伤害自己。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM