This is a simple Ethereum contract that verifies that a given public key is exactly derived from a given private key. This uses the curve BN254 aka alt_bn128, as there exists an EVM/Ethereum precompile for this exact elliptic curve multiplication.
There is also some sample JS code that a) generates a secret key and public key, that you can use to test the contract, and b) does the same operation client-side in a faux contract interface, which might be useful for client-side validiation before incurring gas fees.
I wrote this mostly as a learning exercise as I'm getting familiar with elliptic curve cryptography, however, it has some practical applications and I was having trouble finding examples online of a similar application in Solidity. An example of a practical application of this is seen in Fair Data Exchange, which is the original reference for much of my Solidity code here.