Typed data hashing and signing
Last updated
Was this helpful?
Last updated
Was this helpful?
The whole idea is heavily inspired by . To get a signature needed to calculate hash(hash(domain), hash(aci), hash(data))
.
hash
function is blake2b
.
domain
is a record containing not required properties:
name
as string,
version
as integer,
networkId
as string,
contractAddress
as ct-encoded string.
aci
is part of a complete contract ACI. It defines a type of data to sign. For example, the ACI
corresponds to the data
domain
and data
are fate-encoded before hashing. aci
is prepared for hashing according to .
— calculates signature, supported in AccountMemory and in aepp-wallet connection;
— calculates the overall hash of typed data to sign;
— deterministic hashing of an arbitrary JS value, used to calculate hash(aci)
;
— use for debugging or to prepare the hash value for smart contract.