# Implementing a Custom Chain Signature Contract

This guide explains how to implement a custom Chain Signature Contract to provide as argument when instantiating a Chain instance.

## Overview

The `ChainSignatureContract` is an abstract class that defines the interface for interacting with the Sig Network infrastructure.

* Key Derivation: Derive the child key from the root key using Sig Network key derivation function
* Sign: Signs the given payload using Sig Network MPC
* Current Fee: Gets the current signature deposit that handles network congestion
* Root Public Key: Gets the root public key of the Smart Contract on Sig Network MPC

You have the flexibility to implement your own contract for other blockchain networks.

## Using the EVM Implementation

```ts twoslash
import { contracts, chainAdapters } from 'signet.js'

const contract = new contracts.evm.ChainSignatureContract({
  publicClient: undefined as any,
  walletClient: undefined as any,
  contractAddress: '0x...',
})
```

## Implementing a Custom Chain Signature Contract

To create your own implementation to use on the [Chain Adapter](/primitives/chain-adapter-interface) Instance, your contract must implement the `BaseChainSignatureContract` abstract class.

```ts twoslash
// [!include ~/../src/contracts/ChainSignatureContract.ts]
```

### Example: EVM Implementation

Refer to the EVM contract in the source tree at `src/contracts/evm/ChainSignaturesContract.ts`.
