← Developer Forum

Entropy·help question

Announcing Entropy V2

Open on dev-forum →Back to forum

gm gm Pythians

The Pyth contributors have rolled out Entropy V2, a major developer experience upgrade to Pyth’s on-chain randomness protocol.

Entropy V2 introduces:

  1. Configurable Gas Limits for Callbacks
  2. Enhanced Callback Statuses
  3. Upcoming Public Entropy Explorer
  4. Improved Reliability

Configurable Gas Limits :fuel_pump:

Now, users can set custom gas limits for callbacks while requesting random numbers.

function requestRandomNumberWithCustomGas(
  uint32 customGasLimit
) external payable {
  // Calculate the fee for the custom gas limit
  uint256 fee = entropy.getFeeV2(customGasLimit);
 
  // Request random number with custom gas limit
  uint64 sequenceNumber = entropy.requestV2{ value: fee }(customGasLimit);
}

Moreover, IEntropyV2 introduces several new ways to request random numbers:

Entropy uses 2-party random number generation procedure, which is an extension of a simple commit/reveal protocol. Please read the Protocol Design for the full explanation.

NOTE: This update is backward compatible. If you are using Entropy already in your smart contracts, you don’t need to update your contracts unless you want to need custom gas limits for your callbacks.

Enhanced Callback Statuses

Entropy V2 introduces callback statuses, which allow users to track the status of their callbacks.
These callback statuses are emitted in the Revealed event. The new interface of the event includes bool callbackFailed flag, which helps users to easily tracks the status of their callbacks.

event Revealed(
    address indexed provider,
    address indexed caller,
    uint64 indexed sequenceNumber,
    bytes32 randomNumber,
    bytes32 userContribution,
    bytes32 providerContribution,
    bool callbackFailed,
    bytes callbackReturnValue,
    uint32 callbackGasUsed,
    bytes extraArgs
);

Entropy Explorer :magnifying_glass_tilted_left:

Entropy V2 introduces an public Entropy Explorer, which will allow teams to easily track the status of their callbacks and re-request them if they fail on-chain.

entropy-explorer.pyth.network

Pyth Network Entropy Explorer

Explore interactions with the Pyth Network Entropy on-chain random number generator.

Improved Reliability

Entropy V2 introduces a more resilient callback architecture, adding an expanded keeper network which improves delivery guarantees.

This enhancement builds on the original design and enables requests to be fulfilled more reliably during unstable chain conditions.

Let’s Discuss Entropy V2! :speech_balloon:

This is an open discussion thread for Entropy V2. Please use this space to:

Share your feedback:

Show off your builds:

Ask questions:

Resources

Showing the original post only. Read the full thread on dev-forum.pyth.network ↗

Replies: 4
Views: 596
Likes: 2
Posted: 7/30/2025

Source: https://dev-forum.pyth.network/t/announcing-entropy-v2/324 · external id 324