Python: How to verify a principal?

Please, explain how to using Python verify whether a given message was signed by a given principal.

Some code there is here but I don’t quite understand how to use it.

First, should I pass from the client to server that verifies identity the principal or the public key of the user? Then, how to verify the principal by it? (I don’t know how to flip between principal and public key).

The code that is referred above seems to support verification only using the private key. I don’t have the private key, because I use a JavaScript client with Internet Identity. How to verify with public key or principal only?

Also, which curve do you advise to use?

Hi, I am not familiar with the library you linked. However it is not possible to verify signatures using the principal only. The principal is derived from the public key (via hashing). To verify a signature you need the public key. The vk in the code you liked is most likely the public key, not the private the key.