Aug 21, 2024. 2:30pm – 2:50pm
2024 IEEE International Conference on Blockchain

Effective Ethereum Staking in
Cryptocurrency Exchanges
Yuto TAKEI(Mercari, Inc. and Tokyo Institute of Technology, JAPAN)

Kazuyuki SHUDO(Kyoto University, JAPAN)

Outline of the Presentation
1. Research Motivation
2. Related Work and Background
3. Briefs on Ethereum Architecture
4. Challenges to Solve
5. Proposed Techniques
6. Experiment and Results
7. Conclusion2

Research Motivation
Cryptocurrency staking is an attractive option for exchanges.
Ethereum is one of the most major Proof of Stake (PoS) assets.
● Exchanges hold $100+ billion worth customer cryptocurrencies
worldwide, where most of those assets are idle.
● Some jurisdictions allow exchanges to invest assets in custody
into relatively low-risk instruments.
● PoS Ethereum adopts a very unique and complex architecture.
It rewards successful validators, while penalize violators.
3

Related Work

Other PoS Mechanisms

Public Blockchain Consensus

Variations of PoS exist.

● Acceleration or optimizationof PoW-based mining● Proof of Importance (NEM)● Delegated PoS (Solana, BNB)

● Picking transactions withbetter fee (MEV-boosted)

BFT-like Consensus Algorithms● Mitigating various attacks
against consensus.
● Solving scalability issues.

Paxos, PBFT or other voting
based algorithms are studied toextend for blockchain context.
● Tendermint, HoneyBadgerBFT
4

Background: Wallets at Exchanges
Most exchanges have multiple layers of wallets to accept
incoming deposits, and initiate outgoing withdrawals.
● Deposit addresses areissued per customer.
● Cold wallets are usefulto enhance security.
● Transactions between
hot and cold are madeto adjust balances.

DepositDepositorsHot wallet
Cold wallet

Change / Reserve

Withdrawers

Reservedenotes a flow of cryptocurrencies
denotes a set of addresses
5Background: Ethereum● Asset with #2 market capitalization.

○ The second most popular cryptocurrency after Bitcoin.
○ Host of ERC-20 and other tokens (e.g. NFTs).

● Migrated from PoW to PoS after “The Merge”○ Exchanges generally run two types of node in tandem.
○ Nodes can be replaced withload
Validator
Validator key pair
Blockchain as a Service.
API(e.g. Infura, QuickNode,Peer-to-Peer
Other CL peers
CL client
GCP Blockchain Engine)
APIEL client
Exchange’s Infrastructure

Other EL peers
6Ethereum Mechanisms at Glance

32 slots

ose ropose ropose ropose missppp

prop
Execution
Layer
(EL)

BlockBlockBlock
Block (orphaned)

32 slots

tevoteEpoch N + 1

Slot for vote is
randomly assigned.
ete
vot
vovo

Consensus
Layer
(CL)

Slot

Exit

Validator List

Epoch N
Slot

Entry

Activation Queue

New deposit
Older epochs
to be finalized: Validator

Exit Queue

Voluntary exit
Slashedoseprop

BlockTransaction
Transaction

Proposers arerandomly chosen.

Transaction
7

Deposit and Withdrawals of Ethereum Staking
Deposit (EL → CL)

Withdrawal (CL → EL)

When depositing on EL:
Account

a1deposit function call
32 ETH (to be burned)

DepositContract

Send 32 ETH to Deposit Contract
with following parameters:● BLS pubkey (= ETH2 account)● Withdrawal EL address● Signature by the BLS key

Account

a2Balance
0 ETH

at withdrawal block
0.02 ETH (example)● Partial: Excess above 32 ETH
is refunded periodically.
● Full: All amount is refundedand ETH2 account closed.
(Voluntary exit or slashing)
8Four Challenges to Consider

1

Preserving Asset Liquidity
Keeping non-staked reserve for customer withdrawal

2Validator Key Management
Preventing BLS key compromise (leak) or loss

3

Stable Validator Operation
Keeping validator nodes online and updated

4

Increased Proﬁts from Staking
Saving running cost, and proposing fee-rich transactions
9

Proposed Techniques● Staking-enabled Wallet Layers● Security Considerations● Infrastructure on Cloud●MEV-boosting and Staking Pools

10

Wallet Layers for Ethereum Staking(Solutions to Challenge 1)● Staking initiatedfrom cold walletfor security.
● Use of hot wallets
minimized.

Hot wallet
DepositDepositors

Liquidity
Providers

photReserve

Withdrawers

Cold● Extra liquidity maystaking
DepositrewardContract
be secured with
Cold wallet
liquid staking.
denotes a flow of ethers
denotes address(es)Liquidity
Providerspstake11

Wallet Allocation (Solutions to Challenge 1)
Set the target staking ratio and decide the number of 32 ETH units.
npstake

X · pstake
+ 0.5
n=32

if X >

16
1 − (phot + pstake )32 ETH × n
Deposited stake:
Total customer balance:
X ETH
10%hot75%
cold

stakedThe exchange need to regularly perform deposit or full withdrawal
to maintain the asset distribution across wallet layers.
12Software Security (Solutions to Challenge 2)
Nodes run online, and key protection becomes important.
● Client software must be kept up to date.
● Security audit may be required according to risk control.
Node diversity should also be considered.

Validator● Instability caused by specific software
may impact the operation.

CL clientPeer-to-Peer

EL client
Exchange’s Infrastructure

13

Staking with Cloud Infrastructure(Solutions to Challenge 3)

Following advantages can be considered:● Easy to scale in and out. Easy to provision new nodes.
● Higher bandwidth with fast network backbone.
● Built-in security functions at various layers.
Similar infrastructure stack can be built across Azure / GCP / AWS.
● Some diﬀerences do exist. (e.g. VM’s state / IAM / logging)● Multi-cloud approach may be better to avoid vendor lock-in.
14

Experiment on Holesky Testnet
Testing staking with cloud infrastructure●●●Performance Results
Operational Results
Proﬁtability Evaluations

15

Staking Architecture on Cloud
We built Solo-Staking infrastructure on Microsoft Azure.
● VM #1 : 4 validators
VM #2 : 16 validators● Employed Web3Signerwith PostgreSQL toprevent slashing.
● BLS keypair generatedby Staking Deposit CLI
on an isolated VM.

slashing
onprotecti

Web3Signer

loadAzure
Key Vault

Validator (Prysm)

store

CL client (Prysm)
EL client (Nethermind)
OS (Ubuntu 22.04)
Two virtual machines

PostgreSQL

seedSSH

Staking
Deposit CLIkeyuse
Node operator

16Performance Result● CL/EL consume high resources regardless of # of validators.
High network bandwidth requirements.
● Validators consume
very few resources.
Multiple instances
can be deployed ona single machine.

Total CPU Utility(95th percentile)
Memory usage(average)
Storage used
Total storage IO perminute (average)
Total network usage
per minute (average)

0.32 vCPU (minimum)
0.84 vCPU (maximum)
0.48 vCPU (average)
8.93 GiB (Nethermind, EL client)2.54 GiB (Prysm, CL client)
0.04 GiB (Prysm, per each validator)
85 GiB (Nethermind, EL client)
55 GiB (Prysm, CL client)
170 MiB (write)
20 MiB (read)
39 MiB (incoming)
43 MiB (outgoing)17Performance Result (CPU & Network)
30%
25%
20%
15%

Mon 56 AM

12 PMPercentage CPU (Avg), vm2
57.0 MiB
47.5 MiB
38.0 MiB
28.5 MiB
19.0 MiB
9.5 MiB
0.0 MiB

Mon 56 AM

UTC

6 PM

UTC

23.6 %

12 PM

Network In Total (Avg), vm2
Network Out Total (Avg), vm2

6 PM

34.0 MiB
39.1 MiB

18

Performance Result (Disk IO)
950 MiB
760 MiB
570 MiB
380 MiB
190 MiB0 MiB

Mon 56 AM

12 PM

Disk Read Bytes (Avg), vm2Disk Write Bytes (Avg), vm2

6 PM

UTC

6 MiB
327 MiB

19

Operational Results
In-place upgrade

Unplanned migration

Update OS / node software.

Simulates disaster recovery.

● Result: < 6 min. oﬄine.
1 – 2 attestation misses.
● Switch-over to a replica
node may have further
reduced misses.

● Result: 1 – 2 attestation
misses in hot standby.
● Slashing protection must
be conﬁgured properly.
● Cold standby case may
require 5+ hours bootup.
(approx. 50 epochs)
20

Proﬁtability Evaluation● Hosting multiple (n) validators on a single VM.
● Expected reward can be estimated from # of active validators,or otherwise calculated from the past statistics.
(Does not include MEV reward)
Daily operational cost: x USD / VM
Daily staking reward: y ETH / validator
z USD / ETH
Exchange rate:# of validators on VM: nAnnual Percentage Yield:

365(y − x/nz)
A=32

21

Further Improvements Identiﬁed● Other infrastructure options
On-premises may be more cost-eﬀective in some cases.
For example, large-scale staking or use of special hardware.
● Reducing attestation misses
Attestation misses observed unrelated to node stability.
Cause is unknown, but presumed to be speciﬁc to testnet.
● Finding appropriate staking ratio in asset distribution
Higher staking ratio can increase proﬁts, but having lower
hot ratio may impact the exchange operations.
22

Conclusion● Exchanges can invest ETHs with a low-risk proﬁle by staking.
○ A wallet architecture must consider operability.
○ Cloud environment eases staking for exchanges.
● Experiment on Holesky demonstrated 2.84% APY w/o MEV.
Next step: large-scale test on Mainnet.
● Further investigations required: reducing attestation misses,
increasing node diversity, proﬁtable asset distribution.
23