The Cost of Blockchain Convenience

Who
6 min readDec 10, 2021

A major goal of Zoints was to make the user experience for members new to Crypto as seamless as possible. For this, we decided to subsidize the transaction fees so that members only have to deal with one Cryptocurrency: ZEE. This post takes a look at the running costs we faced.

At the time of writing, the exchange rate was 1 SOL = $190.27.

A banner image showing a big, messy pile of bundles of hundred dollar bills.

Transaction Fees and Data Costs

For those new to or unfamiliar with Solana, ZEE is an SPL Token, the Solana counterpart to ERC-20 tokens. Every transaction on the Solana network costs 0.000005 SOL ($0.00095) per signature to process. Additionally, allocating permanent space on the blockchain for data scales with the amount of bytes required to the tune of a base fee of 0.000890880 SOL ($0.17) per data account and and additional 0.000006960 ($0.0013) SOL per byte.

The Zoints System

Invite Reward

To avoid new members having to go to an exchange, buy SOL to use at the exchange, and then buy ZEE to use at Zoints, we chose to bootstrap the system with a sign up bonus.

Apart from the ZEE itself, this comes with the cost of creating a token account. Token accounts are a part of the SPL Token system and store a variety of data, such as the current balance, the owner, and the token it is for. The on-chain space required for this account is 165 bytes, which comes out to 0.00203928 SOL ($0.39). Additionally, the transaction has two signatures, or 0.00001 SOL ($0.0019).

At the time of writing, this reward has been paid out 2992 times. The transaction fees (including the cost of allocating token accounts) total 6.08454232 SOL ($1,157.71)

A chart that displays the running total of SOL fees, split up by day

Staking

Members have the ability to stake ZEE with a specific community. This is done via the Staking Program. Every time a new creator space or community is registered on Zoints, we create a counterpart, the Staking Endpoint, on-chain. When a member subscribes to a community on Zoints, the on-chain counterpart is initializing a new stake and then staking. Every wallet that receives staking rewards also has to have a Beneficiary account, which needs to be initialized only once.

Since some actions need initialization, the costs per action are variable with the upfront cost of new members being higher and running costs lower.

Endpoints

Endpoints have an owner, a primary beneficiary (typically the owner themselves), and a secondary beneficiary (typically the member who referred the owner). If the primary and secondary accounts do not have a Beneficiary yet, the transaction will initialize one for them.

Every member gets their own Creator Space when they sign up, which typically creates one new Beneficiary account for the member themselves, since their referrer has already had their Creator Space created. When someone registers a z/Community, both Beneficiary accounts likely already exist.

  • Signatures: 2 (Zoints and the Endpoint account)
  • Endpoint Account: 113 bytes, 0.00167736 SOL ($0.32)
  • Beneficary Account: 56 bytes, 0.00128064 SOL ($0.24)
  • Total: 0.00168736 SOL ($0.32) (no Beneficiaries) to 0.00424864 SOL ($0.81) (two Beneficiaries)

Staking

The first time a member (“Staker”) stakes with a community, a Stake account is created for that Endpoint and Staker combination. Additionally, an SPL Token account is created for that Stake which holds the ZEE staked to that Endpoint, which is owned by the Program itself. If the Staker does not have a Beneficiary account, one will be created, but in Zoints this will likely have already been done when their Creator Space is created.

For repeated stakes (adding more ZEE or unstaking), no new data is allocated and only the signature fees are incurred.

  • Signatures: 2 (Zoints and the Staker)
  • Stake Account: 64 bytes, 0.00133632 SOL ($0.25)
  • SPL Token Account: 165 bytes, 0.00203928 SOL ($0.39)
  • Beneficary Account: 56 bytes, 0.00128064 SOL ($0.24)
  • Total (Initialization): 0.0033856 SOL ($0.64) for almost all cases, 0.00466624 SOL ($0.89) maximum
  • Total (Staking Only): 0.00001 SOL ($0.0019)

Claiming

When a member stakes or unstakes, it also automatically claims, but it is possible to claim without staking. This allocates no new data and only costs the signature fees.

  • Signatures: 2 (Zoints and the Staker)
  • Total: 0.00001 SOL ($0.0019)

Withdrawing Unbonded Tokens

After someone unstakes ZEE, they are locked up for ten days, after which they can be withdrawn from the token account and returned to the wallet. Zoints automatically rolls these into batches along with Claim instructions when necessary, so on Zoints they did not incur any additional fees on top of claiming. The cost would be identical to the cost Claiming if run independently.

The Data

At the time of writing, there have been 37,122 transactions for the Staking Program.

  • Endpoints: 3,361
  • Stakers: 1,341
  • Stake Accounts: 10,251 (Average of 7.644 stakes per Staker, Median of 2 stakes per Staker)
  • Claims: 33,758 (23,877 Stakes, 9,881 Claims)
  • Withdraws: 222

The total cost of subsidizing all those transactions and data allocation is 46.5003152 SOL ($8,847.61) with an average of 1.660725543 SOL ($315.99) per day.

A bar chart display the cumulative SOL costs per day with a total between November 11th and December 8th with a total of 46.5 SOL and an average of 1.66 SOL per day

Storage Cost

Breaking down the statistics above, we can figure out how much SOL we paid for permanent storage of user data. Of the 46.5 SOL we paid in total, the transaction fees for signatures are only 0.37121 SOL ($70.63). The remaining 46.1291052 SOL ($8,776.98) are storage fees.

Endpoints

  • Count: 3,361
  • Data: 379,793 bytes (370.89 KiB)
  • Cost: 5.63760696 SOL ($1,072.67)

Beneficiary Accounts

  • Count: 2,932
  • Data: 164,192 bytes (160.34 KiB)
  • Cost: 3.75483648 SOL ($714.43)

Stake Accounts

  • Count: 10,251
  • Data: 656,064 bytes (640.69 KiB)
  • Cost: 13.69861632 SOL ($2,606.44)

Stake ZEE Storage Accounts

This is by far the most expensive aspect and could be reduced through a change in the architecture, by allocating only a single Fund per wallet, rather a Fund for every Stake. That would reduce the count to 2,932 and a single member’s staked ZEE would still be held at a separate address from other members’ funds, although a bug or exploit might impact the consistency of individual Stakes for a member.

  • Count: 10,251
  • Data: 1,691,415 bytes (1.613 MiB)
  • Cost: 20.90465928 SOL ($3,977.53)

Estimated Cost of a New Member

Taking all the above together, the estimated cost of a new member with an average of 7 subscriptions, who was invited by an existing member is:

  • Invite Bonus: 0.00204928 SOL ($0.37)
  • Creator Space & Beneficiary: 0.002968 SOL ($0.56)
  • 7 Stakes: 0.0236292 SOL ($4.50)
  • Total: 0.02864648 SOL ($5.45)

Lessons Learned

The biggest surprise is that using SPL Tokens is expensive. It costs around 0.002 SOL ($0.39) just to allow an address to hold ZEE and this ended up being our largest expense. There isn’t much we can do about this, since using a token other than an SPL isn’t viable if we want to have exchange and wallet support.

It’s also better to make bigger accounts instead of two smaller accounts wherever possible, due to the base fee of creating an account. Creating one 128 Byte account is approximately 34 cents but creating two 64 Byte accounts is 50 cents. Unfortunately, the opportunity to use fewer accounts is heavily dependent on the overall architecture of your program and may often not be possible.

Transaction fees are a big barrier to entry. Without our subsidy and signup reward, a new member would have to buy SOL on an exchange, buy ZEE on an exchange, then pay more fees to utilize the Staking system. This is a prohibitive process for people who are unfamiliar or uncomfortable using crypto and drastically limits the member base.

In retrospect, subsidizing transaction fees is an expensive but ultimately worthwhile endeavor — at least until the project has enough momentum that the benefit of using the product outweighs the complexity and cost of crypto.

--

--