Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native Signer support that is WASM compatible and avoids Substrate deps #772

Closed
jsdw opened this issue Jan 11, 2023 · 4 comments
Closed
Assignees

Comments

@jsdw
Copy link
Collaborator

jsdw commented Jan 11, 2023

Currently, to sign transactions, we lean on the "substrate-compat" feature to pull in the substrate deps we need to provide a PairSigner (which plays nice with sp-keyrings AccountKeyring and the Pair trait form Substrate).

Without the Substrate deps (ie if we want to compile to WASM) we have no built-in way to sign transactions.

I'd like us to think through and add a basic API for signing transactions. The goal would be that we can perform basic signing given some public/private keypair, and that we can use the Alice/Bob/Charlie style accounts for signing in example code.

I'd need to investigate to see whether signing algorithms we'd want to support actually compile to WASM or not, and also to see which signing algorithms to support in the first place (the 3 that a MultiSignature can provide signatures for?).

My hope would be that the API can be as simple as possible. In many production cases it may be that we want to lean on external signing approaches (eg handing to parity-signer or using wweb APIs to sign via ledger etc), but having some facility built in that's good enough for simple examples and playing around would be great to keep the barrier to experimenting with this stuff low.

@MrishoLukamba
Copy link

And also I think If we can enable production wallet signing, Like I Have my PJS account and I can just import that account and use it to sign txn using subxt, I think this can enable CLI-Dapps

@jsdw
Copy link
Collaborator Author

jsdw commented Jan 11, 2023

Yup for sure! There was definitely an idea in #583 to add the ability to construct transactions to the CLI tool and then potentially sign them via a web interface and wallets connected there, before passing the signed tx back to the CLI tool to finish submitting.

At present it would already be possible to build that facility on top of Subxt such that it could be compiled to wasm, and signing could take place on the JS side to leverage connected wallets. We should eventually add an example to show that in action, though it is a different issue from this :)

@jsdw
Copy link
Collaborator Author

jsdw commented Feb 9, 2023

@harrysolovay pointed me at https://github.com/paritytech/capi-crypto-wrappers/blob/main/src/lib.rs, which is a rust can-compile-to-wasm library used for signing stuff in CAPI.

@jsdw
Copy link
Collaborator Author

jsdw commented Jun 27, 2023

Closed by #1016

@jsdw jsdw closed this as completed Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants