NEW to FLOW - Unable to Create a Flow Account

Hi,

I’m new to Flow and trying to follow instructions below to create a new Flow Account on TestNet:

I ran the following command:

flow accounts create
–key d0f36b587232aa9670c4a671ac5da0726ac14db7e3b89f0367236d8e78753e3803341927a361c94a06829ec40f6ba3f47f3ec74eea5be4f2989ba37db106f0f3
–sig-algo ECDSA_secp256k1
–hash-algo SHA3_256
–host access.testnet.nodes.onflow.org:9000
–signer my-testnet-account
–results

where
Address (created from Faucet) : ccefefbdc1d81de0
Public Key: 72f9de5e0056d2c4b83d10a302e7ff799547ff721cd3a6737c8893fd39901621ce304d6c23789ae9a7b75d0cba2ae10bf453f3194bdea43883b4f361546fbcbd
Private Key: c4604e5d29201a44ad107191c08c9f2ce7ee3266a1a306760212e313c7476219

Following Error is received:

Status: SEALED
Execution Error: Execution failed:
error: cannot decode runtime public account key: input is not a valid ECDSA_secp256k1 key
→ 3308ae867cfa7cfb451049ac14ebcb87901049e17f808ad14df08c7d6fcf5cda:7:3
|
7 | acct.addPublicKey(key.decodeHex())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Code:

transaction(publicKeys: [String], contracts: {String: String}) {
prepare(signer: AuthAccount) {
let acct = AuthAccount(payer: signer)

	for key in publicKeys {
		acct.addPublicKey(key.decodeHex())
	}

	for contract in contracts.keys {
		acct.contracts.add(name: contract, code: contracts[contract]!.decodeHex())
	}
}

}

Events:
None

Any help / tips would be greatly appreciated, thx !

1 Like

EDIT: I see, you mentioned about Faucet account already “Address (created from Faucet) : ccefefbdc1d81de0

If you are trying to create accounts on Testnet, you might need to require account creation permission via the Faucet. It is simply a one-time request https://testnet-faucet.onflow.org/

Hi,

“If you are trying to create accounts on Testnet, you might need to require account creation permission via the Faucet. It is simply a one-time request https://testnet-faucet.onflow.org/” —>

I I have already requested and obtained account creation permission.

I used the

Create Account Request Fulfilled

Request ID: 92f3b811-671f-4a5b-98e6-a5fb41ebd08b

Name: Ernie Ho

Email: ernie.y.ho@gmail.com

Address: ccefefbdc1d81de0

1 Like

Hey @eho2k21, how are you generating the public key?

The error you’re seeing occurs because the public key you have passed is either in the wrong format or is not on the ECDSA_secp256k1 curve.

Keep in mind that flow keys generate generates a ECDSA_P256 key by default.

You can do this to get secp256k1:

flow keys generate --algo ECDSA_secp256k1
3 Likes

Hi Pete,

Thank you very much and this had to be the root cause of the issue.
However, after re-generating keys with the ECDSA_secp256k1 option and re-ran the Create Account command,

I now get a different error:

Status: SEALED
Execution Error: invalid signature: signature could not be verified using public key with index 0 on account ccefefbdc1d81de0

---->. Does this mean I’d need a NEW Faucet Test account to go with the new pair of keys ?

Thank you,

Ernie

Does this mean I’d need a NEW Faucet Test account to go with the new pair of keys ?

No, you should be able to use the same Testnet account.

You’ll need to make sure you’re signing with the same key pair that you used to create the faucet account (my-testnet-account). If you don’t have the private key anymore, you’ll need to create a new faucet account.

“You’ll need to make sure you’re signing with the same key pair that you used to create the faucet account (my-testnet-account). If you don’t have the private key anymore, you’ll need to create a new faucet account.” ------> precisely what I expected, thank you very much for confirmation

2 Likes

Hi @pete I have a question. Can I only create a test account through the official faucet?Is it possible to create available test accounts through programs such as JS or Go?

I really hope we can get there.

I want to start with the CLI at least. I put some thoughts on that here: Testnet faucet integration · Issue #37 · onflow/flow-cli · GitHub

2 Likes

Hi,

"“You’ll need to make sure you’re signing with the same key pair that you used to create the faucet account (my-testnet-account). If you don’t have the private key anymore, you’ll need to create a new faucet account.” —>. Since we are on the topic of test account creation thru Faucet, I have not received confirmation from Faucet after one week since request.

Is there something wrong with Faucet ?

Hi,

Is there a limit on the # of Faucet accounts that can be created ?
Sent request in early March 2021, and had not heard from Faucet since then.

Thx!

1 Like

you can try it by this : https://testnet-faucet-v2.onflow.org/

Hi,

I’m trying to create a new TestNet Faucet account on

https://testnet-faucet.onflow.org/

Currently after inputting a valid Public Key and click “Create Account”, the page shows a progress bar and stops responding. Is this behavior normal?

I tried on both Safari and Chorme and same behavior persisted.

I was able to create a Testnet Account previously and the expected behavior is to redirect to a page showing “Request Fullied” with the TestNet Account Address showing.