forest: SignedMessage::new_from_part result in 'Secp signature verification failed' error because of Network value

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Hey, great discussion here!

  1. The network version is intended to be purely cosmetic – it is only the actual address payload that matters. So in general, yeah, you wanna disregard the t vs f for everything except UX. Lotus does this with one exception – the internal wallet keystore is indexed by the address string, including the network version (but this is fully internal and not consensus-relevant).
  2. Yeah, currently the entirety of the replay protection is “never reuse an address between a testnet and mainnet”. I agree that that is not good, it’s not suuuper easy to solve, though. We should discuss it.

@q9f This is what a transaction looks like

If this is the case, we might want to bring this up during the next core dev call…

We are all new here 🤣

The problem is, as far as I understand it, that we default to mainnet in case we are not running a configured client/daemon.

How do the crypto crates function if they are only tasked to recover a signature? The TODO in the address crate suggests that someone stumbled upon that before us already and suggested there need to be more flexibility.

Hi @q9f

Is the signature wrong or the recovered address? I’m new to Filecoin and try to understand how different networks are handled.

I verified the signature independently and it is a valid one. I tried then to get the recovered address and I had the same payload value but a different network.

Address { network: Testnet, payload: Secp256k1([69, 19, 240, 77, 214, 36, 247, 249, 201, 132, 33, 237, 114, 215, 9, 174, 159, 3, 201, 184]) }
Address { network: Mainnet, payload: Secp256k1([69, 19, 240, 77, 214, 36, 247, 249, 201, 132, 33, 237, 114, 215, 9, 174, 159, 3, 201, 184]) }
thread 'api::tests::conversion_signed_messages' panicked at 'called `Result::unwrap()` on an `Err` value: "Secp signature verification failed"', signer/src/api.rs:1005

Looks like we set all addresses to a mainnet default

I also notice that. I am not sure what I did that would make it work for testnet but not mainnet. It does bug me.