> For the complete documentation index, see [llms.txt](https://docs.sail.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sail.money/protocol/reference/deterministic-addresses.md).

# Deterministic addresses

How Sail achieves identical core addresses across chains, and identical SMA addresses across chains — with the exact formulas from `SailKernel.createAccount`.

## Core salts

Each core contract is deployed through the standard CREATE2 factory (`0x4e59b44847b379578588920cA78FbF26c0B4956C`) with a chain-independent salt and identical constructor arguments:

| Contract           | Salt                                  |
| ------------------ | ------------------------------------- |
| TimelockController | `keccak256("sail.timelock.v1")`       |
| SailGovernance     | `keccak256("sail.governance.v1")`     |
| SailKernel         | `keccak256("sail.kernel.v1")`         |
| MandateFactory     | `keccak256("sail.mandatefactory.v1")` |
| StandardFeePolicy  | `keccak256("sail.feepolicy.v1")`      |
| SafeModuleEnabler  | `keccak256("sail.modulenabler.v1")`   |

A CREATE2 address is `keccak256(0xff ++ factory ++ salt ++ keccak256(initCode))[12:]`. Since the factory and salt are identical everywhere, the address is identical **iff the init code (constructor args included) is identical**. Injecting the timelock into `SailGovernance` (rather than constructing it inline) is what makes every constructor argument chain-independent.

## SMA address binding

When the kernel creates an account it derives the Safe's CREATE2 salt by binding the caller's nonce to the principals:

```solidity
boundSalt = uint256(keccak256(abi.encode(
    saltNonce, msg.sender, permissionSigner, manager, feePolicy
)));
```

It then predicts the Safe proxy address with the exact formula the Safe v1.4.1 `SafeProxyFactory` uses, so an already-deployed proxy at that address is adopted rather than re-deployed:

```solidity
// create2Salt = keccak256(keccak256(initializer), boundSalt)
bytes32 create2Salt = keccak256(abi.encodePacked(keccak256(safeInitializer), boundSalt));

// initCodeHash = keccak256(proxyCreationCode ++ uint256(uint160(singleton)))
bytes32 initCodeHash = keccak256(abi.encodePacked(
    ISafeFactory(safeFactory).proxyCreationCode(),
    uint256(uint160(safeSingleton))
));

address predicted = address(uint160(uint256(keccak256(abi.encodePacked(
    bytes1(0xff), safeFactory, create2Salt, initCodeHash
)))));
```

Because the `safeInitializer` references only chain-identical contracts (the kernel and the `SafeModuleEnabler`), the same `(owner, permissionSigner, manager, feePolicy, saltNonce)` yields the **same SMA address on every supported chain**.

## Front-run resistance

Binding the principals into `boundSalt` means a deployment supplying a different `permissionSigner` or `manager` lands at a **different** address. An attacker therefore cannot register *your* counterfactual address with *their* principals — the address itself is a commitment to the principals (Octane #4 / #16).

## Predicting off-chain

To compute an SMA address before deployment, reproduce the two-step derivation above with your chosen `saltNonce` and principals and the canonical Safe v1.4.1 factory/singleton from [addresses](/protocol/reference/addresses.md). The Sailor SDK exposes this as `account predict`; at the protocol level, mirror the Solidity above. You can fund the predicted address before the Safe exists on a given chain.


---

# 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.sail.money/protocol/reference/deterministic-addresses.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.
