Create account -> Generate key pair

Hi all,

I’m trying to generate a keypair in order to create a flow account.

I’m using elliptic library with this code:

const ec = new ec(‘p256’)
const key = ec.genKeyPair();

the problem is I’m checking the public key in https://testnet-faucet.onflow.org/ trying to create an account but always produce the error “Account creation failed”

A example of public key is:

043e0c532b97cd398577e1795936fe7ef92b9f56a8cd5c0b72e68fd096bd26868c7bcfbd2958c79f06f2fd7e18789018e2ce957e9f5b5bb68c6e1fabc0289976e8

if I generate the public and private key with flocli the process work.

any idea about what is the problem?

best regards

remove the leading 04 which means uncompressed key.

3e0c532b97cd398577e1795936fe7ef92b9f56a8cd5c0b72e68fd096bd26868c7bcfbd2958c79f06f2fd7e18789018e2ce957e9f5b5bb68c6e1fabc0289976e8

should work

Correct, now work it. Thank you very much bluesing,