Public testing of a privacy and scalability solution in Ethereum on cloud platforms

The blockchain trend continues to gain momentum. More and more experts are predicting the universal adoption of this technology in the near future. Currently, several unresolved issues remain that hinder this.

First of all, modern blockchain systems do not scale well. For example, Ethereum's throughput is only 20 transactions per second, and despite its many advantages, it is not suitable for large businesses.

At the same time, Ethereum is valued for its strong protection against hacks and network failures. Therefore, it shouldn't be disregarded. It would be more reasonable to fix Ethereum's shortcomings and turn them into advantages.

Public testing of a privacy and scalability solution in Ethereum on cloud platforms

Plasma Cash as a solution for privacy and scalability in Ethereum

Plasma is a technology presented by Vitalik Buterin, co-founder of the Ethereum project, at the EthCC conference in Paris in 2018. It was developed in collaboration with Joseph Poon, co-founder of the Lightning Network, and was announced as a solution to increase the computational power of the Ethereum blockchain. The first news about Plasma leaked into the media in 2017.

This platform represents an external layer of smart contracts capable of interacting with the main blockchain, thereby relieving the root chain, reducing transaction fees for smart contracts and decentralized applications (DApps).

Detailed information on the development was outlined in the document "Plasma: Scalable Autonomous Smart Contracts", dated August 2017.

Buterin acknowledged that Plasma has scalability issues: each user must download and verify the authenticity of every Plasma block, which prevents exponential scaling.

To address this flaw, Plasma Cash was developedβ€”a child chain consisting of a smart contract and a private network based on Node.js, periodically transmitting its state to the root chain (Ethereum). It offers decentralization, security, and scalability in the blockchain, thus solving the Scalability Trilemma.

An important advantage of Plasma Cash over Plasma is that it draws users' attention only to those blocks that contain the coins they are interested in.

β€œNow users need to check the availability and correctness of the Plasma chain only for the specific index related to the coins they want to spend, own, and are interested in,” said Buterin.

According to developers, Plasma Cash is an effective remedy against hacks in Ethereum. Each Plasma coin has an owner and is unique. No one can take another user's coins without their knowledge. The coin holder can prevent potential fraudulent withdrawals through a 'complaint' system by presenting their 'proof data' in the history of their coin.

Testing Plasma Cash in Mongo Atlas

Due to its novelty, Plasma Cash remains under-researched. Blockchain specialists are actively testing its interaction with various cloud services and databases, documenting shortcomings, and finding ways to address them. In particular, tests in Mongo Atlas have revealed the following advantages when working with Plasma:

  1. Reliable data loss protection, as several replicas synchronize with each other in the cluster.
  2. Fast access, as the cluster can be created on three of the most popular cloud platforms: Amazon, Google, Azure. As a result, a Plasma Cash node can be deployed in many data centers located close to Mongo Atlas. We have proven that the speed does not significantly decrease, even if Plasma nodes are deployed in more distant data centers.
  3. Plasma nodes, which are used only in read mode, can be connected to a single Mongo cluster and located in different corners of the world, which improves geo-scalability (nodes are closer to users).
  4. Deploying a new node is easy, as it does not require resynchronization. You can simply connect to an existing Mongo cluster or quickly make a copy and configure the connection to it.
  5. Scaling the database is easy. Over time, data volume increases, and you can enlarge the size of nodes in the cluster as needed.

Public testing of a privacy and scalability solution in Ethereum on cloud platforms

We used the following servers for the tests:

  • 3 virtual Azure servers Standard E4s v3 (4 vcpus, 32 GiB memory). Each server hosts 3 nodes. One of them can submit blocks to the root chain.
  • Each node is connected to its Mongo Atlas cluster M50, which contains 3 nodes in replica mode.

Test 1

3 nodes handle 100k transactions each. In total, all 9 nodes contain 300k transactions and tokens.

Play video

Initial state: last block #213; 0 transactions and tokens saved in the database.

00:00 β€” 3 scripts started generating and sending 100k transactions each
00:29 β€” Started sending 100k transactions to nodes #1 and #2
00:32 β€” Started sending 100k transactions to node #3
00:32 β€” Node #1 took 11703 transactions from the pool and is forming block #214 (9fb)
00:34 β€” Node #2 took 27088 transactions from the pool and is forming block #214 (ef4)
00:34 β€” Block #214 (9fb) signed and sent to other nodes for validation
00:36 β€” Node #3 took 11900 transactions from the pool and is forming block #214 (983)
00:37 β€” Block #214 (9fb) validated and sent to the root chain
00:38 β€” Block #214 (983) signed and sent to other nodes for validation
00:38 β€” Block #214 (ef4) signed and sent to other nodes for validation
00:40 β€” Block #214 (983) validated and sent to the root chain
00:41 β€” All nodes received information from the root chain that block #214 (9fb) was added and start applying 11703 transactions
00:45 β€” All nodes received information from the root chain that block #215 (983) was added and start applying 11900 transactions
00:51 β€” Block #214 (ef4) validated and sent to the root chain
00:52 β€” Node #1 took 51469 transactions from the pool and is forming block #216 (ea0)
00:56 β€” Node #3 took 55102 transactions from the pool and is forming block #216 (f75)
00:58 β€” Demo script finished its work for node #2
00:58 β€” Block #216 (ea0) signed and sent to other nodes for validation
00:58 β€” All nodes received information from the root chain that block #216 (ef4) was added and start applying 27088 transactions
01:04 β€” Block #216 (f75) signed and sent to other nodes for validation
01:14 β€” Node #2 took 72912 transactions from the pool and is forming block #217 (f85)
01:15 β€” Demo script finished its work for nodes #1 and #2
01:17 β€” Blocks #216 (f75) and #216 (ea0) validated and sent to the root chain
01:21 β€” Block #217 (f85) signed and sent to other nodes for validation
01:26 β€” Blocks #217 (f75) and #218 (ea0) added to the root chain and nodes start applying 51469 and 55102 transactions respectively
01:27 β€” Block #217 (a85) validated and sent to the root chain
01:41 β€” Node #1 took 36828 transactions from the pool and is forming block #219 (46f)
01:41 β€” Node #3 took 32998 transactions from the pool and is forming block #219 (bb3)
01:43 β€” All nodes received information from the root chain that block #219 (a85) has been added and begin applying 72912 transactions
01:46 β€” Block #219 (46f) has been signed and is being sent to other nodes for validation
01:46 β€” Block #219 (bb3) has been signed and is being sent to other nodes for validation
01:53 β€” Node #2 processed all 100k transactions that were in the pool
02:37 β€” Block #219 (bb3) has been validated and sent to the root chain
02:41 β€” Block #219 (46f) has been validated and sent to the root chain
02:48 β€” Blocks #220 (bb3) and #221 (46f) have been added to the root chain and nodes begin applying 32998 and 36828 transactions respectively
02:54 β€” Node #1 processed all 100k transactions that were in the pool
02:55 β€” Node #3 processed all 100k transactions that were in the pool
04:12 β€” All nodes contain 300k transactions and tokens from the last block #221

Test 2

3 nodes receive 1 million transactions each. In total, all 9 nodes contain 3 million transactions and tokens.

Play video

Initial state: last block #213; 0 transactions and tokens saved in the database.

00:00 β€” 3 scripts have been launched that generate and send 1 million transactions each
02:29 β€” The sending of 1 million transactions to nodes #1 and #2 has begun
02:33 β€” Node #1 took 11668 transactions from the pool and is forming block #222 (510)
02:35 β€” Block #222 (510) has been signed and is being sent to other nodes for validation
02:37 β€” Block #222 (510) has been validated and sent to the root chain
02:38 β€” Node #2 took 46378 transactions from the pool and is forming block #222 (a9d)
02:38 β€” The sending of 1 million transactions to node #3 has begun
02:41 β€” Node #3 took 5504 transactions from the pool and is forming block #222 (387)
02:42 β€” Block #222 (387) has been signed and is being sent to other nodes for validation
02:44 β€” Block #222 (a9d) has been signed and is being sent to other nodes for validation
02:44 β€” Block #222 (387) has been validated and sent to the root chain
02:49 β€” Block #222 (a9d) has been validated and sent to the root chain
02:56 β€” Blocks #222 (510), #223 (387), and #224 (a9d) have been added to the root chain and nodes begin applying 11668, 5504, and 46378 transactions respectively
03:09 β€” Node #1 took 177170 transactions from the pool and is forming block #225 (e50)
03:09 β€” Node #3 took 119327 transactions from the pool and is forming block #225 (ccc)
03:10 β€” Node #2 took 149772 transactions from the pool and is forming block #225 (404)
03:26 β€” Block #225 (ccc) has been signed and is being sent to other nodes for validation
03:32 β€” Block #225 (404) has been signed and is being sent to other nodes for validation
03:33 β€” Block #225 (e50) has been signed and is being sent to other nodes for validation
03:53 β€” Block #225 (ccc) has been validated and sent to the root chain
04:03 β€” Block #225 (e50) has been validated and sent to the root chain
04:04 β€” Block #225 (404) has been validated and sent to the root chain
04:06 β€” All nodes received information from the root chain that block #225 (ccc) has been added and are starting to apply 119327 transactions
04:14 β€” All nodes received information from the root chain that block #226 (404) has been added and are starting to apply 149772 transactions
04:16 β€” All nodes received information from the root chain that block #227 (e50) has been added and are starting to apply 177170 transactions
04:32 β€” Node #3 took 209436 transactions from the pool and is forming block #228 (1e9)
04:40 β€” Node #2 took 212669 transactions from the pool and is forming block #228 (e38)
04:40 β€” Node #1 took 190144 transactions from the pool and is forming block #228 (861)
05:02 β€” Block #228 (1e9) has been signed and is being sent to other nodes for validation
05:08 β€” Block #228 (861) has been signed and is being sent to other nodes for validation
05:10 β€” Block #228 (e38) has been signed and is being sent to other nodes for validation
06:13 β€” Block #228 (1e9) has been validated and sent to the root chain
06:13 β€” Block #228 (861) has been validated and sent to the root chain
06:13 β€” Block #228 (e38) has been validated and sent to the root chain
06:39 β€” Blocks #228 (861), #229 (1e9), and #230 (e38) have been added to the root chain and nodes are starting to apply 190144, 209436, and 212669 transactions respectively
07:07 β€” Node #1 took 199770 transactions from the pool and is forming block #231 (e04)
07:09 β€” Node #2 took 190473 transactions from the pool and is forming block #231 (36e)
07:09 β€” Node #3 took 178807 transactions from the pool and is forming block #231 (f43)
07:34 β€” Block #231 (e04) has been signed and is being sent to other nodes for validation
07:37 β€” Block #231 (36e) has been signed and is being sent to other nodes for validation
07:37 β€” Block #231 (f43) has been signed and is being sent to other nodes for validation
08:49 β€” Block #231 (e04) has been validated and sent to the root chain
08:51 β€” Block #231 (f43) has been validated and sent to the root chain
08:52 β€” Block #231 (36e) has been validated and sent to the root chain
09:47 β€” Blocks #231 (e04), #232 (f43), and #233 (36e) have been added to the root chain and nodes are starting to apply 199770, 178807, and 190473 transactions respectively
10:16 β€” Node #1 took 153075 transactions from the pool and is forming block #234 (e04)
10:16 β€” Node #2 took 168035 transactions from the pool and is forming block #234 (36e)
10:16 β€” Node #3 took 166685 transactions from the pool and is forming block #234 (f43)
10:42 β€” Block #234 (56d) has been signed and is being sent to other nodes for validation
11:59 β€” Block #234 (1bb) has been validated and sent to the root chain
12:02 β€” Block #234 (58a) has been validated and sent to the root chain
12:02 β€” Block #234 (56d) has been validated and sent to the root chain
12:48 β€” Blocks #234 (1bb), #235 (58a), and #236 (56d) have been added to the root chain and nodes start applying 153075, 168035, and 166685 transactions respectively
13:14 β€” Node #1 has taken 112226 transactions from the pool and is forming block #237 (5c0)
13:16 β€” Node #2 has taken 87550 transactions from the pool and is forming block #234 (58a)
13:16 β€” Node #3 has taken 99594 transactions from the pool and is forming block #234 (56d)
13:30 β€” Block #237 (5c0) has been signed and sent to other nodes for validation
13:32 β€” Block #237 (58a) has been signed and sent to other nodes for validation
13:34 β€” Block #237 (56d) has been signed and sent to other nodes for validation
14:47 β€” Block #237 (58a) has been validated and sent to the root chain
14:53 β€” Block #237 (5c0) was not validated within the specified time
14:53 β€” All nodes received information from the root chain indicating that block #237 (58a) has been added and start applying 87550 transactions
14:54 β€” Block #237 (56d) has been validated and sent to the root chain
15:02 β€” Node #1 has taken 181206 transactions from the pool and is forming block #238 (c5f)
15:06 β€” All nodes received information from the root chain indicating that block #238 (56d) has been added and start applying 99594 transactions
15:12 β€” Node #2 has taken 51990 transactions from the pool and is forming block #239 (ad8)
15:20 β€” Block #239 (ad8) has been signed and sent to other nodes for validation
15:25 β€” Node #3 has taken 46685 transactions from the pool and is forming block #239 (857)
15:30 β€” Block #238 (c5f) has been signed and sent to other nodes for validation
15:34 β€” Block #239 (857) has been signed and sent to other nodes for validation
16:32 β€” Block #239 (857) has been validated and sent to the root chain
16:42 β€” All nodes received information from the root chain indicating that block #239 (857) has been added and start applying 46685 transactions
16:42 β€” Block #238 (c5f) has been validated and sent to the root chain
16:42 β€” Block #239 (ad8) was not validated within the specified time
16:54 β€” Node #2 has taken 96882 transactions from the pool and is forming block #240 (e6e)
16:56 β€” Node #3 has taken 39704 transactions from the pool and is forming block #240 (a47)
17:02 β€” Block #240 (a47) has been signed and sent to other nodes for validation
17:02 β€” Block #240 (e6e) has been signed and sent to other nodes for validation
17:18 β€” All nodes received information from the root chain that block #240 (c5f) has been added and begin processing 181206 transactions
17:45 β€” Block #240 (a47) has been validated and sent to the root chain
17:47 β€” Node #1 took 54956 transactions from the pool and is forming block #241 (170)
17:59 β€” Block #241 (170) has been signed and is being sent to other nodes for validation
18:09 β€” All nodes received information from the root chain that block #241 (a47) has been added and begin processing 181206 transactions
18:20 β€” Node #3 took 39104 transactions from the pool and is forming block #242 (955)
18:24 β€” Block #240 (e6e) has been validated and sent to the root chain
18:28 β€” Block #242 (955) has been signed and is being sent to other nodes for validation
18:09 β€” All nodes received information from the root chain that block #242 (e6e) has been added and begin processing 96882 transactions
19:06 β€” The demo script has finished its work for node #1
19:08 β€” The demo script has finished its work for node #2
19:08 β€” Node #2 took 48241 transactions from the pool and is forming block #243 (fde)
19:14 β€” Block #243 (fde) has been signed and is being sent to other nodes for validation
19:18 β€” Block #241 (170) was not validated within the specified time
19:28 β€” Node #1 took 86967 transactions from the pool and is forming block #243 (37c)
19:35 β€” Block #242 (955) has been validated and sent to the root chain
19:40 β€” Block #243 (37c) has been signed and is being sent to other nodes for validation
20:05 β€” All nodes received information from the root chain that block #243 (955) has been added and begin processing 39104 transactions
20:15 β€” Block #243 (fde) has been validated and sent to the root chain
20:19 β€” Node #3 took 42981 transactions from the pool and is forming block #244 (9b5)
20:26 β€” Block #244 (9b5) has been signed and is being sent to other nodes for validation
20:28 β€” All nodes received information from the root chain that block #244 (fde) has been added and begin processing 48241 transactions
20:32 β€” Node #2 processed all 1 million transactions that were in the pool
21:05 β€” Block #243 (37c) was not validated within the specified time
21:15 β€” Node #1 took 86967 transactions from the pool and is forming block #245 (37c)
21:32 β€” Block #245 (37c) has been signed and is being sent to other nodes for validation
21:42 β€” Block #244 (9b5) has been validated and sent to the root chain
21:50 β€” All nodes received information from the root chain that block #245 (9b5) has been added and begin processing 42981 transactions
22:04 β€” Node #3 took 45361 transactions from the pool and is forming block #246 (3f9)
22:11 β€” Block #246 (3f9) signed and sent to other nodes for validation
22:51 β€” Block #245 (37c) was not validated within the specified time
23:01 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #246 (37c)
23:08 β€” Demo script has completed its work for node #3
23:15 β€” Block #246 (37c) signed and sent to other nodes for validation
23:32 β€” Block #246 (3f9) was not validated within the specified time
23:42 β€” Node #3 pulled 52,173 transactions from the pool and is forming block #246 (71d)
23:51 β€” Block #246 (71d) signed and sent to other nodes for validation
24:38 β€” Block #246 (37c) was not validated within the specified time
25:01 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #246 (37c)
25:06 β€” Block #246 (71d) validated and sent to the root chain
25:12 β€” Block #246 (37c) signed and sent to other nodes for validation
25:14 β€” All nodes received information from the root chain that block #246 (71d) has been added and start applying 52,173 transactions
25:29 β€” Node #3 processed all 1 million transactions that were in the pool
26:40 β€” Block #247 (37c) was not validated within the specified time
26:47 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #247 (37c)
27:03 β€” Block #247 (37c) signed and sent to other nodes for validation
28:29 β€” Block #247 (37c) was not validated within the specified time
28:35 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #247 (37c)
28:49 β€” Block #247 (37c) signed and sent to other nodes for validation
30:13 β€” Block #247 (37c) was not validated within the specified time
30:23 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #247 (37c)
30:38 β€” Block #247 (37c) signed and sent to other nodes for validation
32:00 β€” Block #247 (37c) was not validated within the specified time
32:11 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #247 (37c)
32:26 β€” Block #247 (37c) signed and sent to other nodes for validation
33:49 β€” Block #247 (37c) was not validated within the specified time
33:59 β€” Node #1 pulled 86,967 transactions from the pool and is forming block #247 (37c)
34:12 β€” Block #247 (37c) signed and sent to other nodes for validation
35:34 β€” Block #247 (37c) validated and sent to the root chain
35:54 β€” All nodes received information from the root chain that block #247 (37c) has been added and start applying 86,967 transactions
36:11 β€” Node #1 processed all 1 million transactions that were in the pool
55:12 β€” The first node processed all 3 million transactions

Public testing of a privacy and scalability solution in Ethereum on cloud platforms

Summary

It was found that Azure virtual servers have inadequate processing power to handle such a large number of transactions. However, for the main task of the tests, namely to demonstrate Plasma Cash working with MongoDB, the system performed well.

We invite you to visit GitHub of the project: https://github.com/opporty-com/Plasma-Cash/tree/new-version

The article was co-authored by Alexander Nashiwan, senior developer at Clever Solution Inc.

Previously, the development team Opporty had already tested the speed of Plasma Cash. The results are outlined in this article.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers πŸ”₯ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster