Hey stackers, i got something tasty for you today.
I challenged myself to construct a lottery protocol where:
- Off-chain deposits and payouts are supported
- Players can verify the outcome was fair
- Players can prove to outside observers whenever the lottery coordinator cheats
- The lottery coordinator can prove to outside observers that it selected winners honestly
- Players remain 100% anonymous from each other; No P2P messaging needed.
- The on-chain transaction footprint is efficient and minimized
Turns out, this is actually more than just possible, it can be generalized to work for any Discreet Log Contract .
This means any kind of oracle-based contract (e.g. sports betting, derivatives, CFDs, etc) can be conducted off-chain without any of the DLC players needing to send or receive on-chain transactions or converse P2P. Participants in a DLC can instead use one untrusted coordinator who provides the on-chain capital while everyone else transacts off-chain. I call this person the 'market maker', and they can charge fees for their capital services.
Bear in mind i just wrote this myself and finished it today. I'm hoping I didn't make any glaring errors which would make the whole protocol impossible. Please have a read and tell me if I'm crazy. I'll also be submitting this idea to the DLC-dev mailing list to get more opinions.
- Blog article: https://conduition.io/scriptless/lottery/ (Onion version)
- Github PR (comments welcome!): https://github.com/conduition/conduition.io/pull/4