sui icon indicating copy to clipboard operation
sui copied to clipboard

Add VDF to sui framework

Open jonas-lj opened this issue 1 year ago • 5 comments

Description

This adds a VDF verifier (Wesolowski's construction based on imaginary class groups) to the Sui framework. It can be used to generate on-chain randomness in an 1-out-of-n trust model (see for example this paper for an explanation).

This PR also includes an example of a lottery using VDF to generate it's randomness.

Boilerplate code and snapshots will be added after the review.

Closing #7222.

Test Plan

Unit tests.

Type of Change (Check all that apply)

  • [X] protocol change
  • [X] user-visible impact
  • [X] breaking change for a client SDKs
  • [X] breaking change for FNs (FN binary must upgrade)
  • [X] breaking change for validators or node operators (must upgrade binaries)
  • [ ] breaking change for on-chain data layout
  • [ ] necessitate either a data wipe or data migration

Release notes

Add verifiable delay functions (VDFs) to the Sui framework. The VDF is based on Wesolowski's construction over imaginary class groups. Note that this is supported in Devnet only.

jonas-lj avatar Feb 12 '24 12:02 jonas-lj

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2024 9:36am
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2024 9:36am
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview May 27, 2024 9:36am
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 27, 2024 9:36am
mysten-ui ⬜️ Ignored (Inspect) Visit Preview May 27, 2024 9:36am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 27, 2024 9:36am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 27, 2024 9:36am

vercel[bot] avatar Feb 12 '24 12:02 vercel[bot]

Not sure on the status of this PR but just dropping by for some Move 2024 comments :)

Thanks! I'll make sure to incorporate this. If you have time, it'd be great if you could take a look at the api for the new move functions (vdf.move) and on the example contract (vdf_based_lottery.move) as well.

jonas-lj avatar Apr 05 '24 11:04 jonas-lj

Not sure on the status of this PR but just dropping by for some Move 2024 comments :)

Thanks! I'll make sure to incorporate this. If you have time, it'd be great if you could take a look at the api for the new move functions (vdf.move) and on the example contract (vdf_based_lottery.move) as well.

I took a look but... not sure what sort of feedback you want other than "Yep, those are some crypto functions" lol. A bit out of my element there

tnowacki avatar Apr 05 '24 21:04 tnowacki

Not sure on the status of this PR but just dropping by for some Move 2024 comments :)

Thanks! I'll make sure to incorporate this. If you have time, it'd be great if you could take a look at the api for the new move functions (vdf.move) and on the example contract (vdf_based_lottery.move) as well.

I took a look but... not sure what sort of feedback you want other than "Yep, those are some crypto functions" lol. A bit out of my element there

That's fair :). I'm mainly interested in whether the new move functions the example smart contract follow best practices. The crypto functions just call some functions in fastcrypto that have been reviewed already, so the crypto should be fine.

jonas-lj avatar Apr 09 '24 06:04 jonas-lj

Not sure on the status of this PR but just dropping by for some Move 2024 comments :)

Thanks! I'll make sure to incorporate this. If you have time, it'd be great if you could take a look at the api for the new move functions (vdf.move) and on the example contract (vdf_based_lottery.move) as well.

I took a look but... not sure what sort of feedback you want other than "Yep, those are some crypto functions" lol. A bit out of my element there

That's fair :). I'm mainly interested in whether the new move functions the example smart contract follow best practices. The crypto functions just call some functions in fastcrypto that have been reviewed already, so the crypto should be fine.

Let me ping some other folks

tnowacki avatar Apr 09 '24 19:04 tnowacki