> For the complete documentation index, see [llms.txt](https://docs.bloxchain.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bloxchain.app/developers/sdk-authentication.md).

# SDK authentication

The SDK does not use Bloxchain API keys. Authentication means **how your app connects to Ethereum** and **which wallet signs** governed operations.

## Read-only vs write access

| Client                | Use for                                |
| --------------------- | -------------------------------------- |
| `PublicClient` (viem) | Reading contract state, receipts, logs |
| `WalletClient` (viem) | Signing and sending transactions       |

Most SDK wrappers accept a `PublicClient` for reads and require a `WalletClient` for writes.

## Wallet and signer setup

**Development**

```bash
RPC_URL=https://...
PRIVATE_KEY=0x...   # never commit; use a dedicated test key
ACCOUNT_ADDRESS=0x...  # your AccountBlox (or clone) address
```

**Production**

* Use a secure secret store (HSM, KMS, vault)—not `.env` in source control
* Prefer hardware or institutional signing for high-value operations
* Run separate keys for requester, approver, and broadcaster roles when policy requires separation

## Role alignment

The connected wallet must hold the on-chain role your action requires (Owner, Broadcaster, or a custom RuntimeRBAC role). The SDK cannot grant permissions off-chain.

Check effective permissions on-chain or use [My access](/platform-bloxchain.app/overview/my-access.md) in bloxchain.app for the same contract.

## Meta-transactions (EIP-712)

Approvers sign structured data off-chain; a **Broadcaster** wallet submits on-chain. The SDK provides EIP-712 helpers that must match the contract domain—see [Core patterns](/developers/sdk-core-patterns.md) and [Meta-transactions](/protocol/meta-transactions.md).

## bloxchain.app sign-in

Hosted app sign-in (email, optional 2FA) is separate from SDK integration. The app does not expose API keys for contract calls; operators use wallet connection in the browser.

## Next steps

* [Installation](/getting-started/installation.md)
* [Quickstart](/getting-started/quickstart.md)
* [Core patterns](/developers/sdk-core-patterns.md)


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.bloxchain.app/developers/sdk-authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
