Off-Narrative-Labs / Tuxedo

Write UTXO-based Substrate Runtimes
https://off-narrative-labs.github.io/Tuxedo/
Apache License 2.0
56 stars 17 forks source link

Pallet Tuxedo Wrapper #174

Open JoshOrndorff opened 7 months ago

JoshOrndorff commented 7 months ago

Needs a better name like dress box or something riffing on the tuxedo / tailor / suit theme.

The idea is that a lot of people want to experiment with Tuxedo [citation needed] but it is a big ask to commit your entire project to using Tuxedo (shoutout @altimario for doing it anyway). So we should write a frame pallet that can be part of any old frame runtime, and what the pallet does is simply wrap around a Tuxedo runtime (like how pallet evm wraps an evm implementation).

This would allow a natural path for an existing frame-based chain to start trying tuxedo via runtime upgrade with minimal disruption.

Basically the pallet would have a single unsigned dispatchable function named execute_tuxedo_call or something. It would take in a single parameter which is the tuxedo call itself. The pallet provides a child storage tree for Tuxedo to use, and the child tree is prefixed with the appropriate hash(pallet_name) namespace to avoid conflicts with anything else in the runtime.

In subsequent steps, it may be interesting to try to support interacting with the native runtime in some way. For example, if the outer FRAME runtime has pallet balances, and the inner Tuxedo runtime has the money piece, it would be cool to move the tokens between the two.