Add Secure Key
Additional security layer.
To enhance the security and control over who can execute the assigned LitAction
granted to your PKP, you have the option to implement a Secure Key. This mechanism is analogous to using an API key, serving as an additional layer of authorization.
Generating the Secure Key
This secure key is generated when running setActions()
where you will receive a 32-byte hash key. This key is generated randomly and returned.
Store this key in a secure location, your LitAction will not run without it.
How It Works
Hash Generation: The SHA-256 hash of the Secure Key is computed and permanently associated with the
LitAction
.Execution: When you attempt to run the
LitAction
, you must provide the correct Secure Key as a parameter.Validation: A function within the
LitAction
will then compare the SHA-256 hash of the provided key against the original hash stored in theLitAction
.Outcome:
Success: If the hashes match, the
LitAction
will execute.Failure: If the hashes do not match, the
LitAction
will not execute.
Last updated