[Feature] Adding a pseudorandom number generator function to ChaCha that takes in Aleo Address and a uint64 as parameters to generate extremely unrepeatable unique IDs #27968
Labels
feature
A new feature.
🚀 Feature
As discussed with Pranav on the dev hour call, the function should work similar to the normal ChaCha rand function, but take three arguments:
Using these a pseudorandom Field will be generated that is so unlikely to be repeated that the probability of it repeating never exceeds 10^(-29)
Motivation
The reason this is important to us is because we want to map something to both the recipient and the sender in the form of Aleo mappings, and such unique unrepeatable IDs would help us achieve that. Each transaction in our Aleo program would lead to one of these IDs being created, hence it is better to do this inside the Leo code itself.
Implementation
Assuming the implementation used is similar to what we have so far used at the javascript layer, the following code just needs to be converted to Rust in the base library for this to work.
Are you willing to open a pull request?
No!
The text was updated successfully, but these errors were encountered: