ckb-std type-id
Type ID describes a way of using a special type script which can create a singleton type - there's only one live cell of this type. With Type ID nobody could create another code cell with the same type script hash, which makes it a useful companion to
Typehash type.
By CKB RFC
The above RFC introduces the concept of Type ID. The ckb-std library provides a utility function, type_id::check_type_id, to validate whether a script conforms to the Type ID rules.
type_id::check_type_id
Validates that the script follows the Type ID rule.
(It requires "type-id" feature in ckb-std enabled.)
Syntax
pub fn check_type_id(offset: usize) -> Result<(), SysError>
Parameters
offset: The byte offset in the script's args where the Type ID starts.
Return
If the function succeeds, return ().
If the function fails, return SysError.