Open wighawag opened 2 years ago
If you are eager to do it yourself, things are already there in some form:
Like this, you won't have to get the round number inserted into the format already you just don't include it. This library does it all for your so you don't have to care about these things, but they're not that hard to get right.
It should actually be as simple as not including the round number here (maybe put -1 instead? ): https://github.com/drand/tlock-js/blob/4eb726ac5e4468f76dcf4cf1c82817cc99992225/src/drand/timelock-encrypter.ts#L20
And then changing the decryption to specify the round number manually instead of parsing it: https://github.com/drand/tlock-js/blob/4eb726ac5e4468f76dcf4cf1c82817cc99992225/src/drand/timelock-decrypter.ts#L19-L25
Thanks @nikkolasg and @AnomalRoil for your input
I created this PR for it : https://github.com/drand/tlock-js/pull/7
I tried to minimize breaking changes but due to optional args I had to make some,
In my use case, the encryptor do not want the decryptor to know when decryption is possible. This is because in my use case, the timing needs to remains secret.
To avoid the decryptor to check the decryption at every epoch, one idea is that encryptor will provide the decryptor the minutes (and seconds) to check but will not tell the day/hour.
See conversation slack :
If tlock-js could left out the decrypting time, application could provide their own mechanism