Optimism
Optimism
Optimism
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
web3_sha3 computes the Keccak-256 hash of the hex-encoded data you pass in and returns the 32-byte digest as a 0x-prefixed string. Despite the method name, this is the original Keccak-256 that Ethereum and every EVM chain rely on — not the later NIST SHA3-256 standard, which produces different output. Because OP Mainnet is an OP Stack EVM rollup that settles to Ethereum L1 and uses ETH for gas, it uses exactly the same hashing as Ethereum, so results match mainnet byte for byte. Call it at https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
Transfer(address,address,uint256) — to build topics filters for eth_getLogs when indexing OP Mainnet contracts.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | data | string | Oui | Arbitrary data to hash, provided as a 0x-prefixed hex string. Empty input (`"0x"`) is valid. |
| Type | Description |
|---|---|
| string | 0x-prefixed 32-byte (64-character) Keccak-256 hash of the input. |
Try it live in the Optimism playground.
| Code | Message | Cause |
|---|---|---|
-32602 | invalid argument | Input is not a valid 0x-prefixed hex string. |
0x-prefixed hex-encoded bytes, not a raw UTF-8 string — encode text to hex first, or you will hash the wrong bytes and get a mismatched digest.sha3 function can return a different hash unless it specifically implements Ethereum's Keccak variant, so verify your local library matches the on-chain result.Paramètres
0x-prefixed hex string