Reencryption
Last updated
Last updated
The library provides a convenient function that generates a JSON object based on the EIP-712 standard. This JSON object includes a public key and is specifically designed to facilitate data reencryption in a smart contract environment.
By utilizing this JSON object and having it signed by the user, a secure process of reencrypting data becomes possible within a smart contract. The signed JSON includes the necessary information, including the public key, which allows for seamless reencryption of the data.
options
(required):
verifyingContract: string
(required): The address of the contract
name: string
(optional): The name used in the EIP712
version: string
(optional): The version used in the EIP712
FhevmToken
contractAddress: string
(required): address of the contract
ciphertext: Uint8Array | string
(required): a ciphertext, as a binary or hex string, to decrypt
number
This method allows you to store the signature of a public key for a specific contract, in order to retrieve it later. The signature is also serialized in serializeKeypairs
.
contractAddress: string
(required): address of the contract
signature: string
(required): the signature of the EIP-712 token
This method returns true if contract has a keypair and a signature.
contractAddress: string
(required): address of the contract
boolean
This method returns the saved public key and signature for a specific contract. If the contract has no keypair or no signature, this method returns null
.
contractAddress: string
(required): address of the contract
TokenSignature
or null
This method is useful if you want to store contract keypairs in the user LocalStorage.
ExportedContractKeypairs
: