0

I am writing a document about the applicability of multi-agents to solve various business problems and I have seen bitcoin is described as multi-agent: Godsiff, Philip. "Bitcoin: bubble or blockchain." Agent and Multi-Agent Systems: Technologies and Applications. Springer International Publishing, 2015. 191-203. They say

This paper sets out a brief, deliberately non-technical, overview of
 Bitcoin, a new, but becoming more mainstream, crypto currency,
 generated and managed by a distributed multi–agent system.

I want to examine the role of parallelism and scalabity issues. I understand a smart contract is stored as byte code on the blockchain and then distributed to all nodes. When someone runs the smart contract, how does it run? If say 1000 dapps all run that smart contract at the same time, how does that run? Does the blockchain node execute that code 1000 times all in memory? If the number say is 50000 executions at the same time, what happens then? Do they all queue and wait to run?

I would appreciate an overview how the contract runs and if we can apply parallelism to allow scalability to large scale dapps.

1

Smart contracts are run as transactions. This means that they are packaged into blocks by miners (validators in PoS) and distributed to the network. Every full node validates every transaction in every block.

If 1000 dapps run the same contract at the same time, each is a different transaction that pays it's own gas cost. They are packaged independently into blocks in arbitrary order (depending on fees and when they arrived). Every full node checks every block. There is no parallelism in the EVM (Ethereum virtual machine).

As you can tell. This is extremely inefficient in terms of the amount of computing power that goes into verifying each block compared to the base computation; however, it is currently the only proven way to allow for trustless decentralization of the EVM. (Note that this distinct from, and dwarfed by the computational cost of mining, which is mostly generating a blockhash that is below some difficultly parameter by varying a nonce over and over again).

Obviously, huge gains could be made if some kind of parallelism could be applied to the system. The problem is doing this in a trustless decentralized way. How can you trust someone else's computation that you have not verified yourself? Current research on this calls this 'sharding'. Or splitting the chain into different chains so each validator only ends of validating a fraction of the network most of the time.

It's a hard problem, here are some further links that describe some of what has already been done.

https://github.com/ethereum/wiki/wiki/Sharding-FAQ

https://github.com/ethereum/research/wiki/A-note-on-data-availability-and-erasure-coding

www.youtube.com/watch?v=W9b4vQ37-qQ&feature=youtu.be This video is about many things including sharding.

The current plan (from what I've heard) is to get an early version of sharding out after PoS (Casper) is finalized sometime next year.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.