bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 6쪽 중 4쪽
current ephemeral index and address, and lets the user scan for balances at any given index. Scan for both the native token and ERC-20s: combine a curated token list with a recent-block log scan for the recipient, since an arbitrary swap output can be missed by the curated list alone. Let the user recover stranded funds by reshielding them directly back into their own RAILGUN balance. Recovery targets a specific, possibly prior, ephemeral index. It must not disturb the wallet's live, current index, and must never ratchet the live index afterward.
#### Architecture notes
* The delegate contract is a single, general-purpose, whitelisted contract. No wallet should deploy its own version. All wallets that integrate this flow should point at the same canonical delegate contract, rather than build a bespoke implementation. A wallet-specific contract creates a distinguishable on-chain fingerprint: which contract a user's transactions route through becomes metadata that narrows down which wallet app they use. That works against Railgun's anonymity set, not for it.
* First-time use requires the user to sign the Type 4 delegation authorization before their EOA can use the delegate contract. Handle this as an explicit first-use step in your flow. Do not assume delegation is already in place. Check on-chain whether the account is already delegated before you prompt the user to sign again.
* EIP-7702 (native account delegation) and ERC-4337 (UserOperations, bundlers, paymasters) are not the same thing, and they are not compatible with each other. If your wallet has existing 4337 smart-account infrastructure, do not assume it interoperates with this flow. This integration is built on native 7702 authorizations, not UserOperations.
* **Two separate signatures are involved, not one.** First, the EIP-7702 `Authorization` tuple itself: the native account-delegation signature that points the ephemeral EOA's code at the delegate contract address. Second, a separate EIP-712 execution signature over the specific batch of calls being executed (`{payloadHash}`, domain `{name: 'RelayAdapt7702', version: '1', chainId, verifyingContract: <the ephemeral EOA's own address>}`). The second signature is what lets a broadcaster, or anyone, submit the transaction on the user's behalf without holding the ephemeral's private key. The delegate contract verifies the execution signature on-chain, rather than trusting `msg.sender`. If you integrate below the level the SDK wraps, you must produce both signatures and keep them in sync (see the nonce note below). If you call the SDK's own shield, swap, and unshield functions, this is handled for you.
* **Ephemeral EOA derivation uses a fully hardened BIP-32 path**: `m/44'/60'/0'/7702'/<railgunIndex>'/<chainId>'/<index>'`. It derives from the wallet's own mnemonic, and mnemonic password if any. Chain ID is baked into the path, so ephemeral addresses are chain-specific by construction. This matches the "per wallet and chain index" model described above.
* **The engine supports pluggable ephemeral signers** (`setEphemeralSignerProvider`) for wallets that do not want mnemonic-derived ephemeral keys, for example a hardware wallet or MPC signer. A custom provider owns its own key derivation and must manage its own index (`setEphemeralKeyIndex`). The engine's automatic index-ratcheting and on-chain-history resync (`incrementEphemeralKeyIndex`, `scanHistoryForEphemeralIndex`) work only for the default HD-derived provider. This matters if your wallet does not do mnemonic-based key management.
* **The delegate contract itself has at least two execution ABIs**: a current nonce-aware `execute()`, and a `LegacyPreExecuteNonce` variant without it. The engine tries both when it parses or validates a 7702 transaction it did not construct itself. Wallet devs do not need to branch on this directly; the SDK's execution-type default handles it. It is worth knowing if you debug a transaction that fails to parse. All current deployments use the nonce-aware ABI.
#### Registry
The on-chain registry holds the contract addresses that make up the protocol, as well as the supporting non-protocol contracts, such as the 7702 delegate contract. Read the delegate address with `getContractAddress('RelayAdapt7702')`. On each network in the table below, the registry returns the same delegate address that `@railgun-community/shared-models` 8.2.1 has hardcoded.
The SDK does not resolve the delegate address from the registry every time. At the engine level, network setup takes an explicit delegate contract address (`relayAdapt7702ContractAddress`) as a parameter. There is no code path where the engine calls the registry and substitutes whatever it returns in place of your configured value. If you also supply the registry's address (`railgunRegistryContractAddress`), the engine does a one-time check on load. It calls the registry's `getContractAddress('RelayAdapt7702')` and logs a **warning** if that disagrees with the address you configured. It does not block, and it does not switch to the registry's value. The engine keeps using whatever address you configured either way.
In practice, this means **your app, or its remote-configuration mechanism, is responsible for keeping the delegate address current**. If you use the SDK, the addresses come from `@railgun-community/shared-models`, so keep that package up to date.
If your wallet needs to override or pin a specific delegate address, for example ahead of an SDK release, check whether `@railgun-community/wallet`'s network-loading function exposes an equivalent parameter.
The earlier release-candidate addresses (`@railgun-community/shared-models` 8.1.0-rc.1) are superseded. Do not use them.
| Network | Delegate contract (`RelayAdapt7702`) | Registry |
| -------------------------- | -------------------------------------------- | -------------------------------------------- |
| Ethereum | `0x1F74b4339990Db761bC0168F20D294A3a141497e` | `0xF361d49b40E44CB23e6138B4cB32607322d9B595` |
| BNB Chain | `0xa2BFd382c54bb33DF6A13f21acd8770dc1e67D4D` | `0xDdE5c5a39945803Aa45f738688b319cFB172738c` |
| Polygon | `0xa2BFd382c54bb33DF6A13f21acd8770dc1e67D4D` | `0xDdE5c5a39945803Aa45f738688b319cFB172738c` |
| Arbitrum | `0xa2BFd382c54bb33DF6A13f21acd8770dc1e67D4D` | `0xDdE5c5a39945803Aa45f738688b319cFB172738c` |
| Base | `0xAcBC3De27E7d9750a7F26b2eCCE9c89C24Cc8691` | `0xFe276aD6a9Be967292D7fcb74E5510a1A6796bFb` |
| Ethereum Sepolia (testnet) | `0x05ae73c5925d843864ae6F261f3175De2ebCd963` | `0xb0FBBC5ba90ef3e565f162f8873F0dFF85dC9A0e` |
#### Rescuing funds from a delegated EOA while preserving privacy and saving gas
The core Railgun-orchestrated unshield-swap-reshield flow does not require the delegated EOA to hold its own gas. A broadcaster can submit that transaction and pay gas itself. The signed Type 4 authorization only has to come from the user's EOA, not from the gas payer. The broadcaster sponsors the whole thing the same way it does today.
**Recovering a stray balance does not require funding the EOA either.** This corrects an earlier assumption in this doc. In Terminal Wallet's recovery flow, the funds move by building a 7702 relay-adapt batch signed by the target ephemeral EOA. The EOA authorizes; it does not need to hold gas. The wallet submits the batch either through a broadcaster, with the fee paid in a token, or by self-broadcasting from the user's own already-funded public wallet as the transaction sender. Either way, the stranded balance gets reshielded straight back into the user's RAILGUN balance, with no gas top-up needed at the ephemeral address.
#### Privacy note for implementers
If you build sponsor or paymaster-style gas UX on top of this, do not require the user to reveal their shielded note in plaintext to a third party to get a gas quote or sponsorship. That defeats the privacy guarantee Railgun exists to provide. If you need a gas-sponsorship model, design it so the sponsor learns only what it needs to validate and price the transaction, not the user's private balance contents.
#### Integration checklist
* Upgrade to the stable 7702-capable SDK versions: `@railgun-community/wallet` 11.2.0, `@railgun-community/cookbook` 3.0.2, `@railgun-community/shared-models` 8.2.1, `@railgun-community/waku-broadcaster-client-node` 10.0.1, `ethers` 6.14.3. Do not use the old rc versions or the `dev` tag.
* Review the release notes for non-7702 breaking changes in the major version upgrades (wallet 11, cookbook 3, waku-broadcaster-client-node 10). Check the peer-dependency warning between waku-broadcaster-client-node 10.0.1 (`@railgun-community/wallet` `~11.1.0`) and wallet 11.2.0.
* Use the delegate addresses from the table above (they come with `shared-models` 8.2.1). Remove any hardcoded rc-era addresses from your app or remote config.
* Keep your SDK current. The SDK does not resolve the delegate address from the registry for you. It only warns on a mismatch.
* Add Base to your 7702 network list if you support it. Base has a delegate deployment.
* Base-token shield: derive an `EphemeralAccount` (via `getCurrentEphemeralWallet`) and pass it to `gasEstimateForShieldBaseToken` and `populateShieldBaseToken`.
* Base-token unshield: mark it as a 7702 (type-4) relay-adapt transaction in your gas-details plumbing. Do not assume it is unaffected.
* Private swaps and cross-contract calls: switch to `gasEstimateForUnprovenCrossContractCalls7702` and `generateCrossContractCallsProof7702`.
* If you use a swap recipe: override the quote's taker and recipient to the ephemeral EOA's own address, not the network's relay-adapt contract address.
* Use the swap recipe's own `minGasLimit` for swaps, not a hardcoded floor. Deterministic operations (shield, unshield, recovery) can use `0`.
* Keep `EVMGasType.Type4` through the whole pipeline for 7702 flows. Do not let a broadcaster-routing branch downgrade it to Type1.
* Pin `overallBatchMinGasPrice` to `0` for 7702 batches.
* Filter broadcaster discovery to 7702-capable broadcasters for 7702 flows.
* Pass the signed authorization tuple and explicit type-4 fee and gas-limit overrides through to the broadcaster submission call.
* Sync the local ephemeral index from on-chain history once per session. Keep a durable local record of the index, not just an in-memory, per-session value.
* Ratchet the ephemeral index forward only after a relay-adapt transaction has actually broadcast successfully. Never ratchet speculatively, and never after a recovery build, which targets a specific, possibly prior, index.
* Ship ephemeral-account admin and recovery tooling: show the current index and address, scan for stranded balances at a given index, and let the user reshield stranded funds back into RAILGUN.
* Recovery does not require funding the ephemeral EOA with gas: a broadcaster or the user's own public wallet pays. Reserve the unshield-to-address gas top-up pattern for direct third-party DApp interaction only.
* Test on mainnet. Testnets do not have the real DeFi liquidity and interactions needed to validate swap flows end to end. Use Ethereum Sepolia for basic shield and unshield checks.
* If you have existing 4337 smart-account infrastructure, treat this as a separate, non-interoperable code path.
# RAILGUN Deductions
**Protocol Deductions**
The smart contracts take a 0.25% deduction per shield and unshield interaction which is then sent to the “treasury address”. Protocol deductions are distributed to RAILGUN decentralized governance participants over time to RAIL stakers in the form of [Active Governor Allocation](/wiki/rail-token/rail-security-rewards).
**Broadcaster Premiums**
To use RAILGUN, users can supply a [Broadcaster](https://docs.railgun.org/wiki/learn/privacy-system/community-relayers) to facilitate their interactions (users can self-relay interactions if they want to save on gas). Broadcasters require a % premium of the overall gas price for the interaction, but not for the interaction amount. Thus, Broadcaster Premiums do not increase with interaction size.
As RAILGUN interactions are [gasless](https://docs.railgun.org/wiki/learn/using-shielded-tokens/gasless-transactions) (users do not need ETH/MATIC/BNB to send interactions once assets are shielded), broadcaster premiums contain the underlying blockchain's gas converted to whichever token that users are transacting in. For example, if you are sending DAI on the Ethereum blockchain, then the Broadcaster Premium (which also contains the blockchain interaction gas) is sent entirely in DAI and you do not need to hold/spend ETH in your 0zk address.
Therefore, Broadcaster Premiums vary depending on: 
* Which chain you are using RAILGUN on
* Gas price at the time of the interaction
* What % of the gas Broadcasters decide to require as an additional premium
Premiums are broadcast across the [Waku P2P network](https://docs.railgun.org/wiki/learn/privacy-system/community-relayers) and are only needed if users decide to send the interaction and consider the premium & gas to be acceptable. Broadcaster Premiums are up to the individual Broadcasters themselves, but generally they are \~10% of the total gas.
Broadcasters compete to provide the lowest premiums.
# Helpful Links
Links, wallet providers, and on-chain contract addresses for RAILGUN across every deployed chain.
**Common Misconceptions:** See [Common Misconceptions](/wiki/learn/common-misconceptions) for corrections to frequently wrong claims about RAILGUN.
**Website**: <https://railgun.org/> 
**Staking Portals:** 
* <https://stakerail.fi/>
* [https://railstaker.io ](<https://railstaker.io >)
Both are community-run front ends over the on-chain staking contracts, not operated by the RAILGUN contributors. Verify any balance or reward against the contract addresses below, or interact with the contracts directly.
**Developer Guide**: <https://docs.railgun.org/developer-guide/wallet/wallet-overview>
**Wallets:** <https://railgun.org/#wallets> 
**Twitter**: <https://twitter.com/railgun_project> 
**Github**: <https://github.com/railgun-community>
**Telegram Channels**: <https://t.me/railgun_privacy>, <https://t.me/railprice>, <https://t.me/Railgunproject>, <https://t.me/railwaywallet>
**OTC Telegram Chats**: <https://t.me/railpoly>, <https://t.me/railbsc> 
## Privacy System Contracts
#### **ETH Deployment**: 
<https://etherscan.io/address/0xfa7093cdd9ee6932b4eb2c9e1cde7ce00b1fa4b9> 
#### **Polygon Deployment**:
<https://polygonscan.com/address/0x19b620929f97b7b990801496c3b361ca5def8c71> 
#### **BSC Deployment**: 
<https://bscscan.com/address/0x590162bf4b50f6576a459b75309ee21d92178a10>
#### **Arbitrum Deployment:**
<https://arbiscan.io/address/0xFA7093CDD9EE6932B4eb2c9e1cde7CE00B1FA4b9>
#### Sepolia Testnet
<https://sepolia.etherscan.io/address/0xecfcf3b4ec647c4ca6d49108b311b7a7c9543fea> 
## Treasury
#### **ETH**: 
<https://etherscan.io/address/0xE8A8B458BcD1Ececc6b6b58F80929b29cCecFF40> 
#### **Polygon**: 
[https://polygonscan.com/address/0xdca05161ee5b5fa6df170191c88857e70ffb4094 ](<https://polygonscan.com/address/0xdca05161ee5b5fa6df170191c88857e70ffb4094 >)
#### **BSC**: 
<https://bscscan.com/address/0xdca05161eE5b5FA6DF170191c88857E70FFB4094>
#### **Arbitrum Treasury:** 
<https://arbiscan.io/address/0x3b374464a714525498e445ba050b91571937bfc8>
## Protocol Request Contracts
#### Ethereum:
<https://etherscan.io/address/0xc480f68a3dcc3edd82134fab45c14a0fcf1da3cc>
#### Polygon:
<https://polygonscan.com/address/0xc3f2c8f9d5f0705de706b1302b7a039e1e11ac88>
#### BSC:
<https://bscscan.com/address/0xc3f2c8f9d5f0705de706b1302b7a039e1e11ac88>
## Rewards
#### Ethereum:
<https://etherscan.io/address/0xa02782ce1bf85f56f8cc7c0e66e61299ac75c86f>
#### Polygon:
<https://polygonscan.com/address/0x25f795A8eC8aF7904aa403fF2Cc7205ce683BF52>
#### BSC:
<https://bscscan.com/address/0xa7A9582C2563a1b923dbff6a8A2fa625ee2FB1f8>
## Staking
#### Ethereum:
<https://etherscan.io/address/0xee6a649aa3766bd117e12c161726b693a1b2ee20>
#### Polygon:
<https://polygonscan.com/address/0x9AC2bA4bf7FaCB0bbB33447e5fF8f8D63B71dDC1>
#### BSC:
<https://bscscan.com/address/0x753f0f9ba003dda95eb9284533cf5b0f19e441dc>
# Common Misconceptions
Corrections to the most common wrong claims about RAILGUN, including addresses, the RAIL token, PPOI, and staking.
**Not RAILGUN:** Cloudflare's discontinued "Railgun" web-acceleration product is a different, unrelated product that happens to share the name.
**RAILGUN Connect** is a WalletConnect-style plugin for RAILGUN wallets, currently in development. It is not a bridge and does not move assets between chains. RAILGUN does not use a bridge or L2 for any part of the protocol.
**Security staking:** the referenced portal is [stakerail.fi](https://stakerail.fi), run by a third party, not the protocol team, as a front end over the on-chain staking contracts. You can also interact with the staking contracts directly, or run your own portal via IPFS. See [Helpful Links](/wiki/learn/helpful-links) for the contract addresses.
**PPOI (Private Proofs of Innocence)** is an optional compliance layer, separate from the core RAILGUN contracts, that screens new shields against public bad-actor lists. It does not make RAILGUN's privacy conditional. Transactions are processed by the smart contracts with or without it. The integration of PPOI is up to the individual wallet developers and its main user-facing effect is a delay of about 1 hour before a new shield can be spent forward. Tokens can always be unshielded back immediately.
**0zk addresses** are the only valid RAILGUN private address format today. RAILGUN is a Layer 1 smart-contract system, not a rollup, so there is no "rollup address."
**RAIL** is a real ERC-20 token used only for protocol security (staking). Security stakers evaluate the content of protocol requests and decide whether they should be executed. RAIL is never used to pay transaction or gas fees, has no "RAIL guardian" role, and has no buy-back-and-burn mechanism.
**Treasury funds** never pass through a developer wallet. Protocol deductions go directly to an on-chain treasury contract and are distributed to security stakers autonomously on a fixed schedule. Any change requires a passed on-chain protocol request.
**The trusted setup** uses multi-party computation, not a multisig. It is secure as long as at least one participant destroys their randomness (Toxic Waste) afterward. Verification keys are meant to be public. Forging a fake proof would require undestroyed Toxic Waste, not a "leaked" verification key.
**Viewing keys are shareable by design.** The spending key must never leave your hands. You can generate and share a viewing key (see [View-Only Wallets](https://docs.railgun.org/developer-guide/wallet/private-wallets/view-only-wallets)) to give someone read-only access to your balances and history, with zero ability to spend.
**Merkle trees:** every RAILGUN Merkle tree has a fixed depth of 16 (65,536 leaves per tree).
**Live contract version:** RAILGUN V2, on Ethereum, Polygon, BSC, and Arbitrum. See [Helpful Links](/wiki/learn/helpful-links) for current deployment addresses on each chain.
# Private Proofs of Innocence
Learn about the state of the art Zero-Knowledge assurance tool
### Overview
PPOI is optional and separate from RAILGUN's core smart contracts. It does not make RAILGUN's privacy conditional. A shielded transaction is exactly as private with or without any given List Provider. Its only user-facing effect is a temporary delay, described in the Unshield-Only Standby Period section below, before a new shield can be spent forward. Tokens can always be unshielded back immediately regardless of PPOI status.
Private Proofs of Innocence is a decentralized bad transaction prevention system built by zero-knowledge (ZK) cryptography researchers. It is an independent partner project to the RAILG프로젝트로 돌아가기