3 ms·
You can do session types already in stable Rust without const generics. Each "enum variant" can be its own separate type, and such types can only be instantiate
by oleganza 7y ago
You can do session types already in stable Rust without const generics. Each "enum variant" can be its own separate type, and such types can only be instantiated by a method on the type representing the previous state, which also consumes that previous state.
We've used them in our Bulletproofs MPC (multi-party computation) where cryptographic requirement is not to replay the protocol from the mid-point. Since the user is supposed to perform these transitions within their application on top of network messages, such strongly-typed API guarantees that, if their program has compiled successfully, then:
1) Steps are performed in correct order.
2) The protocol cannot be replayed from the intermediate state.
We have wrote about it here: https://medium.com/interstellar/bulletproofs-pre-release-fcb1feb36d4b https://medium.com/interstellar/bulletproofs-pre-release-fcb... - scroll to "strongly-typed multiparty computation".
- oleganza 7y agoHere is updated link to the original article on MPC by Cathie Yun: https://medium.com/@cathieyun/bulletproof-multi-party-computation-in-rust-with-session-types-b3da6e928d5d https://medium.com/@cathieyun/bulletproof-multi-party-comput...