Skip to content

Creating a wallet

Guilherme Dantas edited this page Jul 8, 2025 · 7 revisions

While validating Honeypot, you might need to submit transactions to the base layer. For that, you will need a funded wallet, that is, an account with enough Ether to pay for such transactions. This wiki page will cover how to create a wallet using cast from the Foundry toolkit.

In case you haven't got Foundry on your system yet, please head over to the Installation page from Foundry's documentation website.

Assuming you have Foundry on your system, you can easily create a wallet with the following command:

cast wallet new

This command will quickly generate a random private key and associated Ethereum address, like so:

Warning

Don't use the following credentials, as they are widely known in the community as a test account. If you transfer any assets to this account, anyone can effectively steal them.

Successfully created new keypair.
Address:     0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Private key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

If you don't want your private key to be printed to standard output, you can tell cast to encrypt it and write it to a file. By running the following command, cast will (1) prompt you for a password to encrypt the file and (2) print out the address. The credentials will be stored in a keystore.json file in the current directory. Please make sure to use a strong password, especially if you plan to fund it with real funds.

cast wallet new . 'keystore.json'

Then, if you want to execute cast commands that require a private key to be provided, you have two options. You can either provide the path to the keystore file through the --keystore option or, more conveniently, define the ETH_KEYSTORE environment variable.

export ETH_KEYSTORE="$(pwd)/keystore.json"

Now you can, for example, retrieve your wallet address by running the following command:

cast wallet address

The Cartesi Rollups PRT Node currently only supports private keys and AWS Key Management System (KMS). To extract the private key encrypted by cast, simply run the following command.

cast wallet private-key

Depending on how you plan to run the node, you might want to store the private key in an environment variable (if running locally) or in a secret (if running on fly.io).

Clone this wiki locally