entropyxyz / entropy-docs

Documentation for Entropy.
https://docs.entropy.xyz
GNU Affero General Public License v3.0
3 stars 1 forks source link

What can programs do? #113

Closed johnnymatthews closed 1 month ago

johnnymatthews commented 3 months ago
ameba23 commented 3 months ago
  • Is there a size limit for programs?

Currently the binary may not be more than 1mb

  • What can I call?

Im not sure exactly what you are asking. You must implement an 'evaluate' function which takes a configuration (a byte array which is set once when the program is delployed), auxiliary data (a bytes array which is given with each signature request) and the message. You can also implement a 'custom hash' function defining how the message is hashed before being signed. You don't have access to any filesystem or network operations from within a program.

This defines how a program should look: https://github.com/entropyxyz/programs/blob/master/wit/application.wit

  • Can I call other chains or things external to the program.

Not from within the program as it needs to be deterministic, but you can pass 'oracle data' in. The idea is that making external calls happens through a call to the chain, so that all TSS nodes who make that call get the same output. This is not yet fully implemented. @JesseAbram can explain it better.

  • Can I call other programs?

Not yet - this is planned. But for now you can set a list of programs which are evaluated one after the other. Eg: first check a signature in the auxiliary data with the device key proxy program, then check that the message is an EVM transaction with the 'to' field matching an allow list with the ACL program, etc.

  • Can I get randomness within a program?

Programs don't have access to the operating system random number generator. I don't know if theres some other way to get randomness. But if the program is not deterministic there will be problems, as you will only get a signature if all TSS nodes involved in the signature request successfully evaluate the program. But you can pass some random data into the program.