novasamatech / parity-signer

Air-gapped crypto wallet.
https://www.parity.io/signer/
GNU General Public License v3.0
556 stars 164 forks source link

Guide for parachain teams #1099

Closed jak-pan closed 2 days ago

jak-pan commented 2 years ago

We're working on implementing parity signer for HydraDX and Basilisk but I am struggling with finding information about either getting the chains to the signer itself, or getting a verifier certificate in, to be able to show that the chain info and the metadata that you are getting in are indeed secure and saving steps for the users to overcome.

I've got a small draft of semi-automated process where we are storing signing keys in a secure organization / repo that will be able to prompt for signature once a draft release of any of our parachains is made. It's simplified for the sake of starting a conversation. Is this something that would allow us to be approved for parity signer + metadata portal?

Screenshot 2022-06-09 at 01 32 01

P.S. really nice job with the parity signer. I'd love to see it adopted more!

vas3k commented 2 years ago

Hey!

On the Signer's side:

On the Metadata Portal side:

Slesarew commented 2 years ago

On top of this, I just have to add a few things.

Slesarew commented 2 years ago

Also please be aware of #1050 and if it is related to your network - please join discussion.

Slesarew commented 2 years ago

Also if you are willing to get into slightly more complicated management, metadata could be fetched from network through RPC calls or extracted from wasm binary before it is deployed. The latter allows preparing metadata to publishing before network is upgraded, so that the delay is minimal. Consider if you need/want to do that with understanding, that recalling signed update will probably be seen as bad thing by community, but at the same time publishing timely updates would look cool.

pgolovkin commented 2 years ago

Hi! @jak-pan You raised a great topic! I have some experience with the Metadata portal in terms of Omni application development. The Metadata portal was forked and now it's hosted on my personal account. A few parachains were successfully added and we're using Parity Signer mobile application for signing transactions in Acala, Statemine and other parachains while developing the Omni application. We're trying to solve the following issues:

  1. How to make the metadata updates at the time. So that users won't wait until the metadata update on the Metadata portal.
  2. How to make the signing automatically.

For the 1st point the update job may be run more frequent (every 1 hour) with option to be started manually. For the 2nd point the github CI may be used but seems that it's not a really good idea.

@Slesarew could you please explain in details how the metadata may be updated from the WASM file before the runtime upgrade?

Slesarew commented 2 years ago

If you have a valid runtime binary, metadata could be extracted from it by many tools, some of which do not require to run this metadata. We've added this function to generate_message tool some time ago. Provided you have wasm file you are certain about (not sure who except network maintainers/releasers could have that), you can feed it to generate_message in a manner similar to this:

cd rust/generate_message
cargo run unwasm -payload westend_runtime-v9150.compact.compressed.wasm

where westend_runtime-v9150.compact.compressed.wasm is path to binary, and get metadata file similar to one that could be fetched from running network. With this, you proceed with signing and publishing normally. This flow is about to be added to metadata portal, IIUC, but could already be used in this less automatic manner.

Edit: for this to work, you need to populate database in generate_message with specs of this network, so that you'll have genesis hash that is not stored in runtime file.

jak-pan commented 2 days ago

Closing as no longer relevant :)