Skip to content

Commit c177647

Browse files
committed
2 parents a543de1 + dd0435d commit c177647

File tree

4 files changed

+57
-32
lines changed

4 files changed

+57
-32
lines changed

components/EntropyDeployments.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,6 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
152152
explorer: "https://base-sepolia.blockscout.com/address/$ADDRESS",
153153
gasLimit: "500K",
154154
},
155-
"berachain-testnet": {
156-
rpc: "https://rpc.ankr.com/berachain_testnet",
157-
network: "testnet",
158-
delay: "",
159-
address: "0x26DD80569a8B23768A1d80869Ed7339e07595E85",
160-
explorer: "https://artio.beratrail.io/address/$ADDRESS",
161-
gasLimit: "500K",
162-
},
163155
"berachain-testnet-v2": {
164156
rpc: "https://evm-rpc-bera.rhino-apis.com/",
165157
network: "testnet",
@@ -288,4 +280,20 @@ export const EntropyDeployments: Record<string, EntropyDeployment> = {
288280
network: "mainnet",
289281
rpc: "https://mainnet-rpc.b3.fun/http",
290282
},
283+
"apechain-testnet": {
284+
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
285+
explorer: "https://curtis.explorer.caldera.xyz/address/$ADDRESS",
286+
delay: "",
287+
gasLimit: "500K",
288+
network: "testnet",
289+
rpc: "https://curtis.rpc.caldera.xyz/http",
290+
},
291+
"soneium-minato-testnet": {
292+
address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
293+
explorer: "https://explorer-testnet.soneium.org/address/$ADDRESS",
294+
delay: "",
295+
gasLimit: "500K",
296+
network: "testnet",
297+
rpc: "https://rpc.minato.soneium.org/",
298+
},
291299
};

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const withNextra = require("nextra")({
1919
}),
2020
},
2121
},
22+
latex: true,
2223
});
2324

2425
// Use this array as a shorter way to specify redirect URLs so we can write down a lot of them.

pages/entropy/protocol-design.mdx

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,61 @@
33
The Entropy protocol is an extension of a classical commit/reveal protocol.
44
The original version has the following steps:
55

6-
1. Two parties A and B each draw secret random numbers, `x_A` and `x_B`.
7-
2. A and B hash their random numbers and share the hashes, `h_A = hash(x_A)` and `h_B = hash(x_B)`
8-
3. A and B reveal `x_A` and `x_B`
9-
4. Both parties verify that `hash(x_A) == h_A` and `hash(x_B) == h_B`
10-
5. The random number `r = hash(x_A, x_B)`
6+
1. Two parties A and B each draw secret random numbers, $x_A$ and $x_B$.
7+
2. A and B hash their random numbers and share the hashes, $h_A = \mathrm{hash}(x_A)$ and $h_B = \mathrm{hash}(x_B)$
8+
3. A and B reveal $x_A$ and $x_B$
9+
4. Both parties verify that $\mathrm{hash}(x_A) = h_A$ and $\mathrm{hash}(x_B) = h_B$
10+
5. The random number $r = \mathrm{hash}(x_A, x_B)$
1111

1212
This protocol has the property that the result is random as long as either A or B are honest.
1313
Thus, neither party needs to trust the other -- as long as they are themselves honest, they can
14-
ensure that the result `r` is random.
14+
ensure that the result $r$ is random.
1515

1616
Entropy implements a version of this protocol that is optimized for on-chain usage. The
1717
key difference is that one of the participants (the provider) commits to a sequence of random numbers
1818
up-front using a hash chain. Users of the protocol then simply grab the next random number in the sequence.
1919

20-
**Setup**: The provider P computes a sequence of `N` random numbers, `x_i` for `(i = 0...N-1)`:
20+
**Setup**: The provider P computes a sequence of $N$ random numbers, $x_i$ for $0 \leq i \leq N-1$:
2121

22-
- `x_{N-1} = random()`
23-
- `x_i = hash(x_{i + 1})`
22+
- $x_{N-1} = \mathrm{random}()$
23+
- $x_i = \mathrm{hash}(x_{i + 1})$
2424

25-
The provider commits to `x_0` by posting it to the Entropy contract.
26-
Each random number in the sequence can then be verified against the previous one in the sequence by hashing it, i.e., `hash(x_i) == x_{i - 1}`
25+
The provider commits to $x_0$ by posting it to the Entropy contract.
26+
Each random number in the sequence can then be verified against the previous one in the sequence by hashing it, i.e., $\mathrm{hash}(x_i) = x_{i - 1}$
2727

2828
**Request**: To produce a random number, the following steps occur.
2929

30-
1. The user U draws a random number `x_U`, and submits `h_U = hash(x_U)` to the contract
31-
2. The contract remembers `h_U` and assigns it an incrementing sequence number `i`, representing which
30+
1. The user U draws a random number $x_U$, and submits $h_U = \mathrm{hash}(x_U)$ to the contract
31+
2. The contract remembers $h_U$ and assigns it an incrementing sequence number $i$, representing which
3232
of the provider's random numbers the user will receive.
33-
3. The user submits an off-chain request (e.g. via HTTP) to the provider to reveal the `i`'th random number.
34-
4. The provider checks the on-chain sequence number and ensures it is > `i`. If it is not, the provider
33+
3. The user submits an off-chain request (e.g. via HTTP) to the provider to reveal the $i$'th random number.
34+
4. The provider checks the on-chain sequence number and ensures it is > $i$. If it is not, the provider
3535
refuses to reveal the ith random number. The provider should wait for a sufficient number of block confirmations
3636
to ensure that the request does not get re-orged out of the blockchain.
37-
5. The provider reveals `x_i` to the user.
38-
6. The user submits both the provider's revealed number `x_i` and their own `x_U` to the contract.
39-
7. The contract verifies `hash(x_i) == x_{i-1}` to prove that `x_i` is the `i`'th random number. The contract also checks that `hash(x_U) == h_U`.
40-
The contract stores `x_i` as the `i`'th random number to reuse for future verifications.
41-
8. If both of the above conditions are satisfied, the random number `r = hash(x_i, x_U)`.
37+
5. The provider reveals $x_i$ to the user.
38+
6. The user submits both the provider's revealed number $x_i$ and their own $x_U$ to the contract.
39+
7. The contract verifies $\mathrm{hash}(x_i) = x_{i-1}$ to prove that $x_i$ is the $i$'th random number. The contract also checks that $\mathrm{hash}(x_U) = h_U$.
40+
The contract stores $x_i$ as the $i$'th random number to reuse for future verifications.
41+
8. If both of the above conditions are satisfied, the random number $r = \mathrm{hash}(x_i, x_U)$.
4242
As an added security mechanism, this step can incorporate the blockhash of the block that the
43-
request transaction landed in: `r = hash(x_i, x_U, blockhash)`.
43+
request transaction landed in: $r = \mathrm{hash}(x_i, x_U, \mathrm{blockhash})$.
4444

4545
This protocol has the same security properties as the 2-party randomness protocol above: as long as either
46-
the provider or user is honest, the number `r` is random. Honesty here means that the participant keeps their
47-
random number `x` a secret until the revelation phase (step 5) of the protocol. Note that providers need to
46+
the provider or user is honest, the number $r$ is random. Honesty here means that the participant keeps their
47+
random number $x$ a secret until the revelation phase (step 5) of the protocol. Note that providers need to
4848
be careful to ensure their off-chain service isn't compromised to reveal the random numbers -- if this occurs,
49-
then users will be able to influence the random number `r`.
49+
then users will be able to influence the random number $r$.
50+
51+
With automatic callbacks the flow is simplified:
52+
53+
1. The user U draws a random number $x_U$, and submits **both** $x_U$ and $h_U = \mathrm{hash}(x_U)$ to the contract
54+
2. The contract remembers $h_U$ and assigns it an incrementing sequence number $i$, representing which
55+
of the provider's random numbers the user will receive. $x_U$ is recorded in the event logs.
56+
3. After sufficient block confirmations, the provider submits a reveal transaction with $x_i$ and $x_U$ to the contract.
57+
4. The contract verifies $\mathrm{hash}(x_U) = h_U$ and $\mathrm{hash}(x_i) = x_{i-1}$ to prove that $x_i$ is the $i$'th random number.
58+
5. If both of the above conditions are satisfied,
59+
the random number $r = \mathrm{hash}(x_i, x_U)$ is generated and a callback is made to the requesting contract.
60+
61+
In this flow, providers can refuse revealing $x_i$ if the final random number $r$ is not in their favor, or
62+
they may be able to access $x_U$ before on-chain submission (e.g. via mempool) and rotate their commitments to influence the random number $r$.
63+
Of course, both of these behaviors are detectable and protocols can blacklist providers that exhibit them.

pages/price-feeds/contract-addresses/evm.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Pyth is currently available on the EVM networks below using Pyth Stable price so
6868

6969
| Network | Contract address |
7070
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
71+
| Ape Chain (testnet) | [`0x2880aB155794e7179c9eE2e38200202908C17B43`](https://curtis.explorer.caldera.xyz/address/0x2880aB155794e7179c9eE2e38200202908C17B43) |
7172
| Arbitrum Blueberry (testnet) | [`0xA2aa501b19aff244D90cc15a4Cf739D2725B5729`](https://arb-blueberry.gelatoscout.com/address/0xA2aa501b19aff244D90cc15a4Cf739D2725B5729) |
7273
| Arbitrum Sepolia (testnet) | [`0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF`](https://sepolia-explorer.arbitrum.io/address/0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF) |
7374
| Astar zkEVM testnet | [`0x8D254a21b3C86D32F7179855531CE99164721933`](https://zkatana.blockscout.com/address/0x8D254a21b3C86D32F7179855531CE99164721933) |
@@ -138,6 +139,7 @@ Pyth is currently available on the EVM networks below using Pyth Stable price so
138139
| Scroll Sepolia | [`0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c`](https://sepolia-blockscout.scroll.io/address/0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c) |
139140
| Sepolia (Ethereum testnet) | [`0xDd24F84d36BF92C65F92307595335bdFab5Bbd21`](https://sepolia.etherscan.io/address/0xDd24F84d36BF92C65F92307595335bdFab5Bbd21) |
140141
| Shimmer testnet | [`0x8D254a21b3C86D32F7179855531CE99164721933`](https://explorer.evm.testnet.shimmer.network/address/0x8D254a21b3C86D32F7179855531CE99164721933) |
142+
| Soneium (testnet) | [`0x2880aB155794e7179c9eE2e38200202908C17B43`](https://explorer-testnet.soneium.org/address/0x2880aB155794e7179c9eE2e38200202908C17B43) |
141143
| Viction testnet | [`0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167`](https://testnet.tomoscan.io/address/0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167) |
142144
| WEMIX testnet | [`0x26DD80569a8B23768A1d80869Ed7339e07595E85`](https://explorer.test.wemix.com/address/0x26DD80569a8B23768A1d80869Ed7339e07595E85) |
143145
| ZKFair testnet | [`0xA2aa501b19aff244D90cc15a4Cf739D2725B5729`](https://testnet-scan.zkfair.io/address/0xA2aa501b19aff244D90cc15a4Cf739D2725B5729) |

0 commit comments

Comments
 (0)