# Use Smart Account

## Overview

The Othentic Stack supports using Ethereum Smart Accounts as Operators.

[EIP-1271](https://eips.ethereum.org/EIPS/eip-1271) is a standard that enables smart contract wallets to verify signatures, addressing the limitations of traditional signature verification methods designed primarily for Externally Owned Accounts (EOAs).&#x20;

In this setup:

* The **Controller Key** is a smart contract wallet compliant with EIP-1271 - i.e [Safe](https://docs.othentic.xyz/main/welcome/readme).
* The **Consensus Key** is a [raw private key](https://docs.othentic.xyz/main/user-guide/generate-keys#option-1-generate-raw-keypair).

***

## Register to EigenLayer and AVS

### Prerequisites

1. EIP-1271 compatible Smart Account (e.g [Safe](https://app.safe.global/))
   1. Private key of one of the allowed signers for the Smart Account
   2. Sufficient gas funds on Ethereum mainnet
2. **AVS Governance contract address** you want to register with
3. A **rewards receiver address** (can be a smart contract or EOA)
4. A raw [Consensus key](https://docs.othentic.xyz/main/learn/advanced-concepts/key-management#consensus-key)
5. An Ethereum mainnet RPC endpoint

Follow the steps below:

{% stepper %}
{% step %}

### **Set up Operator registration scripts**

Clone the [Operator registration scripts](https://github.com/Othentic-Labs/operator-registration-script/tree/main) repository:

```bash
# Clone the repo
git clone https://github.com/Othentic-Labs/operator-registration-script.git
cd othentic-operator-scripts

# Install dependencies
npm install
```

{% endstep %}

{% step %}

### **Generate BLS Signature**

Use your Consensus Key to generate the required BLS signature that will be used during registration:

```bash
ts-node scripts/genAvsRegisterBlsSignature.ts \
<BLS_PRIVATE_KEY> \ # Consensus Key
<AVS_GOVERNANCE_ADDRESS> \ # Contract address
<SMART_WALLET_ADDRESS> \ # Smart account contract address
<RPC> # Ethereum mainnet RPC endpoint
```

Output will be stored in `.othentic/othentic-avs-register-as-operator.json`
{% endstep %}

{% step %}

### **Generate Auth Signature (Optional)**

If the AVS is allowlist-enabled, you will also need to generate an `AUTH_TOKEN`.\
Run the  below script to generate the required token.

```bash
ts-node scripts/allowlist/generateSignature.ts \
<PRIVATE_KEY> \ # Smart account signer private key
<WALLET_ADDRESS> \ # Smart account contract address
<AVS_GOVERNANCE_ADDRESS> # Contract address
```

Output will be stored in `.othentic/othentic-allowlist-request-signature.json`
{% endstep %}

{% step %}

### **Generate Transaction Data for Operator Registration**

Use the script below to prepare transaction data for the Operator registration transaction:

```bash
ts-node scripts/genRegisterAsOperatorTx.ts \
<ECDSA_PRIVATE_KEY> \ # Private key of smart account signer
<JSON_FILE> \ # Path to the JSON file generated in Step 1
<RECEIVER_ADDRESS> \ # Address where Operator rewards will be sent
<AUTH_TOKEN> \ # (Optional) Token for allowlist access generated in Step 2
<RPC> # Ethereum mainnet RPC endpoint
```

{% hint style="info" %}

#### 💡 Note:

The **ECDSA\_PRIVATE\_KEY** parameter can belong to **any one of the Safe owners.** This is used only to sign and prepare the transaction payload; the actual execution will still require quorum signatures from the Safe UI.
{% endhint %}

Output will be stored in `.othentic/othentic-evm-transaction-data.json` .
{% endstep %}

{% step %}

### Navigate to Safe Transaction Builder

Navigate to the [official Safe UI](https://app.safe.global/), connect your signer wallet, access your Safe, then go to **Apps ->** **Transaction Builder**.

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FqWNSNxvlx3mJOKFukjEH%2Ftx-builder-2.png?alt=media&#x26;token=7d6b0b5f-1cfc-4288-b18e-1874e794a26f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Initiate a transaction with custom data

Paste the raw transaction data from the `.othentic/othentic-evm-transaction-data.json` file generated in Step 4.

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FAVJKoNSDkMKbgY2j2Ktp%2Ftx-data-2.png?alt=media&#x26;token=a70bd8b9-35c8-4cff-bee9-260c97d6ac95" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Execute transaction with signer quorum

Submit and confirm the transaction using the minimum required Safe owner signatures.
{% endstep %}
{% endstepper %}

***

## Deposit Stake

{% stepper %}
{% step %}

### Connect your Smart Account to Etherscan

Use WalletConnect to connect your Smart Account to Etherscan through the [official Safe UI](https://app.safe.global).
{% endstep %}

{% step %}

### Follow the [manual deposit guide](https://docs.othentic.xyz/main/user-guide/deposit-stake#option-4-deposit-manually)

After submitting the transaction, confirm the transaction using the required Safe owner signatures.
{% endstep %}
{% endstepper %}
