0

Does the smoldot light client automatically generate keys or use the secret phrase to generate keys? In the substrate connect tutorial, client node seems automatically connects to the network with the chain spec, which doesn't specify the node key. However, by looking at the smoldot code of 'identity', a secret_phrase is used to generate keys, and need to have an input, otherwise, a default phrase will be used, where should be the input of the secret_phrase? I can't find from the Substrate connect.

In addition, I can't find the libp2p is using the public key from the secret_phase. It seems reads from the util::protobuf, where is the key coming from?

1 Answer 1

1

For creating a new Smoldot client it uses a random value to generate a libp2p public/private key pair (done here). This is done when it makes a new noise key (code) which is later used for the noise protocol.

2
  • By looking at your link (noise.rs) code, it seems that the ephemeral noise key needs private/public libp2p keys to initiate, and the ephemeral noise keys are not persistent. Where is the libp2p keys coming from? If I want to develop an app on the smoldot/Subrate connect, I need a persistent key to identify the user/node, In the tutorials of full nodes, it seems that keys needs to be generated before connected to the chain network. Could you please explain the difference and the best way to identify users on light client node
    – shao
    Feb 11, 2023 at 21:13
  • First, I edit my answer maybe it is more clear now. Second, there is a difference between identifying the user (e.g. who wants to send a transaction) and the node (required to join the network). Identifying the light client shouldn't be a concern to you if you want to build an app. Feb 13, 2023 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.