# Registration

{% stepper %}
{% step %}

### Generate a BLS pair

The registration process requires two sets of private keys: an ECDSA private key and a BLS private key.\
We recommend creating a new BLS pair for security reasons. Please generate one that will be dedicated to EO operations.

```sh
./run.sh generate-bls-key
```

{% endstep %}

{% step %}

### Encrypt your private keys

Encrypt your private keys. The encrypted private keys will be stored using the `EO_KEYSTORE_PATH` field. This is the recommended approach. If you encrypt a pasted private key it will never be saved as is anywhere.

```bash
./run.sh encrypt <your ecdsa private key> <your bls private key>
```

{% endstep %}

{% step %}

### Register with EO AVS

Operators need to have a minimum of 32 ETH delegated to them to opt-in to EO. Execute the following command:

```bash
./run.sh register
```

The output should look like:

```
{"level":"info","ts":1712853423.629971,"caller":"logging/zap_logger.go:49","msg":"succesfully registered to EO AVS","address":"<your_address>","tx hash":"<your_tx_hash>"}
```

{% endstep %}

{% step %}

### Generating an alias ECDSA address

Operators must declare another ECDSA address to use within the EO client. This isolates the Ethereum EigenLayer operator private key from EO operations, protecting access to Ethereum assets. You can import a private key or generate a new private key. To import, add `--ecdsa-private-key <value>` to the following command.

```bash
./run.sh generate-alias
ls -la .keystore
```

The output should look like:

<pre><code><strong>-rw-r--r--@ 1 &#x3C;usr>  staff  554 Apr 11 20:18 blsEncryptedWallet.json
</strong>-rw-r--r--  1 &#x3C;usr>  staff  491 Apr 12 00:06 ecdsaAliasedEncryptedWallet.json
-rw-r--r--@ 1 &#x3C;usr>  staff  491 Apr 11 20:18 ecdsaEncryptedWallet.json
</code></pre>

{% endstep %}

{% step %}

### Declaring an alias for the EO-chain

After generating the ECDSA alias address to use in EO-chain, declare it using your Ethereum EigenLayer identity, verifying the link between the two.

```bash
./run.sh declare-alias
```

The output should look like:

```
succesfully declared an alias in the eochain
docker-entrypoint-oprcli.sh: Starting oprcli declare-alias 
{"level":"info","ts":1712824061.311895,"caller":"logging/zap_logger.go:49","msg":"succesfully declared an alias in the eochain","eochain address":"0x...", "eochain address", "0x...", "tx hash", "0x..."}
```

{% endstep %}
{% endstepper %}

## Advance Settings and Troubleshooting

The following sections explain how to review status of the operator, troubleshoot registration issues or how to work with plain text private key (discourage)

<details>

<summary>Checking the status of EO operator AVS</summary>

The following command will print the status of the operator:

```bash
./run.sh print-status
```

The output should look like:

```
docker-entrypoint-oprcli.sh: Starting oprcli print-status 
{"level":"info","ts":1712824061.311895,"caller":"logging/zap_logger.go:49","msg":"Operator Status","status":"REGISTERED"}
{"level":"info","ts":1712824061.3466434,"caller":"logging/zap_logger.go:49","msg":"Operator s
```

</details>

<details>

<summary>Troubleshooting the register command</summary>

salt already spent - if you get the following error:

<pre><code><strong>Failed to create RegisterOperator transaction execution reverted: AVSDirectory.registerOperatorToAVS: salt already spent
</strong></code></pre>

Add `EO_SALT=<salt_in_hex>` field to your .env file and retry running the `register` command.

*(\*) the EO\_SALT should be in the following format EO\_SALT=0x04 (even length hex number, and could be any number but must be even length)*

</details>

<details>

<summary>Deregister from EO AVS</summary>

The following command will unregister and opt you out of the EO AVS:

```bash
cd operator-setup
./run.sh deregister
```

The output should look like:

```
Deregistering operator with address <your address> 
Deregistered Operator with Coordinator at address 0xd8eA2939cE17316b7CA2F86b121EB9c7c94c39c0 with tx hash 0x0c3016d0560c717f730a2b32446af242d66b83937cc015a02f0536fa41da1988
```

</details>

<details>

<summary>Work with plain text private keys (discouraged)</summary>

If you don't want to encrypt your private keys, update them in the `data-validator/.env` file.\
As this approach is highly discouraged, we recommend encrypting the private keys and never saving them anywhere on any machine.

```bash
EO_BLS_PRIVATE_KEY=<your ecdsa private key>
EO_ECDSA_PRIVATE_KEY=<your bls private key>
```

</details>

<details>

<summary>Troubleshoot the declare-alias command</summary>

Contact our support in discord If you receive&#x20;

<pre><code><strong>Failed to create EOConfig.declareAlias transaction not enough funds to cover gas costs
</strong></code></pre>

</details>

<details>

<summary>Troubleshoot the data-validator execution</summary>

The following error, represent that your alias was not activated. Please contact our support in discord to activate your alias

```
server returned an error response: error code -32003: Out of gas: gas required exceeds allowance
```

</details>
