> 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/deployment.md).

# Deploy the Protocol

Clone the Bloxchain Protocol at the pinned release, deploy it to Sepolia, and understand what you get: immutable account clones by default, upgradeable proxies only if you build them.

**You need:** Node.js 22.12 or later, Foundry, a funded Sepolia deployer key

{% hint style="warning" %}
**Testnet only during alpha.** Official Protocol deployments exist on Sepolia. Ethereum mainnet deployments are coming soon. Complete [Production readiness](/developers/deployment/production-readiness.md) before any deployment that will hold real value.
{% endhint %}

## Before you start

* You do not need to deploy anything to use Bloxchain. The Platform's **Deploy account** dialog and the SDK both create accounts from the official Sepolia factory. Deploy the Protocol yourself when you need your own factory, a custom network, an extension, or a full audit trail of the bytecode you run.
* Read [Account pattern](/protocol-reference/bloxchain-architecture/account-pattern.md) first. An account composes three components on one address: SecureOwnable (owner, recovery, broadcasters, time lock), RuntimeRBAC (roles and permissions) and GuardController (actions and allowlists).

## Steps

### 1. Clone at the pinned commit

```bash
git clone https://github.com/PracticalParticle/Bloxchain-Protocol.git
cd Bloxchain-Protocol
git checkout 99beac2d6e6d7567c23b25cecaf6f4053f31c987
npm install
npm run compile:foundry
npm run test:foundry
```

Every Protocol page on this site describes this commit. Tags and release notes: [GitHub releases](https://github.com/PracticalParticle/Bloxchain-Protocol/releases). Version alignment: [Releases and compatibility](/resources/releases.md).

### 2. Deploy the foundation

The foundation is the set of shared libraries plus the **AccountBlox** template. Configure your deployer key and RPC in the repository's deployment environment file, then run:

```bash
npm run deploy:hardhat:foundation
```

The script writes the resulting addresses to `deployed-addresses.json`, which the SDK reads.

### 3. Deploy the example factory (CopyBlox)

**CopyBlox** is the example factory that stamps out account clones from the template:

```bash
npm run deploy:hardhat:copyblox
```

### 4. Create an account

```bash
npm run create-wallet
```

The script is interactive: choose the network, choose the basic account (AccountBlox) or a custom template, then set owner, broadcaster and recovery addresses and the time lock. It prints the new account address and an explorer link.

### 5. Operate it

* **In the Platform:** open bloxchain.app → **Accounts → Import**, choose the network, paste the address, select **Import**. See [Import an account](/platform-guide/accounts/import.md).
* **From code:** point the SDK at the address. See [SDK setup](/developers/sdk-setup.md).

Then configure policy: register actions, create roles, assign signers, grant gates, fill allowlists. In the Platform this is **On-chain access** and **Policies**; in the SDK it is [Runtime RBAC](/protocol-reference/api-reference/runtime-rbac.md) and [Guard controller](/protocol-reference/api-reference/guard-controller.md).

## Official Sepolia addresses

These are the contracts the Platform uses by default. Verify on Etherscan before relying on them.

| Contract                | Address                                                                                                                         |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| AccountBlox template    | [`0x783eb64d7d5de55f6913f9cb42ef5a4c402884c0`](https://sepolia.etherscan.io/address/0x783eb64d7d5de55f6913f9cb42ef5a4c402884c0) |
| CopyBlox deploy factory | [`0x928a2bd6c13e4f48a0850d2171a8d79b29959fc7`](https://sepolia.etherscan.io/address/0x928a2bd6c13e4f48a0850d2171a8d79b29959fc7) |
| EngineBlox              | [`0x726d78c9683a96d66196d2b8350923e8ca0d8597`](https://sepolia.etherscan.io/address/0x726d78c9683a96d66196d2b8350923e8ca0d8597) |

Network: Sepolia, chain 11155111. See [Supported networks](/introduction/supported-networks.md).

## Immutable vs upgradeable

| Path                                                                                 | Upgradeable?                                                                                                             | Who is responsible                                                                                                            |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| **Official factory** (Platform Deploy account, `create-wallet`, the addresses above) | **No.** Each account is an EIP-1167 minimal-proxy clone fixed to the template implementation.                            | Bloxchain publishes the template at tagged releases; you own the account.                                                     |
| **Custom factory** (your own deploy)                                                 | **Optional.** The contracts use initializers, so you can wrap them in a UUPS or transparent proxy with your own factory. | You. The proxy admin key is as powerful as the owner key; guard it the same way. Storage layout across upgrades is your risk. |

**Immutable clones** cannot be patched in place. When logic must change, deploy a new account, reconfigure policy, move assets through governed transfers, update integrators and allowlists, then retire the old account. The Platform-side steps are in [Recovery and incidents](/platform-guide/recovery.md#limits).

**Custom upgradeable proxies** must run `initialize` atomically with creation. Follow the [proxy deploy runbook](/protocol-reference/getting-started.md#2-proxy-deploy-runbook-atomic-initialize) and smoke-read `owner()`, `getRecovery()` and `getTimeLockPeriodSec()` on the proxy before funding it.

## Troubleshooting

| Symptom                                    | Fix                                                                                                   |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `npm install` refuses to run               | The repository requires Node.js 22.12 or later (`engine-strict`). The published SDK only needs 18.20. |
| Deploy script cannot find a key            | Fill the deployment environment file the repository README describes; never commit it.                |
| Account deploys but every action is denied | Expected. A fresh account is a Vault: no actions, roles or allowlists yet. Configure policy first.    |

## Related

* [Protocol documentation](/protocol-reference/protocol.md)
* [Security model](/security/security-model.md)
* [License and terms](/resources/license.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/deployment.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.
