How to extract public key for a signed transaction in Solidity contract from ecrecover function?

Hi!
I'm trying to write a code for some kind of cross-chain operation.

I want an user to:

  1. sign a message in a different blockchain (non-EVM)
    and
  2. retrieve the public key from a Solidity smart contract in Ethereum

which can then be converted to an address in the first blockchain.
I'm not sure if the mapped address will be the exact address that signed the message in the first blockchain... But since both the blockchains use secp256k1 curve for generating the key pairs, derivation should be doable.

Now, the part I'm confused about is this...
As far as I've understood, ecrecover function from ethereumjs-util library can retrieve the publicKey given a message hash along with r, s and v from the signature, which can then be converted to a wallet address [source]

But In solidity, the ecrecover function returns the wallet address directly instead of the public key of the account that signed the message. [source]

Is there some way that I can retrieve the public key of an address that signs a transaction directly from Solidity? Or am I missing a huge chunk of what it means?

Any helpful insight is much appreciated.

Hi, can anyone provide some insight here?

Hi,
This library helps you to recover public key from ECDSA signed message and derive address from the public key