-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapplication.wit
22 lines (19 loc) · 971 Bytes
/
application.wit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package entropy:core
world program {
// similar to `variant`, but no type payloads
variant error {
/// The signature request is invalid (ie. the `initial-state` )
invalid-signature-request(string),
evaluation(string)
}
/// Evaluates the program given the user's signature request and the program's configuration.
export evaluate: func(signature-request: signature-request, config: option<list<u8>>, oracle-data: option<list<list<u8>>>) -> result<_, error>
/// Programs that use custom hash functions can a custom 32-byte curve point to be signed.
export custom-hash: func(data: list<u8>) -> option<list<u8>>
record signature-request {
/// Preimage of the user's data that will be signed (eg. RLP-encoded ETH transaction request).
message: list<u8>,
/// Auxiliary data optionally required for program evaluation; this won't be signed (eg. zero-knowledge proof, third party signature)
auxilary-data: option<list<u8>>
}
}