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 credentials to be printed to standard output, you can tell cast to encrypt them and write them to a file. By running the following command, cast will prompt you for a password that will be used to encrypt your to-be-created wallet. 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"

The Cartesi Rollups PRT Node currently only supports private keys and AWS Key Management System (KMS). To extract the private key from a keystore file, you can run the following command.

cast wallet private-key

So, before running a validator node, you may run the following command to define the WEB3_PRIVATE_KEY environment variable.

export WEB3_PRIVATE_KEY=$(cast wallet private-key)

Clone this wiki locally