register_viewing_key
Register a viewing key in the Directory contract
Register a 32-byte AES-256 viewing key in the Directory genesis contract for SRC20 event decryption.
Signatures
def register_viewing_key(
w3: Web3,
encryption: EncryptionState,
private_key: PrivateKey,
key: Bytes32,
) -> HexBytes
async def async_register_viewing_key(
w3: AsyncWeb3,
encryption: EncryptionState,
private_key: PrivateKey,
key: Bytes32,
) -> HexBytesParameters
Parameter
Type
Description
w3
Web3 / AsyncWeb3
Web3 instance with Seismic support
Returns
HexBytes — transaction hash.
Example
Notes
Uses a shielded write (
setKey(suint256)) — the key is encrypted in transitRegistering a new key overwrites the previous one
The key is stored per
msg.senderaddresscompute_key_hash(key)returns thekeccak256hash used for event topic filtering
See Also
get_viewing_key — Fetch your viewing key back
check_has_key — Check if an address has a registered key
Last updated

