Skip to content

Some basic Blockchain asset transfer tests - Stellar & Ethereum variations

Notifications You must be signed in to change notification settings

blockrockettech/blockchain-transfer-tests

Repository files navigation

Blockchain transfer tests

Simple, quick and dirty tests for gathering information on transfer blockchain assets between two parties.

Tests

Scenarios covered

  • Stellar
    1. Single payment operation between two parties
    2. Batching payment operations, each one in a separate transaction
    3. Batching payment operations in transactions containing the max of 20 ops per transaction
  • Ethereum
    1. Single ERC20 function transfer(address _to, uint256 _value)
    2. ERC20 batch transfer based on two arrays function transfer(address[] _addressed, uint256[] _values)
    3. ERC20 batch transfer based on two strings function transfer(string _addressed, string _values)

Criteria

  • Cost
  • Transaction Throughput
  • Open / Transparent

Other considerations

  • Reputation / Model (usage)
  • Staking
  • Public / Private

Assumptions

  • All accounts, public & private keys, are known to the application/test
  • All tests run against Stellar testnet, Ganache CLI and Ropsten testnet

Stellar

Scripts used:

  • Manually invoked scripts within ./stellar
  • Send single - node ./stellar/sending-single-transaction.js
  • Send batch, single transactions - node ./stellar/send-10-transactions.js
  • Send batch, multiple operation - node ./stellar/send-batch-of-20-payments-in-one-transaction.js

1. Single payment

Sending a single payment operation in a single transaction.

  • Results
.---------------------.
|  Stellar (Single)   |
|---------------------|
| tx timings (millis) |
|---------------------|
|             2315.39 |
|             2303.58 |
|             6151.93 |
|             1844.82 |
|             4264.79 |
|             5725.79 |
|             5857.99 |
|             1371.85 |
|             4544.31 |
|             5319.75 |
'---------------------'
  • Cost: For 10 transactions = 0.0001 XLM = 0.00048 USD (1 XLM = $0.21)

  • Throughput: Approx [39693] milliseconds = [39.693] seconds = [3.96] seconds on average for 10 transactions

2. Batch payments, singular transactions

Sending a batch of [10] single transactions, [10] tests ran:

  • Results
.---------------------.
|   Stellar (Batch)   |
|---------------------|
| tx timings (millis) |
|---------------------|
|            29406.01 |
|            29526.77 |
|            16902.48 |
|            28168.85 |
|            26407.93 |
|            29968.64 |
|            24758.33 |
|            22514.31 |
|            27960.55 |
|            34913.46 |
'---------------------'
  • Cost: For 100 transactions = 0.001 XLM = 0.0048 USD (1 XLM = $0.21)

  • Throughput: Approx [270522] milliseconds = [270.522] seconds = [2.7] seconds on average for 10 transactions

3. Batch payments, batch operations

Stellar supports sending 20 operations in a single transaction.

Test is sending 1 asset, to 20 different accounts in a single transaction.

  • Results
.---------------------.
| Stellar (Batch 1 op)|
|---------------------|
| tx timings (millis) |
|---------------------|
|             5697.74 |
|             2679.04 |
|             4000.03 |
|             3683.63 |
|             2880.02 |
|             6189.71 |
|             3649.63 |
|             3672.38 |
|             3311.37 |
|             3800.43 |
'---------------------'
  • Cost: For 10 transactions, each containing 20 operations = 200 OPS = 0.002 XLM = 0.0096 USD (1 XLM = $0.21)

  • Throughput: Approx [39560] milliseconds = [39.56] seconds = [3.956] seconds on average for 20 operations = [0.198] seconds a transaction

Opinions

  • Reputation/usage

    • Reputation is not as high as Ethereum but is growing due to low costs and high transaction throughput.
    • Usage is also not as high as Ethereum bu is also growing with daily operations submitted overtaking ethereum on some days.
    • 200k+ active accounts (8th Aug 2018)
    • Upto 1.1 million operations submitted as part of 350k transactions (as a peak daily throughput)
  • Staking

    • Staking could be achieved on chain by using a custom asset/address - by where user can stake by sending to a address which would need to manage the balances of those who have sent the assets.
    • Voting for example could happen with a custom asset i.e a new asset is created of fixed supply, each voter receives an asset, the voter then sends to a specific address to tally up votes.
  • Public/Private - Stellar is a public blockchain solution

  • Stellar is a much simpler Blockchain technology which focus on issuance and movement of assets. Simple smart contract scan be derived but there is it does not provide a turning complete smart contract solution. The lightening protocol is being to the network with a slated 2018 roll out.

Caveats
  • Running Stellar on TestNet you are rate limited
  • Not running against owned/hosted stellar core & horizon nodes may reduce throughput

Ethereum Test

  • Ethereum Blockchain (applicable to all tests below)
    • Transaction throughput: All Ethereum transactions must provide a gas price and be accepted by a miner. "Safe" gas prices change due to network conditions. On the main net blocks are currently mined approx. every 15 seconds. With reasonable gas the transaction would expect to be mined within 0 - 3 minutes.
    • Open and Transparent: All transactions are open and transparent to all on the blockchain and can be viewed using block explorers.
    • A rate of 361.95 USD per ETH was used for USD calculations (based on approx. rate on 9th Aug 2018)

1. Vanilla single address transfer

  • Standard ERC20 "out-of-the-box" transfer
    • Cost: This takes approx 36621 gas at a price of 5 gwei is 0.07 USD
.------------------------------------------------------------------------.
|                    WakERC20Token Gas Costs (Basic)                     |
|------------------------------------------------------------------------|
|      function      | gas price | gas user |    gas cost     | USD cost |
|--------------------|-----------|----------|-----------------|----------|
| transfer           | 5 GWEI    |    36599 | 0.000182995 ETH | 0.07 USD |
| batchTransfer (1)  | 5 GWEI    |    52835 | 0.000264175 ETH | 0.10 USD |
| batchTransfer (10) | 5 GWEI    |   323332 | 0.00161666 ETH  | 0.59 USD |
'------------------------------------------------------------------------'

2. Batch transfer (via passed arrays)

  • Batch transfer (send multiple addresses and values)
    • Due to gas limit there is a finite number of iterations you can perform. This gas limit is variable. At time of writing is was 7983268. Therefore you need to stay under this ceiling or risk the transaction failing.
    • Cost: Locally, we tested at a price of 5 gwei Note: gas prices can be a LOT higher at times of network congestion:
.-------------------------------------------------------------------------.
|                     WakERC20Token Gas Costs (Batch)                     |
|-------------------------------------------------------------------------|
|      function       | gas price | gas user |    gas cost     | USD cost |
|---------------------|-----------|----------|-----------------|----------|
| batchTransfer (10)  | 5 GWEI    |   188332 | 0.00094166 ETH  | 0.34 USD |
| batchTransfer (20)  | 5 GWEI    |   338815 | 0.001694075 ETH | 0.61 USD |
| batchTransfer (30)  | 5 GWEI    |   489299 | 0.002446495 ETH | 0.89 USD |
| batchTransfer (40)  | 5 GWEI    |   639785 | 0.003198925 ETH | 1.16 USD |
| batchTransfer (50)  | 5 GWEI    |   790273 | 0.003951365 ETH | 1.43 USD |
| batchTransfer (60)  | 5 GWEI    |   940762 | 0.00470381 ETH  | 1.70 USD |
| batchTransfer (70)  | 5 GWEI    |  1091253 | 0.005456265 ETH | 1.97 USD |
| batchTransfer (80)  | 5 GWEI    |  1241745 | 0.006208725 ETH | 2.25 USD |
| batchTransfer (90)  | 5 GWEI    |  1392239 | 0.006961195 ETH | 2.52 USD |
| batchTransfer (100) | 5 GWEI    |  1527734 | 0.00763867 ETH  | 2.76 USD |
'-------------------------------------------------------------------------'
  • These results when plotted show a linear increase in gas usage as the number of transactions increased
  • We proved the gas costs were consistent across environments by running some tests on Ropsten (test Ethereum blockchain) to ensure the numbers where consistent. tx
WakERC20Token Gas Costs (Batch)
 1527734.00 ┤        ╭
 1304500.33 ┤      ╭─╯
 1081266.67 ┤     ╭╯
  858033.00 ┤   ╭─╯
  634799.33 ┤  ╭╯
  411565.67 ┤╭─╯
  188332.00 ┼╯

3. Batch transfer (via splitting strings)

  • Split string Batch transfer (send multiple addresses and values)
    • Due to gas limit there is a finite number of iterations you can perform. This gas limit is variable. At time of writing is was 7983268. Therefore you need to stay under this ceiling or risk the transaction failing.
    • Cost: Locally, we tested at a price of 5 gwei Note: gas prices can be a LOT higher at times of network congestion:
.---------------------------------------------------------------------------------.
|                 WakERC20Token Gas Costs (Batch (Split String))                  |
|---------------------------------------------------------------------------------|
|          function           | gas price | gas user |    gas cost     | USD cost |
|-----------------------------|-----------|----------|-----------------|----------|
| batchTransferViaSplit (10)  | 5 GWEI    |   548765 | 0.002743825 ETH | 0.99 USD |
| batchTransferViaSplit (20)  | 5 GWEI    |  1059136 | 0.00529568 ETH  | 1.92 USD |
| batchTransferViaSplit (30)  | 5 GWEI    |  1569589 | 0.007847945 ETH | 2.84 USD |
| batchTransferViaSplit (40)  | 5 GWEI    |  2080123 | 0.010400615 ETH | 3.76 USD |
| batchTransferViaSplit (50)  | 5 GWEI    |  2590875 | 0.012954375 ETH | 4.69 USD |
| batchTransferViaSplit (60)  | 5 GWEI    |  3101434 | 0.01550717 ETH  | 5.61 USD |
| batchTransferViaSplit (70)  | 5 GWEI    |  3612349 | 0.018061745 ETH | 6.54 USD |
| batchTransferViaSplit (80)  | 5 GWEI    |  4123068 | 0.02061534 ETH  | 7.46 USD |
| batchTransferViaSplit (90)  | 5 GWEI    |  4634007 | 0.023170035 ETH | 8.39 USD |
| batchTransferViaSplit (100) | 5 GWEI    |  5130167 | 0.025650835 ETH | 9.28 USD |
'---------------------------------------------------------------------------------'
  • These results when plotted show a linear increase in gas usage as the number of transactions increased
    • On average the simple splitting we perform was 3 times more expensive
WakERC20Token Gas Costs (Batch (Split String))
 5130167.00 ┤        ╭
 4366600.00 ┤       ╭╯
 3603033.00 ┤     ╭─╯
 2839466.00 ┤    ╭╯
 2075899.00 ┤  ╭─╯
 1312332.00 ┤ ╭╯
  548765.00 ┼─╯

Opinions

  • Reputation/usage

    • Ethereum is the one of the most utilised Blockchain by usage and adoption due to it's maturity and the ability to run "smart-contracts" upon it.
    • 581,703 transactions were processed on the 8th Aug 2018

    Tx Growth

    Unique Addresses

  • Staking

    • Staking can be achieved via "smart-contracts" with bespoke logic
    • Voting can be achieved via "smart-contracts" with bespoke logic
  • Public/Private - Ethereum is a public blockchain solution

Scripts used:

  • Ethereum JavaScript mocha tests ran via the Truffle framework:
  1. Install Node v8.x or above

  2. Install Truffle:

npm install -g truffle
  1. Install node modules for project:
npm install
  1. Run the tests:
npm run test

About

Some basic Blockchain asset transfer tests - Stellar & Ethereum variations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published