2 Step Minting
Last updated
Last updated
Bear Arena introduces a unique two-step minting process designed to enhance security and ensure fairness in the creation of new bears. This section explains why this process is necessary and how it benefits players by leveraging blockchain technology to generate random but predictable results.
In blockchain games, the transparency and predictability of on-chain transactions can sometimes be exploited. To mitigate predictability and enhance the integrity of the game's mechanics, Bear Arena employs a two-step minting process that utilizes "future random" generation.
IMPORTANT: Please check Consequences of Exceeding Block Limit section before proceeding with mint!
Future Random Explained: Future random is a technique that involves selecting a future block number at the time of the initial transaction. The randomness is not derived from the current state of the blockchain, which is known, but from the future state of the blockchain at that specific block, which is unknown at the time of the transaction.
Generating Randomness: By relying on the hash of a future block to determine the stats, rarity, and elements of bears, we ensure that the outcome cannot be predicted by anyone at the time of the minting request. This adds a layer of security and fairness, as it prevents manipulation by ensuring that no party has knowledge of the random results ahead of time.
First Transaction - Making a Reservation:
When a player decides to mint a bear, they initiate the first transaction, which reserves their right to mint a bear. This reservation includes recording the future block number that will be used to generate randomness.
Waiting for the Block:
After the reservation transaction, players must wait until the blockchain reaches the designated future block. This ensures that the randomness used in the minting process is based entirely on the data from that block, which was unknown at the time of the first transaction.
Second Transaction - Completing the Mint:
Once the specified block is confirmed, players complete the minting process with a second transaction. This transaction calls a function that retrieves the block hash of the specified future block and uses it to generate the characteristics of the bear, ensuring that each bearβs attributes are the result of secure, verifiable randomness.
Enhanced Security: Using future random ensures that the minting process is protected against any predictive strategies that could otherwise exploit the transparency of blockchain technology.
Fairness in Gameplay: Each bear is minted with characteristics that are determined by an unpredictable, external randomness source, ensuring all players have an equal chance of obtaining bears of varying rarities and strengths.
Transparency and Trust: Players can verify that the randomness used in minting their bears comes from the blockchain itself, fostering a greater sense of trust in the game's fairness and integrity.
When engaging in the two-step minting process in Bear Arena, it is vital to understand and act within the constraints set by blockchain technology, particularly the limitation related to how far back a smart contract can read on the blockchain.
256 Block Limit: Ethereum smart contracts can only interact with and read data from the most recent 256 blocks. If a transaction attempts to reference data from a block that is older than 256 blocks, it cannot be processed. This is a built-in limitation of the Ethereum Virtual Machine (EVM) to ensure performance and security across the network.
Reservation Expiry:
In the context of Bear Arena's minting process, each reservation to mint a bear specifies a future block whose data will determine the randomness used to assign traits to your bear.
If you do not complete the second transaction (the actual minting) before the blockchain progresses beyond 256 blocks from your reservation's target block, your reservation will expire.
Loss of Reservation and Funds:
Failing to mint your bear within this 256-block window results in the loss of your reservation. This means that the initial transaction and any funds associated with reserving your bear are irrecoverable.
It is crucial to monitor the block height actively and ensure that you complete the minting before your reservation expires.
Monitor the Blockchain Closely: Keep track of the block number at the time of your reservation and calculate the window during which you must complete the minting. Tools and services that track blockchain blocks can assist you in this monitoring.
Set Reminders: Consider setting up alerts or reminders to notify you as the deadline approaches. This can help prevent your reservation from expiring unnoticed.
Act Promptly: Once the block used for generating randomness is confirmed, complete the second transaction as soon as possible to secure your minted bear and avoid any risk of expiration due to passing the 256-block threshold.
Understanding and respecting the 256-block limitation is crucial for participating effectively in Bear Arena's minting process. By ensuring timely action, you can avoid unnecessary losses and enjoy a smoother and more secure gaming experience.