> For the complete documentation index, see [llms.txt](https://docs.chiliz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiliz.com/jp/kaihatsu/joukyu/account-abstraction.md).

# Account Abstraction を使う

## Account Abstractionとは？

Account Abstractionは、ユーザーがsmart contractをアカウントとして利用できるようにするブロックチェーン技術であり、アカウントを完全にプログラム可能なものにします。

これは、ユーザーアカウントをより柔軟かつ機能的にし、ユーザーエクスペリエンスを向上させることを目的としています。

## Chiliz Chainの開発者にとって何を意味するのか？

AAを実装することで、開発者はプロジェクトのユーザーエクスペリエンスを向上させることができます。Chiliz Chainとのやり取りがシンプルになれば、より使いやすいアプリになります。

## Biconomyを使ってどのように実現するのか？

Biconomyはフルスタックのaccount abstraction SDKを提供しており、Smart Accountへのアクセスを可能にします: <https://docs.biconomy.io/account>

Biconomy自身によると、Chiliz Chainで彼らのAAスタックを活用する方法は4つあります:

* Gasless Transaction
* Batched Transaction
* Smart contract wallet（social loginを含む）
* session key、multichain validator、account recoveryなどを含むモジュールなど、多数!

Biconomyには分かりやすいQuickstartページがあります: <https://docs.biconomy.io/quickstart>

サンプルコードはPolygon Mumbaiネットワークを使用していますが、次のようにChilizに適応させることができます:

```typescript
import {
  Hex,
  createWalletClient,
  encodeFunctionData,
  http,
  parseAbi,
  zeroAddress,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { ChainId } from '@biconomy/core-types'
import { createSmartAccountClient } from "@biconomy/account";

const bundlerUrl =
  "https://bundler.biconomy.io/api/v2/80001/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44"; // Found at https://dashboard.biconomy.io

export const createAccountAndMintNft = async () => {
  // ----- 1. Generate EOA from private key
  const account = privateKeyToAccount("0x" + "PRIVATE_KEY");
  const client = createWalletClient({
    account,
    chainId: ChainId.CHILIZ_TESTNET, // or ChainId.CHILIZ_MAINNET,
    transport: http(),
  });
  const eoa = client.account.address;
  console.log(`EOA address: ${eoa}`);

  // ------ 2. Create biconomy smart account instance
  const smartAccount = await createSmartAccountClient({
    signer: client,
    bundlerUrl,
  });
  const saAddress = await smartAccount.getAccountAddress();
  console.log("SA Address", saAddress);
};
createAccountAndMintNft();
```

Chiliz ChainのIDを覚えておきましょう:

* `CHILIZ_MAINNET = 88888`
* `CHILIZ_TESTNET = 88882`

また、Biconomyを利用する際には、Chilizがmainnetとtestnetの両方で[独自のentrypointアドレス](https://docs.biconomy.io/contracts#entry-points)を持っていることに注意してください: [0x00000061FEfce24A79343c27127435286BB7A4E1](https://scan.chiliz.com/address/0x00000061FEfce24A79343c27127435286BB7A4E1/contracts#address-tabs)

これは、Biconomyの[Bundler](https://docs.biconomy.io/bundler)や[Paymaster](https://docs.biconomy.io/paymaster)を使用する際に重要です:

```typescript
// CC2 has its own entrypoint address
const CHILIZ_BUNDLER_ENTRYPOINT_ADDRESS='0x00000061FEfce24A79343c27127435286BB7A4E1'

const bundler = new Bundler({
    bundlerUrl: `https://bundler.biconomy.io/api/v2/${ChainId.CHILIZ_TESTNET}/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44`,
    chainId: ChainId.CHILIZ_TESTNET,
    entryPointAddress: CHILIZ_BUNDLER_ENTRYPOINT_ADDRESS,
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chiliz.com/jp/kaihatsu/joukyu/account-abstraction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
