Correct Private Key Format

I’m working on getting a plugin built by PickPump on Eliza. I’m able to load the plugin. However, the token creation fails and returns this error: Failed to create token: Cannot read properties of null (reading 'createActor')

  1. Does anyone know what’s the right private key “format” to get a Wallet Provider instance?
  2. If anyone was able to run the ICP plugin on Eliza, let me know the steps you took to input the right private key in INTERNET_COMPUTER_PRIVATE_KEY.

Here are the steps that I am taking:

  1. I’m downloading a PEM file (let’s call it pkey.pem) from my Plug wallet and then running this in the command line:
    openssl pkey -in pkey.pem -text -noout

  2. The command line prints out something like this:

openssl pkey -in pkey2.pem -text -noout
ED25519 Private-Key:
priv:
    aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:
    aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:
    aa:aa
pub:
    ba:ba:ba:ba:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:
    aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:
    aa:aa
  1. I add the following to my .env file. I know that my .env file is loading properly because I have other API keys of services that are running properly:
INTERNET_COMPUTER_PRIVATE_KEY=aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:
    aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa
  1. However, I get an error Failed to create token: Cannot read properties of null (reading 'createActor').

The source code is here: https://github.com/elizaOS/eliza/blob/main/packages/plugin-icp/src/providers/wallet.ts.

From what I can infer, potentially, I am sending in a private key that is not being recognized and cannot instantiate a new provider instance.

5 Likes

INTERNET_COMPUTER_PRIVATE_KEY=your-ed25519-private-key

Identity Creation Failures

Ensure private key is exactly 32 bytes
Verify private key is properly hex-encoded
Check if private key has correct permissions
Canister Interaction Issues

Verify canister ID is valid
Ensure proper network configuration (mainnet/testnet)
Check if canister is available and running
Transaction Failures

Verify sufficient balance for operation
Check cycle balance for canister calls
Ensure proper fee calculation
Authentication Problems

Verify identity is properly initialized
Check if agent is configured correctly
Ensure proper network connectivity

1 Like

I believe that this is the right way to get a ed25519 private key?

Generate a hex private key without the “0x” prefix using the following command:
openssl ec -in pkey2.pem -text -noout | grep priv -A 3 | tail -n +2 | tr -d ‘\n[:space:]:’ | xxd -r -p | xxd -p
Then set the output as your environment variable.

1 Like

Generate the private key use the puttygen and private key is in .ppk format