# Initialization

Now that you have your environment set up already, let's see about how to instantiate.&#x20;

You can instantiate the SDK by passing it the `CoreOptions` object as an argument. Although, `CoreOptions` has many fields most are optional. We'll focus on the required options for now.

```typescript
import { PublicClient } from 'viem';
import { ShieldedAccount } from '@veilnyx-sdk/account';

// Only showing required fields, skipping any optional fields for now
type CoreOptions = {
  chainId: number;
  account: ShieldedAccount;
  rpc: PublicClient | string;
  explorerApi: string;
}
```

* `chainId`

  The target chain on which you want to utilize the deployed instance of Private Execution Layer.
* `account`\
  It is the shielded account of the user who wants to perform private transactions or inquire about their balance or transaction history.\
  A `ShieldedAccount` can be simply generated from a random **seed**. A seed is a random `bigint` number generated from a secure entropy source. You can generate the account by:\
  \
  `const account = ShieldedAccount.generate(seed)`\
  Now you can pass the account to the `CoreOption`.
* `rpc`\
  RPC URL of the provided chain or  the [viem `PublicClient`](https://viem.sh/docs/clients/public.html) .
* `explorerApi`\
  API URL of block explorer. You must append the API key of the block explorer to the API URL itself. For example, Optimism Sepolia's base API URL is `https://api-sepolia-optimistic.etherscan.io/api`. But, when including it `CoreOptions`, you must include the `apikey` parameter. That is, the API URL that you must pass is:<br>

  ```shellscript
  https://api-sepolia-optimistic.etherscan.io/api?apikey=<YOUR_API_KEY>
  ```

After configuring options, simply create an SDK instance as:

```typescript
import {Core, CoreOptions} from '@veilnyx-sdk/core';

const opts: CoreOptions = {
// set options here
}

const veilnyx = new Core(opts);
```

The SDK instance (`veilnyx`) above is ready to be utilized now. Next, let's see how to craft a shielded/private transaction, i.e an `ZTransaction` instance.
