# Quick Start

## Installation

```bash
npm install signet.js
# or
yarn add signet.js
# or
pnpm add signet.js
```

## Signing a Transaction

Here's a basic example using the EVM implementation:

```ts twoslash
import { contracts, constants, chainAdapters } from 'signet.js'
// [!include ~/snippets/code/evm/env.ts]

const evmChainSigContract = new contracts.evm.ChainSignatureContract({
  publicClient,
  walletClient,
  contractAddress: constants.CONTRACT_ADDRESSES.ETHEREUM
    .TESTNET_DEV as `0x${string}`,
})

const evm = new chainAdapters.evm.EVM({
  publicClient,
  contract: evmChainSigContract,
})

const path = 'eth'
const predecessorId = walletClient.account.address
const keyVersion = 1

const { address: from, publicKey } = await evm.deriveAddressAndPublicKey(
  predecessorId,
  path,
  keyVersion
)

const { balance, decimals } = await evm.getBalance(from)

const { transaction, hashesToSign } = await evm.prepareTransactionForSigning({
  from: from as `0x${string}`,
  to: '0x4174678c78fEaFd778c1ff319D5D326701449b25',
  value: 1n, // Amount in wei (1 wei in this example)
})

const rsvSignature = await evmChainSigContract?.sign({
  payload: hashesToSign[0],
  path,
  key_version: keyVersion,
})

const tx = evm.finalizeTransactionSigning({
  transaction,
  rsvSignatures: [rsvSignature],
})

const txHash = await evm.broadcastTx(tx)
```

## Supported Chains

* [EVM Chains](/signetjs/chain-adapters/evm) - Ethereum and compatible networks
* [Bitcoin](/signetjs/chain-adapters/bitcoin) - Bitcoin network
* [Cosmos Chains](/signetjs/chain-adapters/cosmos) - Cosmos SDK-based networks

## Architecture

The library is built around a core `ChainAdapter` interface that defines common functionality across all supported blockchain networks. Each specific chain implementation extends this interface with network-specific features while maintaining a consistent API.

For more details check the [ChainAdapter](/primitives/chain-adapter-interface) page.

## Utility Functions

Besides the ChainAdapter classes the library also provides utility functions to assist you on building transactions, requesting signature in wrapped methods.

Currently we support:

* EVM

## Repositories

* Signet.js: [https://github.com/sig-net/signet.js](https://github.com/sig-net/signet.js).
* Examples: [https://github.com/sig-net/signet-examples](https://github.com/sig-net/signet-examples).
* MPC: [https://github.com/sig-net/mpc](https://github.com/sig-net/mpc).
