Module src.simple_sign.sign
Orcfax simple sign.
Functions
def main() ‑> None
-
Primary entry point for this script.
Useful article on sub-commands (which are strangely harder than they should be):
https://dev.to/taikedz/ive-parked-my-side-projects-3o62
def retrieve_aliased(context: KupoContext,
policy_id: str,
tag: str,
value: int,
callback: Callable) ‑> str-
Retrieve another public key aliased by the given lookup.
The result might then be used to verify using one of the other methods in this library, e.g. given an staking key returned for an alias, verify if the staking key also holds the correct amount of stake for a given token.
NB. to keep in mind, does aliasing already guarantee a license is held? If the policy is supplied?
Aliasing can potentially be a generic process, it exists in this library by way of helping realize that. It could be removed in future, and so any feedback is appreciated if it works for you.
For more information; https://docs.orcfax.io/signing-key-aliasing
def retrieve_env_notaries() ‑> list
-
Retrieve notaries from the environment.
def sign_with_key(data: str, signing_key: str) ‑> str
-
Sign with an signing key.
def signature_in_constitution_config(pkey: str) ‑> bool
-
Validate whether signing key matches one of those listed in a configuration file.
def signature_in_constitution_datum_utxo(pkey: str) ‑> bool
-
Validate whether signing key matches one of those a list of addresses in a given constitution UTxO.
def signature_in_dapp_environment(pkey: str) ‑> bool
-
Validate whether signing key matches one of those configured in the environment of the dApp.
Largely a method for early prototyping. This isn't the most secure approach to doing this and especially not for use in decentralized systems. This check is only for projects with complete control over their own project.
def signature_in_license_pool(context: KupoContext,
pkey: str,
policy_id: str,
suffix: str = '') ‑> bool-
Validate whether signing key matches one of those in a pool of licenses associated with the project and return True if so.
def signature_in_staked_pool(context: KupoContext,
pkey: str,
token_policy_id: str,
min_stake: int) ‑> bool-
Validate whether the signing key belongs to a someone who has enough stake in a given token.
def signing_handler(data: str, signing_key: str) ‑> str
-
Handle signing functions.
def verify_handler(data: str) ‑> dict
-
Verify input data.
def verify_signature(data: str) ‑> dict
-
Verify a signature with an address.
Classes
class UnknownSigningKey (*args, **kwargs)
-
Exception to raise when the signing key is unknown.
Expand source code
class UnknownSigningKey(Exception): """Exception to raise when the signing key is unknown."""
Ancestors
- builtins.Exception
- builtins.BaseException