> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrating Para with Rhinestone

> Build cross-chain smart accounts using Para SDK with Rhinestone for intent-based transactions and gas abstraction

Build cross-chain smart accounts using Para's embedded wallets and [Rhinestone](https://www.rhinestone.dev/) — enabling intent-based transactions, automatic bridging, and gas abstraction across EVM chains. The `useRhinestoneSmartAccount` hook handles account creation, orchestrator setup, and Pimlico bundler configuration automatically.

## Prerequisites

* Para API key from the [Para Developer Portal](https://developer.getpara.com/)
* Rhinestone API key from the Rhinestone team
* Optionally a Pimlico API key for bundler/paymaster infrastructure
* Node.js 18+ and Next.js development environment

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @getpara/react-sdk viem @tanstack/react-query
  ```

  ```bash yarn theme={null}
  yarn add @getpara/react-sdk viem @tanstack/react-query
  ```

  ```bash pnpm theme={null}
  pnpm add @getpara/react-sdk viem @tanstack/react-query
  ```
</CodeGroup>

## Setup Para Provider

Configure the Para provider:

```tsx filename="app/providers.tsx" theme={null}
"use client";

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ParaProvider } from "@getpara/react-sdk";

const queryClient = new QueryClient();

export default function Providers({ children }: { children: React.ReactNode }) {
  return (
    <QueryClientProvider client={queryClient}>
      <ParaProvider
        paraClientConfig={{
          apiKey: process.env.NEXT_PUBLIC_PARA_API_KEY!,
          env: "BETA",
        }}
        config={{ appName: "Global Wallet Demo" }}
      >
        {children}
      </ParaProvider>
    </QueryClientProvider>
  );
}
```

## Usage

Use the `useRhinestoneSmartAccount` hook to create and manage a Rhinestone smart account. The hook handles Para signer creation, Rhinestone account setup, and orchestrator configuration internally.

```tsx filename="components/RhinestoneDemo.tsx" theme={null}
"use client";

import { useRhinestoneSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";

const RHINESTONE_API_KEY = process.env.NEXT_PUBLIC_RHINESTONE_API_KEY!;
const PIMLICO_API_KEY = process.env.NEXT_PUBLIC_PIMLICO_API_KEY!;

export function RhinestoneDemo() {
  const { smartAccount, isLoading, error } = useRhinestoneSmartAccount({
    chain: sepolia,
    rhinestoneApiKey: RHINESTONE_API_KEY,
    pimlicoApiKey: PIMLICO_API_KEY,
  });

  const {
    mutate: sendTransaction,
    isPending: isSending,
    error: sendError,
  } = useMutation({
    mutationFn: async () => {
      if (!smartAccount) throw new Error("Smart account not ready");
      return smartAccount.sendTransaction({
        to: "0xRecipient",
        value: parseEther("0.01"),
      });
    },
    onSuccess: (receipt) => {
      console.log("Transaction hash:", receipt.transactionHash);
    },
  });

  const {
    mutate: sendBatch,
    isPending: isBatching,
    error: batchError,
  } = useMutation({
    mutationFn: async () => {
      if (!smartAccount) throw new Error("Smart account not ready");
      return smartAccount.sendBatchTransaction([
        { to: "0xRecipientA", value: parseEther("0.01") },
        { to: "0xRecipientB", data: "0xencodedCallData" },
      ]);
    },
    onSuccess: (receipt) => {
      console.log("Batch tx hash:", receipt.transactionHash);
    },
  });

  if (isLoading) return <p>Setting up smart account...</p>;
  if (error) return <p>Error: {error.message}</p>;
  if (!smartAccount) return null;

  return (
    <div>
      <h2>Rhinestone Smart Account</h2>
      <p>Address: {smartAccount.smartAccountAddress}</p>
      <p>Mode: {smartAccount.mode}</p>

      <button onClick={() => sendTransaction()} disabled={isSending}>
        {isSending ? "Sending..." : "Send Transaction"}
      </button>
      {sendError && <p style={{ color: "red" }}>{sendError.message}</p>}

      <button onClick={() => sendBatch()} disabled={isBatching}>
        {isBatching ? "Batching..." : "Send Batch"}
      </button>
      {batchError && <p style={{ color: "red" }}>{batchError.message}</p>}
    </div>
  );
}
```

<Note>
  Rhinestone only supports EIP-4337 mode. Both `rhinestoneApiKey` and `pimlicoApiKey` are optional but recommended for production use. For advanced cross-chain use cases with automatic bridging, see the [Rhinestone documentation](https://docs.rhinestone.dev).
</Note>

## Key Features

* **Cross-chain smart accounts**: Single account across multiple EVM chains
* **Intent-based transactions**: Automatic execution of cross-chain operations
* **Gas abstraction**: Sponsored transactions without users managing gas fees
* **Automatic bridging**: Seamless asset transfers between chains
* **Para wallet management**: Embedded wallet infrastructure with MPC security

## Complete Example

<Card title="Para + Rhinestone Example" icon="github" href="https://github.com/getpara/examples-hub/tree/2.0.0/web/with-react-nextjs/aa-rhinestone">
  View the complete working example in Para's Examples Hub
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Rhinestone Documentation" icon="book" href="https://docs.rhinestone.dev">
    Explore Rhinestone's features and advanced use cases
  </Card>

  <Card title="Account Abstraction Guide" icon="layer-group" href="/v2/react/guides/web3-operations/evm/account-abstraction">
    See all supported AA providers and the unified SmartAccount interface
  </Card>
</CardGroup>

## Related Walkthroughs

<CardGroup cols={3}>
  <Card title="Porto Integration" icon="key" href="/v2/walkthroughs/porto">
    Intermediate · 30 min · EIP-7702 smart accounts with session keys
  </Card>

  <Card title="Thirdweb Integration" icon="cubes" href="/v2/walkthroughs/Thirdweb">
    Advanced · 40 min · Smart accounts and gas sponsorship
  </Card>

  <Card title="Squid Router Integration" icon="arrows-split-up-and-left" href="/v2/walkthroughs/Squid">
    Advanced · 45 min · Cross-chain USDC bridges
  </Card>
</CardGroup>
