• Sign In
  • Sign Up

BLOG

about

Technical Preliminaries of Bitcoin Staking

Through this and the next articles, we explain how the Babylon protocol overcomes the Bitcoin protocol’s limited programmability, making trustless and self-custodial Bitcoin staking possible. This article focuses on the technical preliminaries, and the next article focuses on constructing Babylon’s Bitcoin staking contract.

1. What Defines a Staking Asset?

To turn Bitcoin into a staking asset, we first need to understand what a staking asset is.

A staking asset is the asset in a PoS (proof-of-stake) system that a participant locks if the participant wishes to make attestations. The most common type of attestation is referred to as a vote. This enables stake-weighted voting protocols, which allow consensus among the participants in a decentralized way. When the decisions are chained, we have a PoS blockchain, and the participants are called validators.

What does this “collateral“ entail?

1.1 Slashing

“With great power comes great responsibility.“

For a PoS system to be secure, its staking asset should at least have the following two properties:

  1. Slashable, meaning that if a staker attacks the PoS system secured by it, its staked asset can be slashed.
  2. Lockable, meaning that once staked, the asset cannot be transferred or traded.

The above two properties go hand in hand: slashability economically deters the staker from acting maliciously, and locking prevents malicious stakers from dodging the slashing (by immediately selling their staked asset after the attack).

Indeed, most PoS systems impose an unbonding period. When a staker requests to unbond, its attestation power is immediately dismissed, so it cannot attack the PoS system. Meanwhile, the staked asset will still be locked for a certain period, giving the system enough time to uncover past attacks from the staker and slash it if needed. This unbonding period can be as long as a few weeks.

1.2 Delegation

Delegation is particularly important for small stakers. Maintaining an attestation infrastructure (such as a validator node) by themselves could be too difficult or costly. They may prefer to delegate their attestation power to a professional validator, who acts as a proxy and charges a fee from the staking rewards.

If the delegated validator violates the protocol, itself and all its delegators are subject to slashing. This implies that the slashing is always applied to everyone or no one. In other words, there is no way for a delegated validator to selectively cause some of its delegators slashed . This property is called atomic slashing. It allows a professional validator to earn trust from delegators by self-delegating stakes.

On the other hand, the delegated validator has no direct access or control of the delegator’s stake, meaning it cannot steal from the staker. This fundamental difference separates delegation from custodial arrangements, where the custodian controls the users’ digital assets.

The above properties define a staking asset. The other properties, such as partial slashing and restakable mentioned in Article-1, are nice-to-have.

2. What Does BTC Allow You to Do?

To turn Bitcoin into a staking asset, we should also understand what the BTC network allows you to do with it. If you are familiar with the terms UTXO, BTC script, and Taproot Script, you can skip this section.

2.1 Bitcoin Transaction and UTXO

The Bitcoin protocol is a peer-to-peer, electronic, decentralized, cryptocurrency protocol, and Bitcoin (BTC) is its native digital asset. 

2.2 Spending Conditions

Speaking of spending, BTC has a scripting language that allows you to specify some simple condition(s) under which a UTXO can be spent. Two basic conditions (which we will use) are:

  • signature(s), which allow you to specify whose consent is needed to spend a UTXO. The owner public key above is an example where only one consent is needed.
  • Time lock, which lets you specify how many BTC blocks a UTXO can be spent later. For example, a time lock of 1000 BTC blocks will make a UTXO temporarily unspendable for about 1000 * 10mins / 60 = 167 hours (roughly a week) after this UTXO’s creation.

2.3 Pre-Approval

What is even cooler is that Alice’s mom can give Alice her pre-approval. Imagine that mom only allows Alice to send the Bitcoin to her dad (not anyone else) before the 7-day restriction is lifted. To achieve this:

  1. Mom prepares a BTC transaction, in which the previous UTXO is spent via the 2nd condition above, and the recipient is set to Alice’s dad.
  2. Mom then signs this transaction and gives Alice her signature.
  3. If Alice does want to send the Bitcoins to her dad, Alice can simply co-signs it and submits it to the BTC network anytime.

Remark

Blockchain security and cryptography are not for everyone, but you have come a long way. Congrats! Now, for our next steps, let’s build a Bitcoin staking contract together!