bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 56쪽 중 31쪽
eys in an assigned owner wallet or for all keys staked in a staking pool owned or delegated.
\
The amount of winning keys will no longer be determined based on the random chance for a specific Node License Key ID and the staking tier boost factor but from a random chance based on the owner/pool address, the staking tier boost factor and the total amount keys either staked in a pool for a pool bulk submission or unstaked keys in an owner wallet for an owner bulk submission.
New Functions:
1. submitBulkAssertion: params
1. address \_bulkAddress
2. uint256 \_challengeId
3. bytes memory \_confirmData
This function replaces submitMultipleAssertions.
The \_bulkAddress should be either the poolAddress being submitted for, or the key owner’s wallet address. Individual key Ids are no longer required to be passed into the function call.
2. claimBulkRewards: params
1. address \_bulkAddress
2. uint256 \_challengeId
This function replaces claimMultipleRewards.<br>
The \_bulkAddress should be either the poolAddress being claimed for, or the key owner’s wallet address. Individual key Ids are no longer required to be passed into the function call.<br>
Changes to calculation algorithm:
1. Individual key Ids are no longer used to calculate “Winning Keys”.
2. Instead, a statistical probability method is used.
3. The same method is used for pools and owner wallets. 
4. There are two variations to the new algorithm.
1. High probability of having a winning key (1% or more).
2. Low probability of having a winning key (Less than 1%)
Algorithm Flow
1. The algorithm will first determine the number of keys being submitted for.
1. For pools, this will be the total number of keys staked.
2. For owner wallets, this will be the total number of un-staked keys.
2. Next the algorithm will determine the expected number of winning keys based on the boost factor.
1. Example: 1,000 keys in a pool with a 700 boost factor would expect 70 winning keys.<br>
High Probability Algorithm: for high probabilities where we expect at least 1 winning key
3. We now use a random number to add/subtract up to 30% variance to the expected winning keys.
1. This means the example above for an expected winning key count of 70 winning keys could return anywhere from 49 to 91 winning keys with the average being about 70 keys over the long term.
Low Probability Algorithm: for low probabilities (less than 1%), where we do not always expect at least 1 winning key we calculate this differently. 
1. We determine the total probability of winning (1= 0.01 %, 100=1% etc…)
2. We scale that up(multiply) by 10,000. (Scaled Probability of Winning)
3. We now generate a random number between 0 - 999,999.
4. If the random number is below the Scaled Probability of Winning, the submission wins for a single key.
What happens when keys get staked or unstaked into a pool during a challenge:\
Any already submitted bulk assertion for the current challenge will be updated to reflect the changes in the number of keys and resulting number of winning keys.
If a pool has already submitted a bulkAssertion and a new key is staked into the pool before the end of the challenge, the following will happen:
1. If the owner of the staked key as already submitted a bulk submission for the current challenge, that submission will be updated to reflect the owner’s new un-staked key count and will then be re-calculated based on the owner’s new un-staked key count.
2. If the pool has already submitted a pool bulk submission for the current challenge, that submission will be updated to reflect the new staked key count and will then be re-calculated based on the new staked key count.
What happens if keys are un-staked from a pool during a challenge:
If a pool has already submitted a pool bulk submission and a key is un-staked from the pool before the end of the challenge, the following will happen:
1. The previously submitted pool bulk submission will be re-calculated based on the new staked key count after the un-staked key has been removed from the pool’s staked key count.
The goal of the changes are to allow the number of keys/node licenses to be scaled up without increasing the operational gas costs for an operator and reducing the amount of data/computations that need to be handled on-chain.
<br>
# Xai Chains & Parameters
# Connect to Xai Mainnet
Follow the steps below to connect to the Xai Testnet as a developer
***
### Chain Details
* Chain Type: AnyTrust
* Network Name: Xai
* RPC URL: [https://xai-chain.net/rpc](<https://xai-chain.net/rpc >)
* Chain ID: 660279
* Currency Symbol: XAI
* Block Explorer URL: <https://explorer.xai-chain.net/>
***
### Xai Connections & Explorers
Below is a JSON example of what Xai's connections and explorers will be (following this format: <https://github.com/ethereum-lists/chains>). Additionally, for chain type, it is an L3, but that's not an option right now. Currently there are only L2 type chains in the repo.
```
{
"chain": {
"info-json": "[{\"chain-id\":660279,\"parent-chain-id\":42161,\"parent-chain-is-arbitrum\":true,\"chain-name\":\"Xai\",\"chain-config\":{\"homesteadBlock\":0,\"daoForkBlock\":null,\"daoForkSupport\":true,\"eip150Block\":0,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"clique\":{\"period\":0,\"epoch\":0},\"arbitrum\":{\"EnableArbOS\":true,\"AllowDebugPrecompiles\":false,\"DataAvailabilityCommittee\":true,\"InitialArbOSVersion\":11,\"GenesisBlockNum\":0,\"MaxCodeSize\":40960,\"MaxInitCodeSize\":81920,\"InitialChainOwner\":\"0xc7185e37A4aB4Af0E77bC08249CD2590AE3E1b51\"},\"chainId\":660279},\"rollup\":{\"bridge\":\"0x7dd8A76bdAeBE3BBBaCD7Aa87f1D4FDa1E60f94f\",\"inbox\":\"0xaE21fDA3de92dE2FDAF606233b2863782Ba046F9\",\"sequencer-inbox\":\"0x995a9d3ca121D48d21087eDE20bc8acb2398c8B1\",\"rollup\":\"0xC47DacFbAa80Bd9D8112F4e8069482c2A3221336\",\"validator-utils\":\"0x6c21303F5986180B1394d2C89f3e883890E2867b\",\"validator-wallet-creator\":\"0x2b0E04Dc90e3fA58165CB41E2834B44A56E766aF\",\"deployed-at\":166757506}}]",
"name": "Xai"
},
"parent-chain": {
"connection": {
"url": "https://arb1.arbitrum.io/rpc"
}
},
"http": {
"addr": "0.0.0.0",
"port": 8449,
"vhosts": "*",
"corsdomain": "*",
"api": [
"eth",
"net",
"web3",
"arb",
"debug"
]
},
"execution": {
"forwarding-target": "https://xai-chain.net/rpc",
"caching": {
"archive": true
}
},
"node": {
"data-availability": {
"enable": true,
"sequencer-inbox-address": "0x995a9d3ca121D48d21087eDE20bc8acb2398c8B1",
"parent-chain-node-url": "https://arb1.arbitrum.io/rpc",
"rest-aggregator": {
"enable": true,
"online-url-list": "https://xai-chain.net/das-servers"
}
},
"feed": {
"input": {
"url": "wss://xai-chain.net/feed"
}
}
}
}
```
***
# Bridge to Xai Mainnet
## Bridge XAI to Xai Mainnet
{% hint style="info" %}
You'll need sufficient ETH in your wallet to cover the transactions costs of bridging funds
{% endhint %}
1. Go to <https://bridge.arbitrum.io/?destinationChain=xai&sourceChain=arbitrum-one>
2. Confirm you see XAI in the currency dropdown.
3. Enter an amount to bridge.
4. Click "Move funds to Xai"
5. Wait at least 10 minutes for the bridging process to complete.
## Bridge ETH to Xai Mainnet 
{% hint style="info" %}
You'll need wrap your ETH (WETH) to bridge to Xai. For a guide on wrapping ETH see [below](#wrap-eth-to-get-weth-on-arbitrum). For an explanation on why ETH needs to be wrapped at all, check out this [article](https://ethereum.org/en/wrapped-eth/#why-do-we-need-to-wrap-eth).
{% endhint %}
1. Go to <https://bridge.arbitrum.io/?destinationChain=xai&sourceChain=arbitrum-one>
2. Click XAI in the currency dropdown.
3. Type in WETH.
{% hint style="info" %}
These are the two WETH contracts depending on the chain:
* WETH on Xai: 0xbee82cfdaff4a6aa4e4793cb81eb1c2e79ac463c
* WETH on Arb: 0x82af49447d8a07e3bd95bd0d56f35241523fbab1
{% endhint %}
4. Enter an amount to bridge.
5. Click "Move funds to Xai"
6. Wait at least 10 minutes for the bridging process to complete.
<figure><img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2FwRwNVO4fQWxCVU1dLstM%2FScreenshot%202024-06-18%20at%207.48.49%E2%80%AFAM.png?alt=media&token=06781767-a232-473f-98c7-019e2b414143" alt="" width="375"><figcaption><p>Arbitrum Bridge to move XAI into Xai mainnet</p></figcaption></figure>
## Wrap ETH to get WETH on Arbitrum
1. Go to <https://app.camelot.exchange/>
2. Connect your wallet on the top right
3. Select To currency as WETH
4. Click Wrap
<figure><img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2FEA224UWcYvsXj0MBFOnh%2FScreenshot%202024-06-18%20at%204.31.26%E2%80%AFPM.png?alt=media&token=21321a1f-875c-4710-a43a-d7aeedae2ed0" alt="" width="375"><figcaption><p>Camelot DEX UI to wrap ETH</p></figcaption></figure>
# Connect to Xai Testnet (Sepolia)
Follow the steps below to connect to the Xai Testnet as a developer
***
### Chain Details
* Chain Type: AnyTrust
* Network Name: Xai Testnet v2
* RPC URL: <https://testnet-v2.xai-chain.net/rpc>
* Chain ID: 37714555429
* Currency Symbol: sXAI
* Block Explorer URL: <https://sepolia.xaiscan.io/>
Arb Sepolia Addresses:
* Batch poster: 0xd154C1532449D65eda18a7Ad36a122e2ecF2B891 
* Validator: 0x4eE5549E6d77Db5529EbE0b8e8Fe9f833aca2ED2 
* Custom fee token: 0x4e6f41acbfa8eb4a3b25e151834d9a14b49b69d2 
* Owner: 0x71B61c2E250AFa05dFc36304D6c91501bE0965D8
If you need Testnet XAI let us know on our Discord.
# Bridge to Xai Testnet
You can bridge Sepolia XAI (sXAI) to Xai Testnet from Arbitrum Sepolia using the steps below:
1. Go to <https://bridge.arbitrum.io/?destinationChain=xai-testnet&sourceChain=arbitrum-sepolia>
2. Depending on the direction of the bridge (Xai -> Arb **or** Arb -> Xai), click the up/down arrow button.
3. Enter the amount of SXAI you want to bridge.
<figure><img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2FVfyQlB1MqKaveKT2qqyM%2Fimage.png?alt=media&token=172efdfa-5eae-41dd-b40b-5ec00c634f69" alt="" width="375"><figcaption></figcaption></figure>
4. Click "Move funds to Xai Testnet"
5. Wait at least 10 minutes for the bridging process to complete.
{% hint style="info" %}
If this is your first time connecting your wallet to Xai testnet, you must add Xai testnet manually using [this information](/xai-network/en/build-on-xai/xai-chains-and-parameters/connect-to-xai-testnet-sepolia).
{% endhint %}
# Bridged Token Addresses
Various ERC-20 tokens originally deployed to Ethereum also have corresponding "bridged" representations on Xai Mainnet.
{% hint style="info" %}
The presence of a token on this page does not imply any endorsement of the token or its minter
{% endhint %}
## Xai Mainnet
| Name | Symbol | L2 Token (ArbOne) | L3 Token (Xai) |
| ------------- | ------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| XAI | XAI | [0x4cb9a7ae498cedcbb5eae9f25736ae7d428c9d66](https://arbiscan.io/token/0x4cb9a7ae498cedcbb5eae9f25736ae7d428c9d66) | Native token |
| Wrapped XAI | wXAI | N/A | [0x3fB787101DC6Be47cfe18aeEe15404dcC842e6AF](https://xaiscan.io/address/0x3fB787101DC6Be47cfe18aeEe15404dcC842e6AF) |
| esXAI | esXAI | [0x4C749d097832DE2FEcc989ce18fDc5f1BD76700c](https://arbiscan.io/token/0x4C749d097832DE2FEcc989ce18fDc5f1BD76700c) | |
| USD Coin | USDC | [0xaf88d065e77c8cc2239327c5edb3a432268e5831](https://arbiscan.io/token/0xaf88d065e77c8cc2239327c5edb3a432268e5831) | [0x1E3769Bd5fB2e9e9e7D4ED8667c947661F9A82E3](https://xaiscan.io/address/0x1E3769Bd5fB2e9e9e7D4ED8667c947661F9A82E3) |
| Wrapped Ether | wETH | [0x82af49447d8a07e3bd95bd0d56f35241523fbab1](https://arbiscan.io/token/0x82af49447d8a07e3bd95bd0d56f35241523fbab1) | [0xBeE82CfdAff4a6AA4E4793cb81eb1C2E79aC463C](https://xaiscan.io/address/0xBeE82CfdAff4a6AA4E4793cb81eb1C2E79aC463C) |
# Contract Addresses
The following information may be useful to those building on Xai. We list the addresses of the smart contracts related to the protocol.
## Core contracts
The following contracts are deployed on Arbitrum One (L2)
<table><thead><tr><th width="272"></th><th>Xai</th><th data-hidden>Sepolia</th></tr></thead><tbody><tr><td>Rollup</td><td><a href="https://arbiscan.io/address/0xC47DacFbAa80Bd9D8112F4e8069482c2A3221336"><code>0xC47DacFbAa80Bd9D8112F4e8069482c2A3221336</code></a></td><td></td></tr><tr><td>Sequencer</td><td><a href="https://arbiscan.io/address/0x995a9d3ca121D48d21087eDE20bc8acb2398c8B1"><code>0x995a9d3ca121D48d21087eDE20bc8acb2398c8B1</code></a></td><td></td></tr><tr><td>CoreProxyAdmin</td><td><a href="https://arbiscan.io/address/0x041f85dd87c46b941dc9b15c6628b19ee5358485#code"><code>0x041F85dD87c46B941dc9b15c6628B19ee5358485</code></a></td><td></td></tr></tbody></table>
## Cross-chain messaging contracts
The following contracts are deployed on Arbitrum One (L2)
<table><thead><tr><th width="208"></th><th>Xai</th></tr></thead><tbody><tr><td>Delayed Inbox</td><td><a href="https://arbiscan.io/address/0xaE21fDA3de92dE2FDAF606233b2863782Ba046F9"><code>0xaE21fDA3de92dE2FDAF606233b2863782Ba046F9</code></a></td></tr><tr><td>Bridge</td><td><a href="https://arbiscan.io/address/0x7dd8A76bdAeBE3BBBaCD7Aa87f1D4FDa1E60f94f"><code>0x7dd8A76bdAeBE3BBBaCD7Aa87f1D4FDa1E60f94f</code></a></td></tr><tr><td>Outbox</td><td><a href="https://arbiscan.io/address/0x7dd8A76bdAeBE3BBBaCD7Aa87f1D4FDa1E60f94f"><code>0x1E400568AD4840dbE50FB32f306B842e9ddeF726</code></a></td></tr><tr><td>Challenge Manager</td><td><a href="https://arbiscan.io/address/0x3a3f62034a42a35eA1686B199bB73006aa525eE4"><code>0x3a3f62034a42a35eA1686B199bB73006aa525eE4</code></a></td></tr></tbody></table>
# How to run a full node for Xai chain
{% hint style="info" %}
Note: For steps on how to run a Xai Sentry Node (unrelated to running a full node for Xai chain), go [here](/xai-network/en/about-xai/sentry-key-setup).
{% endhint %}
This how-to provides step-by-step instructions for running a full Xai node on your local machine.
## Prerequisites[](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#prerequisites) <a href="#prerequisites" id="prerequisites"></a>
Latest Docker Image: `offchainlabs/nitro-node:v2.3.3-6a1c1a7`
| Minimum Hardware Configuration |
| ------------------------------ |
| **RAM**: 16 GB |
| **CPU**: 4 core CPU |
| **Storage**: 1 TB |
## Required parameters[](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#required-parameters) <a href="#required-parameters" id="required-parameters"></a>
### 1. Parent chain parameters[](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#1-parent-chain-parameters) <a href="#id-1-parent-chain-parameters" id="id-1-parent-chain-parameters"></a>
The `parent-chain` argument needs to provide a standard RPC endpoint for an EVM node, whether self-hosted or obtained from a node service provider:
```
--parent-chain.connection.url=<Parent chain RPC URL>
```
NOTE
[Public Xai RPC endpoints](/xai-network/en/build-on-xai/developer-tools/rpc) rate-limit connections. To avoid hitting a bottleneck, you can run a local node for the parent chain (Arbitrum) or rely on third-party RPC providers.
### 2. Child chain parameters[](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#2-child-chain-parameters) <a href="#id-2-child-chain-parameters" id="id-2-child-chain-parameters"></a>
Xai is the child chain and the required parameters are `chain.info-json` and `chain.name`
**1. `chain.info-json`**[****](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#1-chaininfo-json)
`--chain.info-json` is a JSON string that contains required information about Xai chain.
```
--chain.info-json=<Xai Chain's chain info>
```
An example of `chain.info-json` is available in the next section.
**2. `chain.name`**[****](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#2-chainname)
`--chain.name` is a mandatory flag that needs to match the chain name used in `--chain.info-json`:
```
--chain.name=<My Xai Chain>
```
**3. AnyTrust chains**[****](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#3-anytrust-chains)
For Anytrust chains, you need to to add the following flags to the command or configuration:
```
--node.data-availability.enable
```
And:
```
--node.data-availability.rest-aggregator.urls=<A list of DAS REST endpoints>
```
Or:
```
--node.data-availability.rest-aggregator.online-url-list=<A url that returns a list of the DAS REST endpoints>
```
### 3. Important ports[](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#3important-ports) <a href="#id-3important-ports" id="id-3important-ports"></a>
| Protocol | Port |
| ----------------- | ------ |
| `RPC`/`http` | `8547` |
| `RPC`/`websocket` | `8548` |
| `Sequencer Feed` | `9642` |
* Please note: the `RPC`/`websocket` protocol requires some ports to be enabled, you can use the following flags:
* `--ws.port=8548`
* `--ws.addr=0.0.0.0`
* `--ws.origins=\*`
### 4. Putting it all together[](https://docs.arbitrum.io/node-running/how-tos/running-an-orbit-node#4-putting-it-all-together) <a href="#id-4-putting-it-all-together" id="id-4-putting-it-all-together"></a>
* When running a Docker image, an external volume should be mounted to persist the database across restarts. The mount point inside the Docker image should be `/home/user/.arbitrum`
* Example:
```
docker run --rm -it -v /some/local/dir/arbitrum:/home/user/.arbitrum -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/nitro-node:v2.3.3-6a1c1a7 --parent-chain.connection.url=<Parent chain RPC URL> --chain.id=<XaiChainId> --chain.name=<My Xai Chain> --http.api=net,web3,eth --http.corsdomain=* --http.addr=0.0.0.0 --http.vhosts=* --chain.info-json=<Xai Chain's chain info>
```
* Ensure that `/some/local/dir/arbitrum` already exists otherwise the directory might be created with `root` as owner, and the Docker container won't be able to write to it
* When using the flag `--chain.info-json=<Xai Chain's chain info>`, replace `<Xai Chain's chain info>` with the specific `chain info` JSON string of the Xai chain for which you wish to run the node:
* Example:
```
--chain.info-json="[{\"chain-id\":94692861356,\"parent-chain-id\":421614,\"chain-name\":\"My Xai Chain\",\"chain-config\":{\"chainId\":94692861356,\"homesteadBlock\":0,\"daoForkBlock\":null,\"daoForkSupport\":true,\"eip150Block\":0,\"eip150Hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"clique\":{\"period\":0,\"epoch\":0},\"arbitrum\":{\"EnableArbOS\":true,\"AllowDebugPrecompiles\":false,\"DataAvailabilityCommittee\":false,\"InitialArbOSVersion\":10,\"InitialChainOwner\":\"0xAde4000C87923244f0e95b41f0e45aa3C02f1Bb2\",\"GenesisBlockNum\":0}},\"rollup\":{\"bridge\":\"0xde835286442c6446E36992c036EFe261AcD87F6d\",\"inbox\":\"0x0592d3861Ea929B5d108d915c36f64EE69418049\",\"sequencer-inbox\":\"0xf9d77199288f00440Ed0f494Adc0005f362c17b1\",\"rollup\":\"0xF5A42aDA664E7c2dFE9DDa4459B927261BF90E09\",\"validator-utils\":\"0xB11EB62DD2B352886A4530A9106fE427844D515f\",\"validator-wallet-creator\":\"0xEb9885B6c0e117D339F47585cC06a2765AaE2E0b\",\"deployed-at\":1764099}}]"
```
* When shutting down the Docker image, it is important to allow a graceful shutdo프로젝트로 돌아가기