Usign Edwards curve to sign a message and verify the signature.
- Create a component using
cargo component
:
cargo component new --reactor <name>
- Import the seed keeper get seed interface
world yourworld {
import seed-keeper:wallet/config@0.1.0;
// the rest of your WIT world
export operations;
}
- Add the path to the wallet wit file in your Cargo.toml. This is just the interface, not the implementation of it.
[package.metadata.component.target.dependencies]
"seed-keeper:wallet" = { path = "../path/to/seed-keeper-wallet/wit" } # directory containing the WIT package
- Export an interface which defines a
sign
func which takes a message and returns a signature.
/// WIT interface operations exported by yourworld
interface operations {
sign: func(message: list<u8>) -> list<u8>;
verify: func(message: list<u8>, signature: list<u8>) -> bool;
}
Compose this plugin together with the seed-keeper-wallet
and the seed-keeper-wit-ui
components.