API Reference

StarkLinkRandomness interface

External Functions defined for the IStarkLinkRandomness interface:
Function
Description
set_beacon_public_key_hash(public_key_hash : felt)
Stores the public_key_hash in memory for the calling address.
request_rng(beacon_address : felt)
Requests randomness from the given beacon address. Will require a sufficient allowance to the beacon address if there is a fee. Returns a request_id that can be used by the calling application to keep track of unresolved requests.
resolve_rng_request(request_index: felt, gamma_point: EcPoint, c: BigInt3, s: BigInt3, public_key: EcPoint)
Verifies a randomly generated number was generated properly using a given public input and a private key. Then it calls the will_recieve_rng function of the requesting application. Finally it marks the rng_request as completed.
View Functions defined for the IStarkLinkRandomness interface:
Function
Description
get_request(request_id : felt)
Returns the Request information for a given request_id
get_beacon_hash(beacon_address : felt)
Returns the public_key_hash of the given address