diff --git a/builtin.aqua b/builtin.aqua index c553266..c0c4bce 100644 --- a/builtin.aqua +++ b/builtin.aqua @@ -251,3 +251,18 @@ service Script("script"): -- Returns a list of existing scripts on the node. -- Each object in the list is of the following structure list() -> []ScriptInfo + +service Sig("sig"): + -- Signs data with the current peer's key. + -- Can only be called on %init_peer_id% + -- Accepts data only from the following sources: + -- trust-graph.get_trust_bytes + -- trust-graph.get_revocation_bytes + -- registry.get_key_bytes + -- registry.get_record_bytes + -- Argument: data - byte array to sign + -- Returns: signature as a byte array + sign(data: []u8) -> []u8 + +-- Given the data and signature both as byte arrays, returns true if the signature is correct, false otherwise. + verify(signature: []u8, data: []u8) -> bool