Creating account
Overview
In order to create a new account, you need to deploy an account contract. Starknet expects a certain interface from an account contract. OpenZeppelin and ArgentX provide account contract implementations that you can use.
There are three ways of deploying a new account contract:
- sending DEPLOY_ACCOUNTtransaction
- using already deployed account contract and deploying new one via the Universal Deployer Contract
- (deprecated) sending DEPLOYtransaction
Sending DEPLOY_ACCOUNT transaction
Protostar allows you to send the DEPLOY_ACCOUNT transaction from the CLI by calling the deploy-account command.
However, before you send such transaction you need to:
- Find the class hash of the account contract compatible with - DEPLOY_ACCOUNTtransaction. The entity that declared the account contract should make the class hash easily available. It's recommended to check the README.md in the repository with the source of the account contract:
- Calculate an account contract address with - protostar calculate-account-addresscommand
- Prefund the account contract. - Network - Recommended method - devnet - Local Faucet - testnet - Starknet Faucet - mainnet - Token Bridge