BNB Smart Chain
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
BNB Smart Chain
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
BNB Smart Chain leans on hashing to identify functions and log topics, the chain where BEP-20 contracts emit events constantly and fees are paid in BNB. web3_sha3 exposes that primitive over RPC. Pass it a 0x-prefixed hex blob and the node returns the Keccak-256 digest of those raw bytes as a 32-byte hex value. The naming is a well-known trap. Despite the sha3 label, this computes Keccak-256, not the later NIST SHA3-256 standard, and the two produce different output for the same input. Send your data to https://bsc.therpc.io/YOUR_API_KEY on chain ID 56 to get the canonical hash the EVM itself uses.
eth_getLogs filter and match exactly the events you care about.| # | 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 BNB Smart Chain playground.
| Code | Message | Cause |
|---|---|---|
-32602 | invalid argument | Input is not a valid 0x-prefixed hex string. |
sha3 routine will quietly return a different digest unless it explicitly implements the EVM's Keccak variant.Paramètres
0x-prefixed hex string