Lesson 5

Mining on Stacks

This module explains the mining process on the Stacks blockchain, including how it works, the rewards and costs associated with mining, and the tools required for setup. The focus is on understanding how miners use Bitcoin to secure the Stacks network and earn STX tokens.

Mining Process

Mining on the Stacks blockchain operates through the Proof of Transfer (PoX) consensus mechanism, which ties Stacks directly to Bitcoin. In PoX, miners commit Bitcoin (BTC) to participate in the network’s consensus process, providing security and ensuring the integrity of the Stacks blockchain. Here’s a detailed look at how the mining process works.

To start mining, miners need to set up a Stacks node. This involves installing and configuring the necessary software to run the node. Once operational, miners commit BTC by sending it to designated addresses on the Bitcoin blockchain. These addresses belong to stackers—participants who lock their STX tokens to support the network. The committed BTC secures the Stacks blockchain by leveraging Bitcoin’s Proof of Work (PoW) consensus mechanism.

Miners compete to be selected to create the next block on the Stacks blockchain. The selection process uses a verifiable random function (VRF) to ensure fairness. The more BTC a miner commits, the higher their chances of being selected. Once a miner is selected, they write the new block to the Stacks blockchain and receive newly minted STX tokens as a reward. This process repeats for each block, with miners continually committing BTC to participate in the network.

Mining Rewards and Costs

Mining rewards on the Stacks blockchain include newly minted STX tokens and transaction fees from the blocks they mine. Initially, miners receive 1,000 STX per block, but this amount is halved every four years, similar to Bitcoin’s halving schedule. The reward reduces to 500 STX per block after the first four years, then to 250 STX, and finally to 125 STX per block indefinitely.

Miners also earn transaction fees from the transactions included in the blocks they produce. These fees, along with the block rewards, mature after 100 Bitcoin blocks, typically around 24 hours. This delay ensures the stability and security of the reward distribution process.

The primary cost associated with mining on Stacks is the BTC that miners commit to the network. Additionally, miners need to maintain their Stacks and Bitcoin nodes, which requires computing resources. The recommended setup includes a server with at least 2 virtual CPUs, 8 GB of RAM, and sufficient disk space to store blockchain data.

Mining Tools and Setup

To start mining on the Stacks network, miners need to follow several steps:

  1. Set Up a Bitcoin Node: Miners must run a Bitcoin node to interact with the Bitcoin blockchain. This node helps verify BTC transactions and maintain connectivity with the Bitcoin network.
  2. Set Up a Stacks Node: Miners install and configure a Stacks node. This involves downloading the Stacks blockchain software and setting up the necessary configurations to enable mining. The node setup includes specifying the Bitcoin node details and configuring the mining client.
  3. Generate Keychain and Configurations: Miners generate a keychain and create configuration files that include their private keys and other necessary settings. This ensures the mining client can properly interact with the Stacks and Bitcoin networks.
  4. Running the Miner: After setting up the nodes and configurations, miners run the mining client. The client commits BTC to the specified addresses, participates in the leader election process, and writes new blocks to the Stacks blockchain when selected.

Miners can use tools like Docker to simplify the setup process, allowing them to run and manage their nodes efficiently. Docker provides a containerized environment that encapsulates all necessary dependencies and configurations, making it easier to deploy and maintain the mining setup.

Highlights

  • Mining Process: Mining on Stacks uses the Proof of Transfer (PoX) consensus mechanism. Miners commit Bitcoin (BTC) to the network to participate in the consensus process and secure the blockchain. The committed BTC is distributed to STX holders who lock their tokens in a process called stacking.
  • Mining Rewards and Costs: Miners receive STX tokens as rewards for creating new blocks. The reward starts at 1,000 STX per block and halves every four years. Miners also earn transaction fees included in the blocks they mine. The main cost for miners is the BTC they commit to the network, along with maintaining their mining setup.
  • Mining Tools and Setup: To start mining, miners need to set up both a Bitcoin node and a Stacks node. The Stacks node interacts with the Bitcoin blockchain, verifying BTC transactions and managing commitments. Tools like Stacks.js, Stacks CLI, and Docker can simplify the setup and management process.
  • Proof of Transfer (PoX): PoX involves miners transferring BTC to addresses chosen by the network, which belong to participants in stacking. This mechanism ties the security of the Stacks blockchain to Bitcoin’s robustness, making attacks on Stacks highly impractical without also compromising Bitcoin.
  • Economic Model and Incentives: The PoX mechanism aligns economic incentives by rewarding miners with STX tokens and stackers with BTC. This dual incentive system ensures that both miners and stackers are motivated to maintain the network’s security and stability, creating a sustainable and secure ecosystem.
Disclaimer
* Crypto investment involves significant risks. Please proceed with caution. The course is not intended as investment advice.
* The course is created by the author who has joined Gate Learn. Any opinion shared by the author does not represent Gate Learn.
Catalog
Lesson 5

Mining on Stacks

This module explains the mining process on the Stacks blockchain, including how it works, the rewards and costs associated with mining, and the tools required for setup. The focus is on understanding how miners use Bitcoin to secure the Stacks network and earn STX tokens.

Mining Process

Mining on the Stacks blockchain operates through the Proof of Transfer (PoX) consensus mechanism, which ties Stacks directly to Bitcoin. In PoX, miners commit Bitcoin (BTC) to participate in the network’s consensus process, providing security and ensuring the integrity of the Stacks blockchain. Here’s a detailed look at how the mining process works.

To start mining, miners need to set up a Stacks node. This involves installing and configuring the necessary software to run the node. Once operational, miners commit BTC by sending it to designated addresses on the Bitcoin blockchain. These addresses belong to stackers—participants who lock their STX tokens to support the network. The committed BTC secures the Stacks blockchain by leveraging Bitcoin’s Proof of Work (PoW) consensus mechanism.

Miners compete to be selected to create the next block on the Stacks blockchain. The selection process uses a verifiable random function (VRF) to ensure fairness. The more BTC a miner commits, the higher their chances of being selected. Once a miner is selected, they write the new block to the Stacks blockchain and receive newly minted STX tokens as a reward. This process repeats for each block, with miners continually committing BTC to participate in the network.

Mining Rewards and Costs

Mining rewards on the Stacks blockchain include newly minted STX tokens and transaction fees from the blocks they mine. Initially, miners receive 1,000 STX per block, but this amount is halved every four years, similar to Bitcoin’s halving schedule. The reward reduces to 500 STX per block after the first four years, then to 250 STX, and finally to 125 STX per block indefinitely.

Miners also earn transaction fees from the transactions included in the blocks they produce. These fees, along with the block rewards, mature after 100 Bitcoin blocks, typically around 24 hours. This delay ensures the stability and security of the reward distribution process.

The primary cost associated with mining on Stacks is the BTC that miners commit to the network. Additionally, miners need to maintain their Stacks and Bitcoin nodes, which requires computing resources. The recommended setup includes a server with at least 2 virtual CPUs, 8 GB of RAM, and sufficient disk space to store blockchain data.

Mining Tools and Setup

To start mining on the Stacks network, miners need to follow several steps:

  1. Set Up a Bitcoin Node: Miners must run a Bitcoin node to interact with the Bitcoin blockchain. This node helps verify BTC transactions and maintain connectivity with the Bitcoin network.
  2. Set Up a Stacks Node: Miners install and configure a Stacks node. This involves downloading the Stacks blockchain software and setting up the necessary configurations to enable mining. The node setup includes specifying the Bitcoin node details and configuring the mining client.
  3. Generate Keychain and Configurations: Miners generate a keychain and create configuration files that include their private keys and other necessary settings. This ensures the mining client can properly interact with the Stacks and Bitcoin networks.
  4. Running the Miner: After setting up the nodes and configurations, miners run the mining client. The client commits BTC to the specified addresses, participates in the leader election process, and writes new blocks to the Stacks blockchain when selected.

Miners can use tools like Docker to simplify the setup process, allowing them to run and manage their nodes efficiently. Docker provides a containerized environment that encapsulates all necessary dependencies and configurations, making it easier to deploy and maintain the mining setup.

Highlights

  • Mining Process: Mining on Stacks uses the Proof of Transfer (PoX) consensus mechanism. Miners commit Bitcoin (BTC) to the network to participate in the consensus process and secure the blockchain. The committed BTC is distributed to STX holders who lock their tokens in a process called stacking.
  • Mining Rewards and Costs: Miners receive STX tokens as rewards for creating new blocks. The reward starts at 1,000 STX per block and halves every four years. Miners also earn transaction fees included in the blocks they mine. The main cost for miners is the BTC they commit to the network, along with maintaining their mining setup.
  • Mining Tools and Setup: To start mining, miners need to set up both a Bitcoin node and a Stacks node. The Stacks node interacts with the Bitcoin blockchain, verifying BTC transactions and managing commitments. Tools like Stacks.js, Stacks CLI, and Docker can simplify the setup and management process.
  • Proof of Transfer (PoX): PoX involves miners transferring BTC to addresses chosen by the network, which belong to participants in stacking. This mechanism ties the security of the Stacks blockchain to Bitcoin’s robustness, making attacks on Stacks highly impractical without also compromising Bitcoin.
  • Economic Model and Incentives: The PoX mechanism aligns economic incentives by rewarding miners with STX tokens and stackers with BTC. This dual incentive system ensures that both miners and stackers are motivated to maintain the network’s security and stability, creating a sustainable and secure ecosystem.
Disclaimer
* Crypto investment involves significant risks. Please proceed with caution. The course is not intended as investment advice.
* The course is created by the author who has joined Gate Learn. Any opinion shared by the author does not represent Gate Learn.