threefoldtech / rmb-rs

RMB implementation in rust
Apache License 2.0
3 stars 1 forks source link

The public keys generated for the twin by the mnemonic and its seed are different #181

Closed AhmedHanafy725 closed 7 months ago

AhmedHanafy725 commented 11 months ago

I have a mnemonic and generate the seed with the substrate tool (subkey)

Steps

1- Run rmb-peer using the mnemonic, it will load the twin

image

2- Wait for a minute 3- Run rmb-peer using the seed of the used mnemonic in the previous step, it will also load the same twin but it will update the twin's public key

image

Expected Results

Using the mnemonic or the seed for the same twin should result in the same public key

Findings

muhamadazmy commented 11 months ago

Also a side note

Since zos always use the seeds (not the mnemonics) it means that all zos nodes will have to update their twins if this fix is deployed

AhmedHanafy725 commented 11 months ago

Also a side note

Since zos always use the seeds (not the mnemonics) it means that all zos nodes will have to update their twins if this fix is deployed

as discussed with @muhamadazmy, the peers that are using the seed won't be affected by this change because the seed is used as is, only the peers that are using the mnemonic will need to update the twin as it needs to convert the mnemonic to a seed. So for the zos nodes, nothing will be changed.

muhamadazmy commented 11 months ago

@AhmedHanafy725 you are absolutely correct. I got it wrong.

ashraffouda commented 11 months ago

https://github.com/threefoldtech/rmb-rs/pull/183/files