Module agora.script.Lock
Contains the Lock / Unlock definitions
These are the types that will ultimately
replace the signature
in the Input
and the address
in the Output
.
The Lock type contains a tag, allowing 4 different types of lock scripts:
Key => lock is a 64-byte public key,
unlock is expected to be a signature.
KeyHash => lock is a hash of a 64-byte public key,
unlock is expected to be a pair of
Functions
Name | Description |
---|---|
genKeyLock(key)
|
Compatibility (however may only be signed with Schnorr) |
genKeyLock(key)
|
Generates a LockType.Key lock script. |
genKeyUnlock(sig)
|
Generates a LockType.Key unlock script. |
toLockType(value, lock)
|
Converts the byte to one of the recognized lock types. |
validateLockSyntax(lock, StackMaxItemSize)
|
Validates the Lock script's syntax on its own. For user's safety, Agora's protocol rules disallow accepting an Output with a syntactically invalid Lock script. This prevents accidental loss of funds, for example in cases where the lock script is ill-formed (e.g. missing END blocks, dangling ELSE statements, etc). |
Structs
Name | Description |
---|---|
Lock
|
Contains a tag and either a Hash or set of opcodes |
Unlock
|
Contains a data tuple or a set of push opcodes |
Enums
Name | Description |
---|---|
LockType
|
The input lock types. |