# Welcome to XHash

Welcome to XHash Docs - All in one Web3 platform.

This documentation contains resources to learn more about XHash core products, learn how to build web3 applications, explore developer guides, and check out our API references.

### *Get access to* [*XHash for free here.*](https://www.xhash.com/)

## :books:Guides: Jump right in

Introduction to XHash

{% content-ref url="/pages/wih7Au5RWKJfDEEru5ta" %}
[What is XHash?](/introduction/what-is-xhash)
{% endcontent-ref %}

Free sign up to use the XHash full suite of products. Sign Up for Free Use.

{% content-ref url="/pages/B4zWb4s0RDEqJvDouuJX" %}
[Sign Up for Free Use](/introduction/sign-up-for-free-use)
{% endcontent-ref %}

Learn how to stake on the blockchain to earn staking rewards.

{% content-ref url="/pages/1IcIgHToTiCcyv1DtDxU" %}
[Non-Custodial Staking](/staking/non-custodial-staking)
{% endcontent-ref %}


# What is XHash?

This documentation contains resources to learn more about XHash’s core products, learn how to build web3 applications, explore developer guides, and check out our API references.

## :blue\_book:XHash Overview

**XHash is a Web3.0 infrastructure provider, our vision is to build a stable, reliable, and secure blockchain infrastructure, provides POS staking service and multichain API to improve Web3.0 development with our customers.**

XHash built a brand new Non-Custodial ETH2.0 Staking Pool to serve our customers that interested in being an ETH validator.&#x20;

{% hint style="info" %}
**What is Web3:** Web 3 is the next generation of the Internet. Web 3, or the decentralized web, promises to make the Internet more accessible, transparent, and user-focused. Users of Web 3 will be in complete control of their accounts, data, transactions, and identity. The vision of Web 3 is coming to life today, and its foundation is being built by thousands of developers and designers across the globe.
{% endhint %}

## :dart:Services offered by XHash

* Non-Custodial ETH Staking platform
* Customized Staking API service
* 24/7 support

#### Don't have an account yet? *Get access to* [*XHash **for free here***](https://www.xhash.com/)***.***


# Sign Up for Free Use

### 1. Sign up on the platform using your wallet

1.1 Click `MetaMask` or `WalletConnect` on the login page

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FjlOtk4gynNiSY9zTbw43%2Fimage.png?alt=media\&token=81fcc7e5-dace-4cb8-b0b2-f74886893807)

1.2 Log in to your MetaMask wallet or the wallet whic support WalletConnect, and select Wallet.

### 2.Register on the platform using your email

2.1 Click `Sign Up` on the login page

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2F4lZ5GgX2UZ7tJvLIhgjO%2Fimage.png?alt=media\&token=de5652e9-b495-4024-8da7-fa83b322ff32)

2.2 Enter your email, get and enter the verification code. The setup password must be at least 8 characters, including letters and numbers.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FDaOs74xgSmj9uhE88Jjx%2Fimage.png?alt=media\&token=8d852936-b508-4726-8caf-594ac9453723)

Now, you can log in to the XHash platform with your email.


# Non-Custodial Staking

## 1. Overview

staking is the act of running an Ethereum node connected to the internet and depositing 32 ETH to activate a validator, giving you the ability to participate directly in network consensus.

An Ethereum node consists of both an execution layer (EL) client, as well as a consensus layer (CL) client. These clients are software that work together, along with a valid set of signing keys, to verify transactions and blocks, attest to the correct head of the chain, aggregate attestations, and propose blocks.

An individual wants to participate in the stake and obtain income, he needs to stake 32 ETH on the stake launch pad of the official Ethereum website to create a validator, and then he needs to purchase a series of hardware that meets the requirements, start validator program, consensus layer node, and execution layer nodes on it, are must guarantee to be online 7\*24 hours and need to be upgraded to the latest version on time.

Individual participation in staking requires a lot of time to learn the knowledge of Ethereum staking, purchase hardware, build, maintain and upgrade software, which is very labor-intensive and does not necessarily guarantee income. In XHash, you can create your validator node in just a few simple steps, and the rest work will be done by XHash's professional team, users only need to sit back and receive the benefits.

## 2.XHash Staking tutorial

### 2.1 Quick Mode

Users can download xhash-auto-staking-client from the XHash websit. Through this program, users can generate the validators, complete the deposit, upload the keystore file to XHash in one stop.

For details see [Quick Mode](/staking/non-custodial-staking/quick-mode)**。**

### 2.2 Expert Mode

Users can create validators,complete the deposit step by step follow the instructions on the ethereum official staking launchpad.Finally upload the keystore to XHash for staking.

For details see [Expert Mode](/staking/non-custodial-staking/expert-mode)。


# Quick Mode

## 1.Prerequisite

1. Prepare a Windows or Apple computer, which can open the following two websites:
   * <https://xhash.com>
   * <https://etherscan.io>
2. Register an account with an email address on [xhash.com](https://xhash.com/signUp)
3. Install a wallet that supports WalletConnect on your phone, such as MetaMask, imToke

{% hint style="info" %}
click [here](https://github.com/xhash-com/xhash-auto-staking-client#supported-wallet) to view the list of supported wallet APPs for [xhash-auto-staking-client](https://github.com/xhash-com/xhash-auto-staking-client)
{% endhint %}

## 2.XHash Client Overview&#x20;

[**`xhash-auto-staking-client`**](https://github.com/xhash-com/xhash-auto-staking-client.git)is an eth fast staking program developed by XHash on the basis of [`wagyu-key-gen`](https://github.com/stake-house/wagyu-key-gen) which is the validators generator recommended by Ethereum.The program is completely open source, and users can view, download and run it on the github website.

## 3.Download address

github：<https://github.com/xhash-com/xhash-auto-staking-client/releases/tag/v1.2.1>

## 4.How to use

### 4.1 Create a new mnemonic or import an existing mnemonic

Double click to open the downloaded program,select `CREATE NEW SECRET RECOVERY PHRASE`或`USE EXISTING SECRET RECOVERY PHRASE`。

{% hint style="info" %}
For security, we recommend you disconnect from the internet to complete this step.
{% endhint %}

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FsEO8RGTxTyDnFuqeX7Ia%2F1-xhashclient%EF%BC%88%E9%A6%96%E9%A1%B5%EF%BC%89.png?alt=media&amp;token=199e2688-14cd-475a-8bd8-da9ddcd6e7d7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FhMfUo5kLtaK9ZocyOdJL%2F2-xhashclient%EF%BC%88%E5%88%9B%E5%BB%BA%E6%96%B0%E5%8A%A9%E8%AE%B0%E8%AF%8D%EF%BC%89.png?alt=media&amp;token=af72b2b2-c77f-4356-8742-04aad8584709" alt=""><figcaption><p>創建新助記詞</p></figcaption></figure>

Write down the mnemonic in a safe place. Click `NEXT` to continue.

{% hint style="info" %}
**NOTE:** The mnemonic is the only way to generate your withdrawal key when you wish to withdraw the funds. Please make sure you have kept it safe, preferably offline.
{% endhint %}

### 4.2 Create validator keys

Set `Number of New Keys` and `Password`，Make sure to save the password you set in a safe place. Then click `NEXT`.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FpY9RdTKqbo4Zm06LPPO6%2F3-xhashclient%EF%BC%88%E9%85%8D%E7%BD%AE%E9%AA%8C%E8%AF%81%E8%80%85%E6%95%B0%E9%87%8F%EF%BC%89.png?alt=media&amp;token=b7a1345b-ea71-4d80-9fbd-9714ae2fa2ed" alt=""><figcaption></figcaption></figure>

Retype the password you set, and click `NEXT`.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FCrF6wXaMUH0vipxHjAYh%2F4-xhashclient%EF%BC%88%E9%AA%8C%E8%AF%81%E5%AF%86%E7%A0%81%EF%BC%89.png?alt=media&amp;token=3a6cc173-9e3b-49d2-a036-3fc6c5c73924" alt=""><figcaption></figcaption></figure>

Choose a folder to save your keys.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FiqDBfOoNr1u0AVIissaf%2F5-xhashclient%EF%BC%88%E9%80%89%E6%8B%A9%E7%9B%AE%E5%BD%95%EF%BC%89.png?alt=media&amp;token=35d5e7e6-cfa1-4f45-8c6e-eaf6197213e9" alt=""><figcaption></figcaption></figure>

Create success,Two different files will be generated under the corresponding folder, namely the keystore file（keystore-xxxxxxx.json）and deposit data file（deposit\_data-xxxxxx.json）。

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FoPygmrY3ctv4Vti9BTxd%2F6-xhashclient%EF%BC%88%E9%AA%8C%E8%AF%81%E8%80%85%E5%88%9B%E5%BB%BA%E6%88%90%E5%8A%9F%EF%BC%89.png?alt=media&amp;token=66921ed8-ab83-4750-a1a7-e5c2361969ba" alt=""><figcaption></figcaption></figure>

### 4.4 Validator deposit

After creating the validator, click Next to enter the deposit page, and select the deposit data file just generated.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FpEHsUjCN9WHl9KwznRCX%2F7-xhashclient%EF%BC%88%E9%80%89%E6%8B%A9deposit%E6%96%87%E4%BB%B6%EF%BC%89.png?alt=media&amp;token=44d7a09b-fa46-44d0-98ad-eaaa091bd55b" alt=""><figcaption></figcaption></figure>

After the deposit data file verification is successful, click Next.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FkmxHdOMKD3mJg22XUAnu%2F8-xhashclient%EF%BC%88deposit%E6%96%87%E4%BB%B6%E6%A0%A1%E9%AA%8C%E9%80%9A%E8%BF%87%EF%BC%89.png?alt=media&amp;token=9542822d-41bb-4b9b-8441-a50e2ce3f963" alt=""><figcaption></figcaption></figure>

click WalletConnect,a QR code appears, scan the QR code with a wallet that supports WalletConnect, and connect to the wallet.

{% hint style="info" %}
From this step onwards, an internet connection is required.
{% endhint %}

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2F5tjCcFyrCdluttvG4lT5%2F8-xhashclient%EF%BC%88%E7%82%B9%E5%87%BBwalletconnect%EF%BC%89.png?alt=media&amp;token=2ba1ec27-5dd8-43a3-91b0-9c0812de225c" alt=""><figcaption></figcaption></figure>

After the connection is successful, the wallet address and balance will be displayed, then click Next.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FesoPA9t0HJyxRBNb26Wg%2F9-xhashclient%EF%BC%88%E6%98%BE%E7%A4%BA%E9%92%B1%E5%8C%85%E4%BF%A1%E6%81%AF%EF%BC%89.png?alt=media&amp;token=6e71a512-41a5-438b-b0d6-728a99a72012" alt=""><figcaption></figcaption></figure>

In the validator list, you can choose the normal mode or the batch mode. When there are multiple validator who are ready to deposit, you can choose the batch mode to reduce the number of times you need to confirm the transaction. In the batch mode, a single transaction can process up to 100 deposits .

#### 4.3.1 Normal Mode

In the validator list, you can view the current validator status, click `CONFIRM DEPOSIT`, and the wallet will be connected to initiate a deposit transaction to the eth2.0 contract address, and 32 eth will be transferred. At this time, a corresponding transaction will appear on the wallet. After the user agrees to sign, the transaction will be sent.

{% hint style="info" %} <mark style="color:red;">**Note**</mark>: The address of the eth2.0 stake contract i&#x73;**`0x00000000219ab540356cBB839Cbe05303d7705Fa`**, when deposit, the user needs to carefully check the deposit address.
{% endhint %}

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FqadjLvm5TLLKIwwZgtpJ%2Fimage.png?alt=media&amp;token=0bfa70ad-7222-4d73-9862-10d8c9d879fa" alt=""><figcaption></figcaption></figure>

After completing the deposit, click Next.

#### 4.3.2 Batch Mode

Click the slider to switch to batch mode, the page will show you the deposit status of the deposit file you submitted, modify the deposit amount you want to send, make sure the sending amount is less than the available amount, and then click CONFIRM

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FRX8ggaiA97ISIw5ofXVO%2Fimage.png?alt=media&amp;token=3dc74a57-df70-4f54-b6fb-b8d1fb91adc1" alt=""><figcaption></figcaption></figure>

Click to CONFIRM DEPOSIT, the amount of the deposit will be the number of verifiers \* 32, and wait for the successful sending

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FWWUpJuVBsATIeBvEeLFQ%2Fimage.png?alt=media&amp;token=9ab5e7b4-c1ef-4d48-8d75-663942e6a7f4" alt=""><figcaption></figcaption></figure>

### 4.5 Upload keystore to XHash

Enter your email address and password, click the login button, and log in to XHash.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2F1IjqZdvvGIDCmYZXr5ip%2F11-xhashclient%EF%BC%88%E7%99%BB%E5%BD%95xhash%EF%BC%89.png?alt=media&amp;token=a3df7f6c-5638-4a33-97e8-e12708d45fd3" alt=""><figcaption></figcaption></figure>

Select the previously generated keystore file, enter the corresponding key password, and click Upload.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FEoEYtFyLgab4fHTTzowl%2F12-xhashclient%EF%BC%88%E4%B8%8A%E6%AC%A1keystore%E5%88%B0xhash%EF%BC%89.png?alt=media&amp;token=b9d8745f-cdd7-4ca6-86fd-9c27df87ebec" alt=""><figcaption></figcaption></figure>

Upload the keystore successfully, close the program.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FJGFB9VSI2GuIrLUGRdTu%2F13-xhashclient%EF%BC%88%E5%AE%8C%E6%88%90%EF%BC%89.png?alt=media&amp;token=242f0dd5-790c-41db-97cf-f883b2331c85" alt=""><figcaption></figcaption></figure>

## 5.Check the status of the validators

Log in to the XHash console to view the status of the validators.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FH5VrydzGWQt5YaMTTryA%2F14-xhash%EF%BC%88%E9%AA%8C%E8%AF%81%E8%80%85%E7%8A%B6%E6%80%81%EF%BC%89.png?alt=media&amp;token=d9571c2f-ddd4-48e6-9b84-7f492bbef78b" alt=""><figcaption></figcaption></figure>


# Expert Mode

## 1.Prerequisite

1. Prepare a Windows or Apple computer, which can open the following two websites:
   * <https://xhash.com>
   * <https://launchpad.ethereum.org>
   * [https://deposit.xhash.com:9000](https://deposit.xhash.com:9000/) (Option)
2. Install the MetaMask plug-in wallet, it is recommended to use the chrome browser. (Ethereum official launchpad does not support the mobile wallet)
3. Register an account with email or wallet on [xhash.com](https://xhash.com/signUp)

## 2. Generate Withdrawal Credential

Before starting staking ETH, you must generate a withdrawal credential. You can generate the withdrawal credential key pair by using the [**official tools**](https://launchpad.ethereum.org/en) created by the Ethereum foundation.

### 2.1 Generate with CLI app

a) Download the official deposit command-line interface (CLI) app [here](https://github.com/ethereum/staking-deposit-cli/releases/). Select the correct one based on your operation system.

{% hint style="warning" %}
**NOTE:** Please make sure that you are downloading from the official Ethereum Foundation GitHub account by verifying the url: **<https://github.com/ethereum/staking-deposit-cli/releases/>**
{% endhint %}

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FwKiZAmMJBhLFO32Fwo5g%2F1.png?alt=media\&token=6d95a572-1700-46c9-b666-00321e2322a1)

b) Decompress the file you just downloade&#x64;**.**

c) Use the terminal to move into the directory that contains the `deposit` executable.

d) Run the following command to generate withdrawal credential.

{% hint style="info" %}
For security, we recommend you disconnect from the internet to complete
{% endhint %}

```
./deposit new-mnemonic --num_validators 1 --chain mainnet
```

{% hint style="warning" %}
**NOTE:** Please make sure you have set `--chain mainnet`, and create **1** validator key only, otherwise the deposit will be invalid.
{% endhint %}

Follow the instructions presented to you in the terminal window. Make sure to have the password you set and the mnemonic written down in a safe place.&#x20;

{% hint style="warning" %}
**NOTE:** The mnemonic is the only way to generate your withdrawal key when you wish to withdraw the funds. Please make sure you have kept it safe, preferably offline.
{% endhint %}

e) Please find the `deposit_data.json` file in the newly-created `validator_keys` directory. This json file contains the public key of your withdrawal credential and you need to upload it when staking. Again, please note that the withdrawal credential you need to upload is a public key. XHash will not have access to your withdrawal key or ETH tokens.

### 2.2 Generate with Key Gen GUI app

We are using Wagyu Key Gen GUI app in this tutorial which is recommended in [Ethereum official launchpad](https://launchpad.ethereum.org/en/generate-keys).&#x20;

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FaHERTFl3Qrmhkqdkmu0j%2Fimage.png?alt=media\&token=be3843cc-e1bd-40b6-a52c-6089e4d2ed3e)

a) Download the Wagyu Key Gen app for your operating system [here](https://github.com/stake-house/wagyu-key-gen/releases).

[View Wagyu Key Gen audit by HashCloak](https://github.com/stake-house/wagyu-key-gen/files/7693548/Wagyu.Key.Gen.Audit.Report.pdf)

{% hint style="warning" %}
**NOTE:** Please make sure that you are downloading from the official StakeHouse GitHub account by verifying the url: **<https://github.com/stake-house/wagyu-key-gen/releases>**
{% endhint %}

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FsWHDzBrltq2lNSvVwCEq%2Fimage.png?alt=media\&token=dceb93c2-20af-4acd-b3df-6b5a2a820996)

b) Launch the Wagyu Key Gen app you just downloaded by double clicking it.

{% hint style="info" %}
For security, we recommend you disconnect from the internet to complete this step.
{% endhint %}

c) Follow the instructions presented to you in the application. You can either create new secret recovery phrase or use existing secret recovery phrase. To create new secret recovery phrase, click `CREATE NEW SECRET RECOVERY PHRASE`.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FPJ9IMnLeUlAHtzv1s5cA%2Fimage.png?alt=media\&token=a8111378-85db-47a5-ba0f-aafd8b1c4d82)

d) Select `Mainnet` and click `OK`.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FmGoah3l5OIA6FdqpPJMA%2Fimage.png?alt=media\&token=d809b06b-36f9-4522-8d1a-980703706dd6)

e) Click `CREATE` to create a secret recovery phrase.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FDpHB5BVLhIgu8YImMJ4U%2Fimage.png?alt=media\&token=ab1058ec-1c98-4cb8-af93-e1b1b6328a3c)

f) Write down the mnemonic in a safe place. Click `NEXT` to continue.

{% hint style="warning" %}
**NOTE:** The mnemonic is the only way to generate your withdrawal key when you wish to withdraw the funds. Please make sure you have kept it safe, preferably offline.
{% endhint %}

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2F6cCXBbMFQnpDM64npFig%2Fimage.png?alt=media\&token=e1df6c67-188b-417e-9dfa-249c73cceddb)

g) Type in the secret recovery phrase, then click `CHECK`.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FQVTsGaO815eN00VhYmw5%2F%E6%97%A0%E6%A0%87%E9%A2%98.png?alt=media\&token=87b6f067-0029-4b3d-9954-2183d7bd538e)

h) Set `Number of New Keys` as **`1`**, and set `Password` to create keys. Make sure to save the password you set in a safe place. Then click `NEXT`.

{% hint style="warning" %}
Please make sure you create 1 validator key only. Otherwise, the deposit will be invalid.
{% endhint %}

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FtYxE9Qo1Di5xukcl3ZDd%2Fimage.png?alt=media\&token=2760a2e6-1e9e-4834-ba5a-216300a4a3a8)

i) Retype the password you set, and click `NEXT`.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FsfyrLbTpFPQLjTy6TfqO%2Fimage.png?alt=media\&token=f77b82d1-7472-4fdc-85ee-7cf2c22c0425)

j) Choose a folder to save your keys.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FmPbjUBZ0bznmBphvCEwq%2Fimage.png?alt=media\&token=c459b87c-8793-4e77-b432-eed772f7c41f)

k) Please find the `deposit_data.json` file in the folder you choose. This file contains the withdrawal credential and you need to upload it while staking. Kindly note that the withdrawal credential you need to upload is a public key. XHash will not have the access to your withdrawal key or ETH tokens.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FkSCbFDNdsr425u8oQ5lm%2Fimage.png?alt=media\&token=bb0c850d-d26b-45ab-92a4-5b9849a9f64e)

## 3.Deposit

You can use the [official Ethereum Launchpad](https://launchpad.ethereum.org/en) to send transactions, or use [our batch deposit feature](https://deposit.xhash.com:9000/en/) to easily complete multiple deposits.

## 3.1 send transactions with [official Ethereum Launchpad](https://launchpad.ethereum.org/en)

### 3.1.1 Upload deposit data to [Official Ethereum Launchpad](https://launchpad.ethereum.org/en/overview)

Go back to the [Ethereum official launchpad](https://launchpad.ethereum.org/en) and follow the prompts to upload the deposit data page, submit the file, and click continue

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2F0V3mKGeHGWkWvB8ZCHpI%2Fimage.png?alt=media&amp;token=c155b177-8ce6-4888-99f9-355c9cada56f" alt=""><figcaption></figcaption></figure>

### 3.1.2 Link Wallet

Link the wallet, make sure your balance is enough to cover this deposit, and click continue

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FUByXF3efi5YToMAzUsQZ%2Fimage.png?alt=media&amp;token=b16282e8-0c82-4ca0-bd67-5d90e89a0dfd" alt=""><figcaption></figcaption></figure>

### 3.1.3 Send transaction

Click Confirm Deposit and wait for the transaction to succeed after the wallet confirms the transaction

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FjCBvjmxUrLN0lklunOiP%2Fimage.png?alt=media&amp;token=742186b5-8f50-49af-af67-ae2edd73b0ea" alt=""><figcaption></figcaption></figure>

## 3.2 send transactions with [our batch deposit feature](https://deposit.xhash.com:9000) to complete multiple deposits.

### 3.2.1 Upload deposit data to [our batch deposit feature](https://deposit.xhash.com:9000)

Go to the [our batch deposit feature](https://deposit.xhash.com:9000) and follow the prompts to upload the deposit data page, submit the file, and click continue

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FadpvfklOLAKmFDFu0AzF%2Fimage.png?alt=media&amp;token=ab1b5068-ee5f-4903-ac0d-8df798c77ee0" alt=""><figcaption></figcaption></figure>

## 3.2.2 Check the Summary about your Deposit\_Data

check the summary about your deposit data, and then click continue

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FqRjWhBI0K0QofMCJPV1C%2Fimage.png?alt=media&amp;token=9aa50d85-acc1-41c5-b1c5-67343da9aaad" alt=""><figcaption></figcaption></figure>

## 3.2.3 Link Wallet

Link the wallet, make sure your balance is enough to cover this deposit, and click continue

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FzIlGEuo6xemdL2WtmnYP%2Fimage.png?alt=media&amp;token=310b2a27-76ad-4787-b557-cf48058dc328" alt=""><figcaption></figcaption></figure>

## 3.2.4 Send transaction

click the 'SEND DEPOSIT' button to send transaction and wait for the transaction to succeed after the wallet confirms the transaction, in this page you can send a maximum of 100 transactions with each confirm

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FSm5sh06RpUwRc8tlbvSk%2Fimage.png?alt=media&amp;token=9ca7c5ca-b7a8-49af-bfda-a91936a39e88" alt=""><figcaption></figcaption></figure>

## 4. Staking

### 4.1 stake

a) Go to the `Staking page` of XHash and click `Get Start` to start staking.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FDQl2ZL3fQruE8IQWUFsX%2F1660187290898.jpg?alt=media\&token=9c6b7c15-67f6-490a-be36-12e601c554de)

b) Upload the `keystore.json` file generated in [Section 2](#2.-generate-withdrawal-credential), and enter the set keystore password.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FmzyzEd8U8Yu8QnucTUUB%2Fimage.png?alt=media\&token=668b4a9d-16c6-4803-a347-f0bf4ef0fcf2)

c) Carefully read and check all the terms, tick and click `Upload.`

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FDnnnfUvNt9pTCF8EJ0Mm%2Fimage.png?alt=media\&token=abbfbce3-12c1-44c5-87c1-fa9b6bc77e20)

### 4.2 Check Validator Status

Once you are done staking, click on the Staking Dashboard to see the ETH validator created.\
You can check the address, status, balance, reward, and yield of each ETH validator.

![](https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FgXt620LXUzjAMaoZ4iPS%2Fimage.png?alt=media\&token=a5c23e6e-7946-4ef5-a06e-59b07a90ea15)

##


# No Mnemonic Staking

Select non-custodial staking in [**XHash**](https://xhash.com), select no validator keys, and then stake multiple ETH of 32.

**Step 1:** Select non-custodial staking and click "Stake now".

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FbgpoyxhdbIaphPLhHB32%2Fimage.png?alt=media&amp;token=c8ec2487-00ea-47bd-8add-c1e490ed8374" alt=""><figcaption></figcaption></figure>

**Step 2:** Click "NO", select no validator keys.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FleGkktFMewE2NGLpQymO%2Fimage.png?alt=media&amp;token=5efbf2a1-aacb-46b6-bfda-2c28aacfc6e4" alt=""><figcaption></figcaption></figure>

**Step 3:** On the staking page, after "**CONNECT WALLET**", enter the parameters, and click "**STAKE**".

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FTR7dGhJBLSuxFGGJGTyK%2Fimage.png?alt=media&amp;token=72154c3a-fb4a-48f0-99b9-c19504bfd997" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The address of the sending transaction contract is XHash batch deposit contract：[0xa86341E5C278443c8648be44110167E1bbD9Cba6](https://etherscan.io/address/0xa86341E5C278443c8648be44110167E1bbD9Cba6).
{% endhint %}


# Restaking Guides

## What is Restaking?&#x20;

Restaking enables staked ETH to be used as cryptoeconomic security for protocols other than Ethereum, in exchange for protocol fees and rewards. Currently the most popular restaking project is EigenLayer, XHash support native restaking on EigenLayer to get their Restaked Point.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2F3hWigD9iZlbQzhzhjge8%2Fimage_2024-01-30_17-53-34.png?alt=media&amp;token=6e7be0ee-e9df-498f-9d81-d11052832aaa" alt=""><figcaption></figcaption></figure>


# EigenLayer

XHash now supports earning restaking points by participating in EigenLayer's native restaking, with the option to earn additional SSV rewards if you choose the SSV option. One staking, tripple rewards.

## 1.Why join EigenLayer from XHash?&#x20;

* **Quick and convenient**: Just two steps, you can create EigenPod on EigenLayer's website then create validators on XHash very quickly by our one-step stake, you don't need to record annoying mnemonics!
* **More profit**: You can get SSV's reward in addition to EigenLayer Restaked Point. One stake, three rewards!&#x20;
* **In-time**: EigenLayer suspend Liquid Restakeing sometimes, but native restaking is uncapped. Join us if you want to get Restaked Point right now!

## 2.What is EigenLayer?&#x20;

EigenLayer is a protocol built on Ethereum that introduces restaking, a new primitive in cryptoeconomic security. This primitive enables the reuse of ETH on the consensus layer. Users that stake ETH natively or with a liquid staking token (LST) can opt-in to EigenLayer smart contracts to restake their ETH or LST and extend cryptoeconomic security to additional applications on the network to earn additional rewards. <https://www.eigenlayer.xyz/>

## 3.What's EigenLayer's Restaked Point?&#x20;

A measure of your total EigenLayer restaking contribution. Based on amount of ETH staked over time, in units of ETH per second. For a precise definition of how Restaking Points are calculated, please refer to the document below：&#x20;

<https://docs.eigenlayer.xyz/restaking-guides/restaking-user-guide/restaked-points>


# Create EigenPod

An [EigenPod](https://github.com/Layr-Labs/eigenlayer-contracts/blob/master/docs/core/EigenPodManager.md) is a smart contract managed by users, designed to facilitate the EigenLayer protocol in monitoring and managing balance and withdrawal statuses. Please review the following considerations when planning your EigenPod and validator operations:

* You may point any number of validators to a single EigenPod.
* An Ethereum address can only deploy a single EigenPod.
* The address that deploys an EigenPod becomes the owner of the contract and gains permission for restaking and withdrawal operations.
* Ownership of an EigenPod cannot be transferred.

**Step 1:** Open the [EigenLayer App](http://app.eigenlayer.xyz/) and connect your Web3 wallet, making sure you are connected to Ethereum mainnet.

**Step 2:** Click **Create EigenPod**:

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FudTWfkK2CdzgI9wIU5WL%2Fimage.png?alt=media&amp;token=1b8c8f58-2611-49b2-ae2d-c779aa41499c" alt=""><figcaption></figcaption></figure>

If successful, you will receive a confirmation. Observe that your EigenPod address is available on the right portion of the screen.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FBpHX1AjfzmeEyAMGibP7%2Fimage.png?alt=media&amp;token=4da76186-7767-4bce-960b-2cbfe223063d" alt=""><figcaption></figcaption></figure>

**Step 3:** Copy this address for future use setting your validator's withdrawal credentials.

<div align="left"><figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FIcbqkY6DA5JTEzlK93P4%2Fimage.png?alt=media&amp;token=ea844ea8-fd75-4711-9d18-6d94d0b92d18" alt="" width="558"><figcaption></figcaption></figure></div>

{% hint style="info" %}
This address is responsible for all subsequent restaking and withdrawal activities associated with that EigenPod.
{% endhint %}


# Create Validator on XHash

Select non-custodial staking in [**XHash**](https://xhash.com), select no validator keys, and then stake multiple ETH of 32, enter the EigenPod address as the withdrawal address, and connect the wallet to create.

**Step 1:** Select non-custodial staking and click "Stake now".

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FbgpoyxhdbIaphPLhHB32%2Fimage.png?alt=media&amp;token=c8ec2487-00ea-47bd-8add-c1e490ed8374" alt=""><figcaption></figcaption></figure>

**Step 2:** Click "NO", select no validator keys.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FleGkktFMewE2NGLpQymO%2Fimage.png?alt=media&amp;token=5efbf2a1-aacb-46b6-bfda-2c28aacfc6e4" alt=""><figcaption></figcaption></figure>

**Step 3:** On the staking page, after "**CONNECT WALLET**", enter the parameters, set the withdrawal address to the EigenPod address created at the EigenLayer, and click "**STAKE**".

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FTR7dGhJBLSuxFGGJGTyK%2Fimage.png?alt=media&amp;token=72154c3a-fb4a-48f0-99b9-c19504bfd997" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The withdrawal address must be set to the EigenPod address created in EigenLayer. Otherwise, you cannot participate in EigenLayer restaking.

\
The address of the sending transaction contract is XHash batch deposit contract：[0xa86341E5C278443c8648be44110167E1bbD9Cba6](https://etherscan.io/address/0xa86341E5C278443c8648be44110167E1bbD9Cba6).
{% endhint %}


# Withdraw from EigenLayer

There are two kinds of withdrawals from native restaking in EigenLayer:

* **Partial** withdrawals: balances in excess of 32 ETH (earned rewards) are withdrawn to an Ethereum address. The validator will continue to be a part of the beacon chain and validate as expected.
* **Full** withdrawals: users have the ability to cease their staking activities entirely. By choosing this option, they initiate the process of unlocking the entire balance held by their validator, including both the initial stake and any accumulated rewards. This action effectively ends their validator's participation in the network.


# Partial Withdrawals

{% hint style="info" %}
Due to how withdrawals from Ethereum are designed, users can only initiate one partial withdrawal per[ sequential sweep](https://ethereum.org/en/staking/withdrawals/#validator-sweeping) of all validators (which takes approximately 7-8 days).

All funds unstaked from EigenLayer go through a 7-day escrow period before being able to be withdrawn. Thus after you initiate your unstake, you must wait 7-days before being able to withdraw your assets.
{% endhint %}

**Step 1:** Unstake - click **Unstake** to queue the withdrawal and initiate the escrow period.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FfvNESOY8vejlJ5toD7jS%2Fimage.png?alt=media&amp;token=41237a12-8eee-4b77-886b-6e805cbf4673" alt=""><figcaption></figcaption></figure>

If successful, you should receive a confirmation. Once the transaction confirms, you should see your EigenPod balance move to *Unstake pending:*

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FptFHebUtCCN5UDZgoXe1%2Fimage.png?alt=media&amp;token=bad4ed06-191c-4815-95bc-e19cb17f582e" alt=""><figcaption></figcaption></figure>

**Step 2:** Wait for the escrow period to complete.

**Step 3:** Withdraw - upon completion of the escrow period. Click **Withdraw** to transfer the funds to your wallet.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FohdhD8PZ5QWKQNCShYbJ%2Fimage.png?alt=media&amp;token=32d322e7-81ac-419d-9e4c-ad10d28da91c" alt=""><figcaption></figcaption></figure>

If successful, you should receive a confirmation.


# Full Withdrawals

{% hint style="info" %}
All funds unstaked from EigenLayer Mainnet go through a 7-day escrow period before being able to be withdrawn. Thus after you initiate your unstake, you must wait 7-days before being able to withdraw your assets.
{% endhint %}

**Step 1:** Exit your validator from [**XHash**](Https://xhash.com). On the XHash **dashboard** page, select the validator from the Validators list and click "**Exit**" to exit the validator.

<figure><img src="https://2501310327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlDSnyFNzAHvOoiqX79Bd%2Fuploads%2FRrB7a2JlSLiMY0EdMQUJ%2Fimage.png?alt=media&amp;token=326f7d52-8f1c-4ab5-a6a0-228754e95aef" alt=""><figcaption></figcaption></figure>

**Step 2:** Wait for your validator to fully exit the validator queue. A full exit from the validator queue is required, which can take multiple days. Please refer to [validatorqueue.com](https://www.validatorqueue.com/) for the latest expected timing.

Once the validator withdrawal from Ethereum is completed, your staked ETH balance is credited to your EigenPod address and can be viewed on the EigenLayer app.

<figure><img src="https://docs.eigenlayer.xyz/assets/images/native-full-withdrawal1-f5060efa9aa60cf0e57b8154478b1029.png" alt=""><figcaption></figcaption></figure>

**Step 3:** Unstake - click **Unstake** to initiate the 7-day escrow period. Once the transaction confirms, you should see your EigenPod balance move to *Unstake pending*

![withdrawal-unstake](https://docs.eigenlayer.xyz/assets/images/native-full-withdrawal2-3c1d23243b95f0e30fd25c1fe8d5b785.png)

**Step 4:** Wait for the 7-day escrow period to complete.

**Step 5:** Withdraw your ETH. Click **Withdraw** to transfer the ETH to your wallet

![pending](https://docs.eigenlayer.xyz/assets/images/native-full-withdrawal3-13a2d62e14b2ec5da3cea526cbe3b53d.png)

If successful, you will receive a confirmation.


# Staking API

## Preparation <a href="#preparation" id="preparation"></a>

Before you use API, you need to login the website to create API Key with proper permissions.

You can manage your API Keys [here](https://www.xhash.com/usercenter).

Please remember below information after creation:

* `Access Key`: It is used in API request
* `Private Key`: It is used to generate the signature (<mark style="color:red;">only visible once after creation</mark>)

{% hint style="info" %}
Every user can create at most 10 API Keys，every API Key can bind maximum 10 IP address.
{% endhint %}

## Interface URL

<https://stakingapi.xhash.com:18000>

## Authentication <a href="#id-138a6766" id="id-138a6766"></a>

* All interfaces are requested using the private key signature and public key verification
* The request header contains the following signature information:

```
access_key: The 'accessKey' in your API Key
sign: The value after signed, it uses MD5withRSA, MD5withRSA(requestBody+timestamp), requestBody equal "" if no request param。
timestamp: The time stamp（ms）
```

* All interfaces use **post** requests with **request parameters** placed in requestBody

<pre><code>such as : /api/v1/xhash/getUserDailyIncome
<strong>header：
</strong>"access_key"："50CEA00402A84BFF9B47CF44A947DA0B"
"sign"："sEm3E4qD8fD7mb54SxJLKajf28gItAkHNjk44QJgrjRqh9XQX6xNMdhsKXSAabcfQ77Mpp/PI6i9hW1XPnfkrLKDlAeaTMXKWxQaRKryzB99p782Re0mRoWFW1iZcvaUFzgb3aY3Oj7/xD0Qz6Y+cg/SZGM6KcTC2IL3PosoWPk="
"timestamp"："1666854104527"

<strong>requestBody：
</strong><strong>{
</strong>    "pageNum": 1,
    "pageSetNum": 10
}
</code></pre>

* Response Format

```
  {
      "code": "",
      "data": object,
      "msg": ""
  }
  
  code="200" is success, other is fail
```

## Example

{% tabs %}
{% tab title="Java" %}
{% file src="/files/s9UUXFSxNho5erd79bgE" %}

```
String accessKey = "A95B2CFA7B1940B799EFCE792AD...";
String privateKey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMQzb3GI8fTGUUXaZsZxnLBWnihO9iSua4z7v9tY...";
String url = "https://stakingapi.xhash.com:18000/api/v1/xhash/getUserDailyIncome";

Map<String, Object> requestBody = new HashMap<>();
requestBody.put("pageNum", 1);
requestBody.put("pageSetNum", 10);

String content = new GsonBuilder().serializeNulls().create().toJson(requestBody);

long timestamp = System.currentTimeMillis();
System.out.println(content + timestamp);
String sign = RSACoder.sign((content + timestamp).getBytes(), privateKey);

HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("access_key",accessKey);
httpHeaders.add("timestamp",timestamp + "");
httpHeaders.add("sign",sign);

HttpEntity<String> httpEntity = new HttpEntity<>(content, httpHeaders);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> result = restTemplate.postForEntity(url, httpEntity, String.class);
System.out.println(result);
```

{% endtab %}

{% tab title="Python" %}

```
import requests
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import MD5
import base64
import time
import calendar

url = "https://stakingapi.xhash.com:18000/api/v1/xhash/getUserDailyIncome"
accessKey = "0EDF9F7653344B10808972B287832727..."
privatekey="MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN7ALyd..."
datajson = '{"pageNum":1,"pageSetNum":10}'
timestamp = str(int(round(calendar.timegm(time.gmtime())*1000)))
data = datajson + (timestamp)

private_keyBytes = base64.b64decode(privatekey)
prikey = RSA.importKey(private_keyBytes)
signer = PKCS1_v1_5.new(prikey)
hash_obj = MD5.new(data.encode('utf-8'))
signtrue = base64.b64encode(signer.sign(hash_obj))
sign = str(signtrue)[2:-1]

headers = {
  'access_key': accessKey,
  'sign': sign,
  'timestamp': timestamp
}
result = requests.post(url, headers=headers, data=datajson)
print(result.text)
```

{% endtab %}

{% tab title="Node" %}

```
const https = require('https');
const crypto = require('crypto');
const accessKey = "0EDF9F7653344B10808972B28C..."
const privateKey = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN7ALyd8Bkx..."

const signer = (json) => {
    const privateKeys = "-----BEGIN PRIVATE KEY-----\n" + privateKey + "\n-----END PRIVATE KEY-----"
    const sign = crypto.createSign('md5');
    sign.update(json);
    return sign.sign(privateKeys, 'base64');
}

const postData = JSON.stringify({
    "pageNum": 1,
    "pageSetNum": 10
})

const timestamp = new Date().valueOf()
const dataJsonStr = `${postData}${timestamp}`
const sign = signer(dataJsonStr)
const options = {
    method: 'POST',
    host: 'stakingapi.xhash.com',
    port: 18000,
    path: '/api/v1/xhash/getUserDailyIncome',
    headers: {
        'access_key': accessKey,
        'sign': sign,
        'timestamp': timestamp
    }
};

var req = https.request(options, (res) => {
    res.setEncoding('utf8');
    res.on('data', (chunk) => {
        console.log(`${chunk}`);
    });
});

req.write(postData);
req.end();
```

{% endtab %}
{% endtabs %}

## Interface details

### Get user balance and unpaid amount

**HTTP Request**

`POST /api/v1/xhash/getUserStatus`

**RequestBody**

No param

**Response**

<table><thead><tr><th></th><th width="108"></th><th width="252"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td><td><strong>remark</strong></td></tr><tr><td>clBalance</td><td>int</td><td>balance of consensus-layer</td><td>Gwei</td></tr><tr><td>waitPayment</td><td>float</td><td>balance of execution-layer</td><td>Gwei</td></tr></tbody></table>

**Example**

```
{
  "code": "200",
  "data": {
    "clBalance": 1446286721091,
    "waitPayment": 1596525011
  },
  "msg": "Success"
}
```

### Get user detail status

**HTTP request**

`POST /api/v1/xhash/getUserDetailStatus`

**RequestBody**\
No param

**Response**

<table><thead><tr><th width="241"></th><th width="108"></th><th width="252"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td><td><strong>remark</strong></td></tr><tr><td>validatorsOnline</td><td>int</td><td>validators num online</td><td></td></tr><tr><td>validatorsOffline</td><td>int</td><td>validators num offline</td><td></td></tr><tr><td>totalBalance</td><td>string</td><td>balance of consensus-layer</td><td>Gwei</td></tr><tr><td>totalChange</td><td>string</td><td>total reward (Execution+consensus)</td><td>Gwei</td></tr><tr><td>hoursIncome24</td><td>string</td><td><p>24 hour reward</p><p>(Execution+consensus)</p></td><td>Gwei</td></tr><tr><td>partailWithdrawalsAmount</td><td>number</td><td>consensus withdrawals amount</td><td>Gwei</td></tr><tr><td>waitPayment</td><td>string</td><td>execution-layer wait payment</td><td>Gwei</td></tr><tr><td>pendingPayment</td><td>string</td><td>execution-layer pending payment</td><td>Gwei</td></tr><tr><td>paid</td><td>string</td><td>execution-layer paid</td><td>Gwei</td></tr><tr><td>avgRealApr</td><td>float</td><td>average apr of all validators</td><td></td></tr></tbody></table>

**Example**

```
{
    "code": "200",
    "data": {
        "validatorsOnline": 45,
        "validatorsOffline": 0,
        "totalBalance": "1440081374281",
        "totalChange": "48615375055.435027176",
        "hoursIncome24": "236051566.84745468",
        "partailWithdrawalsAmount": 35685091263,
        "waitPayment": "400428103.199571345",
        "pendingPayment": "0",
        "paid": "13441757945.295420862",
        "avgRealApr": 0.05681605041
    },
    "msg": "Success"
}
```

###

### Get user daily Income

**HTTP Request**

`POST /api/v1/xhash/getUserDailyIncome`

**RequestBody**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="117"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Required</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>Number of pages [1,...]</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>Number each page [10,100]</td></tr></tbody></table>

**Response**

<table><thead><tr><th></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td><td><strong>remark</strong></td></tr><tr><td>userId</td><td>int</td><td>user ID</td><td></td></tr><tr><td>totalReward</td><td>float</td><td>total reward</td><td>Eth</td></tr><tr><td>clReward</td><td>float</td><td>consensus-layer reward</td><td>Eth</td></tr><tr><td>elReward</td><td>float</td><td>execution-layer reward</td><td>Eth</td></tr><tr><td>mevReward</td><td>float</td><td>mev reward of execution-layer</td><td>Eth</td></tr><tr><td>txReward</td><td>float</td><td>txfee reward of execution-layer</td><td>Eth</td></tr><tr><td>rewardDay</td><td>int</td><td>timestamp of reward day</td><td>second</td></tr><tr><td>validatorNum</td><td>int</td><td>number of validators generating revenue that day</td><td></td></tr><tr><td>total</td><td>int</td><td>number of all rewards</td><td></td></tr></tbody></table>

**Example**

```
{
  "code": "200",
  "data": {
    "pageNum": 1,
    "pageData": [
      {
        "userId": 123456,
        "totalReward": 0.15852195658793655,
        "clReward": 0.142707974,
        "elReward": 0.01581398258793658,
        "mevReward": 0.001352162267224239,
        "txReward": 0.014461820320712356,
        "rewardDay": 1666569600,
        "validatorNum": 2
      },
      ...
      ...
    ],
    "total": 27
  },
  "msg": "Success"
}
```

### Get user payment history

**HTTP Request**

`POST /api/v1/xhash/getUserPaymentHistory`

**RequestBody**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="117"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Required</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>Number of pages [1,...]</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>Number each page [10,100]</td></tr></tbody></table>

**Response**

<table><thead><tr><th></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td><td><strong>remark</strong></td></tr><tr><td>userId</td><td>int</td><td>user ID</td><td></td></tr><tr><td>realAmount</td><td>float</td><td>payment amount</td><td>Eth</td></tr><tr><td>chainAmount</td><td>float</td><td>execution-layer amount on chain</td><td>Eth</td></tr><tr><td>withHoldTxFee</td><td>float</td><td>tx fee withholding</td><td>Eth</td></tr><tr><td>realTxFee</td><td>float</td><td>tx fee on chain</td><td>Eth</td></tr><tr><td>retained</td><td>float</td><td>tx feen retained</td><td>Eth</td></tr><tr><td>txHash</td><td>string</td><td>tx hash on chain</td><td></td></tr><tr><td>status</td><td>int</td><td>payment status</td><td>0:paying, 1:finished</td></tr><tr><td>chainTime</td><td>int </td><td>the time on chain</td><td></td></tr><tr><td>updateTime</td><td>int </td><td>payment update time</td><td></td></tr><tr><td>total</td><td>int</td><td>number of all rewards</td><td></td></tr></tbody></table>

**Example**

```
{
  "code": "200",
  "data": {
    "pageNum": 1,
    "pageData": [
      {
        "userId": 123456,
        "realAmount": 0.148897612,
        "chainAmount": 0,
        "withHoldTxFee": 0.148897612,
        "realTxFee": 0,
        "retained": 0,
        "txHash": "",
        "status": 0,
        "chainTime": 0,
        "updateTime": 1666842847
      }
    ],
    "total": 1
  },
  "msg": "Success"
}
```

### Get user validator list

**HTTP Request**

`POST /api/v1/xhash/getUserValidatorList`

**RequestBody**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="103"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Required</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>Number of pages [1,...]</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>Number each page [10,100]</td></tr></tbody></table>

**Response**

<table><thead><tr><th width="211"></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td><td><strong>remark</strong></td></tr><tr><td>id</td><td>int</td><td>sequence id</td><td></td></tr><tr><td>userId</td><td>int</td><td>user ID</td><td></td></tr><tr><td>validatorIndex</td><td>int</td><td>validator index</td><td></td></tr><tr><td>validatorPublicKey</td><td>string</td><td>validator publicKey</td><td></td></tr><tr><td>totalIncome</td><td>int</td><td>consensus-layer income</td><td>Gwei</td></tr><tr><td>effectiveBalance</td><td>int</td><td>consensus-layer effective balance</td><td>Gwei</td></tr><tr><td>finalizedBalance</td><td>int</td><td>consensus-layer finalized balance </td><td>Gwei</td></tr><tr><td>currentBalance</td><td>int</td><td>consensus-layer balance </td><td>Gwei</td></tr><tr><td>currentEffectiveness</td><td>string</td><td>effectiveness</td><td></td></tr><tr><td>apr</td><td>float</td><td>apr by 7 day</td><td></td></tr><tr><td>node_status</td><td>string</td><td>validator status in xhash</td><td></td></tr><tr><td>chain_status</td><td>string</td><td>consensus-layer status</td><td></td></tr><tr><td>created_time</td><td></td><td>timestamp in xhash</td><td>second</td></tr><tr><td>total</td><td>int</td><td>number of all rewards</td><td></td></tr></tbody></table>

**Example**

```
{
  "code": "200",
  "data": {
    "pageNum": 1,
    "pageData": [
      {
        "id": 45,
        "userId": 123456,
        "validatorIndex": 429489,
        "validatorPublicKey": "0x827b58e886b0024022120a549a7a50bc2b44b51e0d09663d5f543c17fba3f2ec3faf30126979241d0fd1297838de74d8",
        "totalIncome": 118681206,
        "effectiveBalance": 32000000000,
        "finalizedBalance": 32118648446,
        "currentBalance": 32118648446,
        "currentEffectiveness": 99.01,
        "apr": 0.03623521,
        "node_status": "Active",
        "chain_status": "Active",
        "created_time": 1663310642
      },
      ...
      ...
    ],
    "total": 45
  },
  "msg": "Success"
}
```

### Get consensus-layer withdrawals

**HTTP Request**

`POST /api/v1/xhash/getUserPartailWithdrawals`

**RequestBody**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="103"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Required</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>Number of pages [1,...]</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>Number each page [10,100]</td></tr></tbody></table>

**Response**

<table><thead><tr><th width="211"></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td><td><strong>remark</strong></td></tr><tr><td>id</td><td>int</td><td>sequence id</td><td></td></tr><tr><td>userId</td><td>int</td><td>userId</td><td></td></tr><tr><td>validatorIndex</td><td>int</td><td>validator index</td><td></td></tr><tr><td>validatorPublicKey</td><td>string</td><td>validator publicKey</td><td></td></tr><tr><td>blockSlot</td><td>int</td><td>slot</td><td></td></tr><tr><td>withdrawalIndex</td><td>int</td><td>withdrawal Index</td><td></td></tr><tr><td>address</td><td>string</td><td>withdrawal address</td><td></td></tr><tr><td>amount</td><td>float</td><td>withdrawal amount</td><td>eth</td></tr><tr><td>createdTime</td><td>long</td><td>timestamp,second</td><td></td></tr></tbody></table>

**Example**

```
{
    "code": "200",
    "data": {
        "pageNum": 1,
        "pageData": [
            {
                "id": 0,
                "userId": 101527,
                "validatorIndex": 429481,
                "validatorPublicKey": "0xac34188ca2c6ec29e40534229698d38fc733908c34eeecd77df0f477481344b10fcebbabbb9cc233a09390d1afb6121d",
                "blockSlot": 6281691,
                "withdrawalIndex": 1122084,
                "address": "0x0708f87a089a91c65d48721aa941084648562287",
                "amount": "0.012279707",
                "createdTime": 1682204315
            },
            ...
            ...
        ],
        "total": 135
    },
    "msg": "Success"
}
```

##

## Error Code

<table><thead><tr><th width="284"></th><th></th></tr></thead><tbody><tr><td><strong>code</strong></td><td><strong>message</strong></td></tr><tr><td>200</td><td>success</td></tr><tr><td>400</td><td>Param error</td></tr><tr><td>401</td><td>Authentication failed</td></tr><tr><td>403</td><td>Ip not on whitelist</td></tr><tr><td>404</td><td>Path Not Found</td></tr><tr><td>405</td><td>Request timestamp expire</td></tr><tr><td>429</td><td>Requests has exceeded the per second limit</td></tr><tr><td>500</td><td>Server error</td></tr><tr><td>4001</td><td>Select user balance failed</td></tr><tr><td>4002</td><td>Page invalid</td></tr><tr><td>4003</td><td>Select user reward failed</td></tr><tr><td>4004</td><td>Select user payments history failed</td></tr><tr><td>4005</td><td>Select validator list failed</td></tr></tbody></table>


# Staking  Q\&A

<details>

<summary><mark style="color:blue;">What is Ethereum upgrade(ETH2.0)?</mark></summary>

**The Ethereum roadmap involves interconnected protocol upgrades that will make the network more scalable, more secure, and more sustainable. The first step is to change Ethereum’s consensus from PoW to PoS, which means it will no longer be possible to use graphics card GPUs or ASIC chip mining machines for PoW mining.**

</details>

<details>

<summary><mark style="color:blue;">What is The Merge?</mark></summary>

**The beacon chain (Consensus layer) shipped on December 1, 2020, it doesn’t change the Ethereum you use today, they execute in parallel, The Merge means Beacon chain and current ETH PoW chain will work together to create blocks, and also means Ethereum change it’s consensus from PoW to PoS.**

</details>

<details>

<summary><mark style="color:blue;">When will Ethereum upgrade launch(The Merge)?</mark></summary>

**According to Ethereum Foundation’s blog, it will happen between 2022/09/10 and 2022/09/20, the most possible date is 2022/09/15.**

</details>

<details>

<summary><mark style="color:blue;">What is Staking?</mark></summary>

**Staking is a way of earning rewards for holding certain cryptocurrencies, for ethereum, you need to stake 32 ETH to be a validator and lock it up a period, and continue to get pledge income.**

</details>

<details>

<summary><mark style="color:blue;">How can I join Staking and get the reward?</mark></summary>

**If an individual wants to participate in the stake and obtain income, he needs to stake 32 ETH on the stake launch pad of the official Ethereum website to create a validator, and then he needs to purchase a series of hardware that meets the requirements, start validator program, consensus layer node, and execution layer nodes on it, are must guarantee to be online 7\*24 hours and need to be upgraded to the latest version on time.**

</details>

<details>

<summary><mark style="color:blue;">Why XHash is the best choice?</mark></summary>

**Individual participation in staking requires a lot of time to learn the knowledge of Ethereum staking, purchase hardware, build, maintain and upgrade software, which is very labor-intensive and does not necessarily guarantee income. In XHash, you can create your validator node in just a few simple steps, and the rest work will be done by XHash's professional team, users only need to sit back and receive the benefits.**

</details>

<details>

<summary><mark style="color:blue;">What is Non-Custodial Staking?</mark></summary>

**XHash provides Non-Custodial staking service, which means customers’ ETH are controlled by their wallets, XHash just has the validate key but can’t access your ETH, which ensures maximum security.**

</details>

<details>

<summary><mark style="color:blue;">How much can I earn?</mark></summary>

**The staking income is represented by APR(annualized rate of return), APR depends on the percentage of the total supply of ETH staked on the network, currently, it’s 4.3%. However, at present, the validator only obtains the revenue from the beacon chain. After the merge the validator will obtain the additional revenue from the execution layer, it’s expected to be 7% if the staking percentage doesn’t change.**

</details>

<details>

<summary><mark style="color:blue;">When can I withdraw my fund?</mark></summary>

**In order to safely transfer the network to PoS, Ethereum currently does not have the function of withdrawal, and it has to wait for another hard fork(Shanghai) after the merge. The merge is expected to happen in mid-September 2022, but the time for the Shanghai hard fork is still uncertain. It may not happen until 6-12 months after the merge, which means that your staked Ethereum will continue to be locked until Ethereum opens the withdrawal function.**

</details>

<details>

<summary><mark style="color:blue;">What are the risks of Staking?</mark></summary>

**The main risks of staking are penalties that result in a loss of funds, there are two kinds of penalties, one is the network will penalize validators who are offline for a sustained amount of time, this penalty is tiny, for example, if you obtain 0.001 ETH per hour for online, then you will be punished for 0.001 ETH per hour for offline. Another is the network will slash validators that act maliciously, any validator found to have broken these rules will be slashed and ejected from the network. Slashing means that a significant part of the validator’s stake is removed: up to the whole stake of 32 ETH in the worst case. Validator software and staking providers will have built-in protection against getting slashed accidentally. Slashing should only affect validators who misbehave deliberately.**

**XHash has the world’s leading Ethereum security infrastructure, which can guarantee you the greatest degree of avoid from punishment.**

</details>


# 歡迎來到 XHash

本文檔包含的資源可用於了解有關 XHash 核心產品的更多信息、了解如何構建 web3 應用程序、探索開發人員指南以及查看我們的 API 參考。

### *點擊此處免費訪問* [*XHash*](https://www.xhash.com/)

## :books:指南: 直接進入

XHash簡介

{% content-ref url="/pages/wih7Au5RWKJfDEEru5ta" %}
[什麼是XHash?](/cn/jie-shao/shen-mo-shi-xhash)
{% endcontent-ref %}

免費註冊以使用 XHash 全套產品。註冊免費使用。

{% content-ref url="/pages/B4zWb4s0RDEqJvDouuJX" %}
[註冊免費使用](/cn/jie-shao/zhu-ce-mian-fei-shi-yong)
{% endcontent-ref %}

了解如何在區塊鏈上進行質押以獲得質押獎勵。

{% content-ref url="/pages/1IcIgHToTiCcyv1DtDxU" %}
[非託管質押](/cn/staking/fei-tuo-guan-zhi-ya)
{% endcontent-ref %}


# 什麼是XHash?

## :blue\_book:XHash Overview

XHash 是 Web3.0 基礎設施提供商，我們的愿景是構建一個穩定、可靠、安全的區塊鏈基礎設施，提供 POS 質押服務和多鏈 API 以改善 Web3.0 開發與我們的客戶。

XHash 建立了一個全新的非託管 ETH2.0 質押池，為有興趣成為 ETH 驗證者的客戶提供服務。

{% hint style="info" %}
**什麼是 Web3**：Web 3 是下一代互聯網。Web 3，或分散式網絡，承諾讓互聯網更易於訪問、更透明和以用戶為中心。Web 3 的用戶將完全控制他們的帳戶、數據、交易和身份。今天，Web 3 的願景正在成為現實，它的基礎是由全球成千上萬的開發人員和設計人員構建的。
{% endhint %}

## :dart:XHash 提供的服務

* 非託管 ETH Staking 平台
* 自定義 Staking API 服務
* 24/7 支持

#### 還沒有賬戶? 點擊此處免費訪問[*XHash*](https://www.xhash.com/)


# 註冊免費使用

### 1. 使用錢包註冊

1.1 在登錄頁點擊 `MetaMask或WalletConnect`

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2Ft2MBgLGxEfLl4X2kyJwq%2F%E7%99%BB%E5%BD%95%E9%A1%B5%EF%BC%88%E9%92%B1%E5%8C%85%E7%99%BB%E5%BD%95%EF%BC%89.png?alt=media&amp;token=9b986f89-febf-43eb-bf47-7fa2428c85c8" alt=""><figcaption></figcaption></figure>

1.2 登錄MetaMask錢包或者使用支持WalletConnect的錢包掃碼登錄。

### 2.使用電子郵件進行註冊

2.1 在登錄頁面點擊 `註冊` 按鈕

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F5QZPjajKBF27uB3eBquA%2F%E7%99%BB%E5%BD%95%E9%A1%B5%EF%BC%88%E6%B3%A8%E5%86%8C%EF%BC%89.png?alt=media&amp;token=d1126f60-4f79-47c4-b99d-989700304433" alt=""><figcaption></figcaption></figure>

2.2 輸入您的郵箱，獲取並輸入驗證碼。設置密碼必須至少為8個字符，包括字母和數字。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FnMgvs4yXgL6oqEV06NDC%2F%E6%B3%A8%E5%86%8C%E9%A1%B5%E9%9D%A2.png?alt=media&amp;token=9f9bd15a-09be-4065-8770-f55ba0d0b10c" alt=""><figcaption></figcaption></figure>

現在，您可以使用您的電子郵箱登錄XHash平台了。


# 非託管質押

## 1. 概述

質押是指運行一個連接到互聯網的以太坊節點，並存入 32 個以太幣以激活一個驗證者，使你有能力直接參與網絡共識。

一個以太坊節點既包括執行層 (EL) 客戶端，也包括共識層 (CL) 客戶端。 這些客戶端是一套共同工作的軟件，擁有一套有效的簽名密鑰，以驗證交易和區塊、證明鏈頭的正確性、彙總認證和提交區塊。

個人參與質押並獲得收益，需要在以太坊官網的質押啟動板質押 32 ETH 來創建驗者，然後需要購買一系列符合要求的硬件，開始其上的驗證器程序、共識層節點、執行層節點必須保證7\*24小時在線，並需要按時升級到最新版本。

個人參與 Staking 需要大量時間來學習以太坊 Staking 的知識，購買硬件，搭建、維護和升級軟件，非常耗費人力，也不一定能保證收益。在XHash中，您只需幾個簡單的步驟即可創建您的驗證者節點，其餘工作將由XHash的專業團隊完成，用戶只需坐下來享受收益。

## 2.XHash質押方法

### 2.1 快捷模式

用戶可以從XHash官方下載 XHash快速質押程序。通過該程序，用戶可以一站式生成驗證者祕鑰對，完成質押存款，上傳keystore文件到XHash，開啓質押。

詳細說明見 [**快捷模式**](/cn/staking/fei-tuo-guan-zhi-ya/kuai-jie-mo-shi)**。**

### 2.2 專家模式

用戶按以太坊官方質押啓動板說明，分步驟創建驗證者，完成質押存款。最後在XHash官網將驗證者keystore上傳，開啓質押。

詳情說明見 [**專家模式**](/cn/staking/fei-tuo-guan-zhi-ya/zhuan-jia-mo-shi)。

### 2.3 無需助記詞質押

基於驗證者提幣地址一旦設定就無法更改的原則，用戶可以不用自己通過助記詞創建驗證者，使用Xhash無助記詞質押功能，輸入質押ETH數量及提幣地址即可完成質押。

詳情說明見 [**無需助記詞質押**](#id-2.3-wu-xu-zhu-ji-ci-zhi-ya)。


# 快捷模式

## 1.前置準備

1. 準備一臺Windows或蘋果電腦，能打開下面兩個網站：
   * <https://xhash.com>
   * <https://etherscan.io>
2. 在[xhash.com](https://xhash.com/signUp)上用郵箱注冊一個賬戶
3. 在手機上安裝一款支持WallectConnect的錢包，比如MetaMask，imToken

{% hint style="info" %}
點擊[這裏](https://github.com/xhash-com/xhash-auto-staking-client#supported-wallet)查看 [xhash-auto-staking-client](https://github.com/xhash-com/xhash-auto-staking-client) 支持的錢包APP列表
{% endhint %}

## 2.XHash客戶端概述&#x20;

[**`xhash-auto-staking-client`**](https://github.com/xhash-com/xhash-auto-staking-client.git)是xhash在以太坊官方推薦的驗證者密鑰對生成器[`wagyu-key-gen`](https://github.com/stake-house/wagyu-key-gen)基礎上開發的eth快速質押程序。該程序完全開源，用戶可以在github網站上查看及下載運行。

## 3.下載地址

github：<https://github.com/xhash-com/xhash-auto-staking-client/releases/tag/v1.2.1>

## 4.使用方法

### 4.1 創建新的助記詞或導入已有助記詞

雙擊打開下載的程序，選擇`創建新助記詞`或`導入現有的助記詞。`

{% hint style="info" %}
為安全起見，我們建議您斷開互聯網連接以完成此步驟。
{% endhint %}

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F3bLxK4sYcHWhYNWK4OPm%2Fxhash%20client%EF%BC%88%E9%A6%96%E9%A1%B5%EF%BC%89.png?alt=media&amp;token=f0c5631c-a526-4a99-8a7e-611af17a31ff" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FBSiPAG3CjYYvMt4ebAwo%2Fxhash%20client%EF%BC%88%E5%88%9B%E5%BB%BA%E5%8A%A9%E8%AE%B0%E8%AF%8D%EF%BC%89.png?alt=media&amp;token=1cb43fd9-eb60-43ca-b09d-2b58006380ef" alt=""><figcaption><p>創建新助記詞</p></figcaption></figure>

將助記詞記在安全的地方。單擊`下一步`以繼續。

{% hint style="info" %}
**注意：**&#x7576;您希望提取資金時，助記符是生成取款密鑰的唯一方法。請確保您已將其安全保存，最好是離線。
{% endhint %}

### 4.2 創建驗證者秘鑰對

設置要創建的驗證者key數量及密碼，確保將您設置的密碼保存在安全的地方。然後單擊 `下一步`。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FMRFJeMvxSfmac7oxyOtf%2Fxhash%20client%EF%BC%88%E5%88%9B%E5%BB%BA%E7%A7%98%E9%92%A5%EF%BC%89.png?alt=media&amp;token=cd34089d-33f2-4a7d-a87b-0eecb79377de" alt=""><figcaption></figcaption></figure>

重新輸入您設置的密碼，然後單擊`下一步`。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F3y6qT0PkgGmA1Hm67lfw%2Fxhash%20client%EF%BC%88%E7%A1%AE%E8%AE%A4%E5%AF%86%E7%A0%81%EF%BC%89.png?alt=media&amp;token=9d15c707-66ff-4adc-91ae-8cc44c53ce7a" alt=""><figcaption></figcaption></figure>

選擇文件夾來保存生成的秘鑰。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FLpy37gHmSr5EMo3PgHDF%2Fxhash%20client%EF%BC%88%E9%80%89%E6%8B%A9%E6%96%87%E4%BB%B6%E5%A4%B9%EF%BC%89.png?alt=media&amp;token=f76a70b4-35cb-4d69-9a27-f4d6446fbd8d" alt=""><figcaption></figcaption></figure>

創建完成，在對應文件夾下會生成兩個不同文件，分別是keystore 文件（keystore-xxxxxxx.json）和deposit data文件（deposit\_data-xxxxxx.json）。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F9197CEnSxZ5CEQM3PsBU%2Fxhash%20client%EF%BC%88%E5%AE%8C%E6%88%90%E5%88%9B%E5%BB%BA%E7%A7%98%E9%92%A5%EF%BC%89.png?alt=media&amp;token=9311ec41-5193-4eae-b53d-f316439618ae" alt=""><figcaption></figcaption></figure>

### 4.3 驗證者存款

創建秘鑰完成後，點擊下一步進入存款頁面，選擇剛才生成的deposit data文件。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FhAwh4WeVSyPsQo3kfNpC%2Fxhash%20client%EF%BC%88%E4%B8%8A%E4%BC%A0deposit%E6%96%87%E4%BB%B6%EF%BC%89.png?alt=media&amp;token=b2ca927a-09b5-48a8-b041-1d132393629c" alt=""><figcaption></figcaption></figure>

deposit文件校驗成功後，點擊`下一步`。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FMwTU4JptjRSqYSxQpdEr%2Fxhash%20client%EF%BC%88deposit%E6%96%87%E4%BB%B6%E6%A0%A1%E9%AA%8C%E6%88%90%E5%8A%9F%EF%BC%89.png?alt=media&amp;token=f5c2e5a1-7ee7-4e0d-ad5b-43d9eb9b9804" alt=""><figcaption></figcaption></figure>

點擊WalletConnect，出現二維碼，使用支持WalletConnect的錢包掃描二維碼，連接錢包。

{% hint style="info" %}
從這一步開始，需要連接互聯網。
{% endhint %}

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F9KBQSYDOrDL2G4E9mPor%2Fxhash%20client%EF%BC%88%E8%BF%9E%E6%8E%A5%E9%92%B1%E5%8C%85%EF%BC%89.png?alt=media&amp;token=3a48d156-f1d8-469c-b227-b141a6a43589" alt=""><figcaption></figcaption></figure>

連接成功後，會顯示錢包地址及餘額，然後點擊`下一步`。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FU6D6ISLdsecZ4oc2hDrN%2Fxhash%20client%EF%BC%88%E9%92%B1%E5%8C%85%E8%BF%9E%E6%8E%A5%E6%88%90%E5%8A%9F%EF%BC%89.png?alt=media&amp;token=58b6dd54-1d7a-42aa-a09e-78969d47b30d" alt=""><figcaption></figcaption></figure>

在驗證者列表中，您可以選擇常規模式或者批量模式，存在多個準備存款的驗證者時，可以選擇批量模式以便減少您確認交易的次數，批量模式中單次發送交易最多可以處理100條存款。

#### 4.3.1 常規模式

在驗證者列表中，可以查看到當前驗證者狀態，點擊`確認存款`，會連接錢包發起向eth2.0合約地址發起存款交易，轉入32個eth。此時錢包上會出現對應交易，用戶同意簽名後，交易發送。

{% hint style="info" %} <mark style="color:red;">**注意：**</mark>eth2.0質押合約地址&#x70BA;**`0x00000000219ab540356cBB839Cbe05303d7705Fa`**，充值時，用戶需仔細核對充值地址。
{% endhint %}

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FCjBzJUqTuFwXbn4I2trY%2Fimage.png?alt=media&amp;token=c6812df2-0674-4195-98fe-ffd06da69809" alt=""><figcaption></figcaption></figure>

完成充值後，點擊`下一步`。

#### 4.3.2 批量模式

點擊滑塊切換到批量模式，頁面將爲您呈現您提交的deposit文件的存款情況，修改您要發送的存款數量，確保發送金額小於可用的金額，然後點擊確認

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FpPhIDuffnpBWfQ2t6C6t%2Fimage.png?alt=media&amp;token=02d21d0b-55e0-44d8-acf3-82bd42e2538f" alt=""><figcaption></figcaption></figure>

點擊確認存款，存款的金額將是驗證者數量\*32，並等待發送成功

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FyZPMNxCa60xistzhBbuq%2Fimage.png?alt=media&amp;token=3a2db534-62b0-40a0-b832-64623a580615" alt=""><figcaption></figcaption></figure>

### 3.4 上傳keystore到XHash

輸入郵箱和密碼，點擊登錄按鈕，登錄XHash。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F1W4OiV33plfRR8lS4Bmx%2Fxhash%20client%EF%BC%88%E7%99%BB%E5%BD%95xhash%EF%BC%89.png?alt=media&amp;token=0c327ded-96bb-47e4-9816-696f60e119f2" alt=""><figcaption></figcaption></figure>

選擇之前生成的keystore文件，輸入對應的秘鑰密碼，點擊`上傳`。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2Fq7s7XtTo0Kre2XNWttat%2Fxhash%20client%EF%BC%88%E4%B8%8A%E6%AC%A1keystore%EF%BC%89.png?alt=media&amp;token=07048929-b6f3-43db-8bfa-f94f29ca99d7" alt=""><figcaption></figcaption></figure>

上傳keystore成功，關閉程序。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F93H4VdKFh3aWqOw5HkC5%2Fxhash%20client%EF%BC%88%E7%BB%93%E6%9D%9F%EF%BC%89.png?alt=media&amp;token=b2d74e2d-c2f6-4e39-8460-9b91e61b0e86" alt=""><figcaption></figcaption></figure>

## 5.查看驗證者情況

登錄[XHash控制台](https://www.xhash.com/stakingdashboard)，查看已質押的驗證者情況。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FlEbrNJTfOrPVvlW9kjjI%2F%E8%B4%A8%E6%8A%BC%E9%A1%B5%E9%9D%A2%EF%BC%88%E4%BB%AA%E8%A1%A8%E6%9D%BF%EF%BC%89.png?alt=media&amp;token=e4788985-11d5-43d2-b754-7baa24e58d4e" alt=""><figcaption></figcaption></figure>


# 專家模式

## 1.前置準備

1. 準備一臺Windows或蘋果電腦，能打開下面兩個網站：
   * <https://xhash.com>
   * <https://launchpad.ethereum.org>
   * <https://deposit.xhash.com:9000/zh-tw> (可選)
2. 安裝MateMask插件版錢包，建議使用chrome瀏覽器。(以太坊官方啓動面板不支持手機版錢包)
3. 在[xhash.com](https://xhash.com/signUp)上用錢包或者郵箱注冊一個賬戶

## 2. 生成提款憑證

在開始質押 ETH 之前，您必須生成提款憑證。您可以使用以太坊基金會創建的官方工俱生成提款憑證密鑰對。

### 2.1 使用 CLI 應用程序生成

a) 在 [此處 ](https://github.com/ethereum/staking-deposit-cli/releases/)下載官方存款命令行界面 (CLI) 應用程序。根據您的操作系統選擇正確的一個。

{% hint style="warning" %}
注意：請通過驗證 url 確保您從官方 Ethereum Foundation GitHub 帳戶下載：https ://github.com/ethereum/staking-deposit-cli/releases/
{% endhint %}

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F2zFrU8SqnuIcAZ16fdwV%2F1.png?alt=media\&token=6d95a572-1700-46c9-b666-00321e2322a1)

b) 解壓剛剛下載的文件。

c) 使用終端進入包含deposit可執行文件的目錄。

d) 運行以下命令生成提現憑證。

{% hint style="info" %}
為安全起見，我們建議您斷開互聯網連接以完成
{% endhint %}

```
./deposit new-mnemonic --num_validators 1 --chain mainnet
```

{% hint style="warning" %}
**注意：**&#x8ACB;確保您已設置--chain mainnet
{% endhint %}

按照終端窗口中提供給您的說明進行操作。確保將您設置的密碼和助記詞寫在安全的地方。

{% hint style="warning" %}
**注意：**&#x7576;您希望提取資金時，助記符是生成取款密鑰的唯一方法。請確保您已將其安全保存，最好是離線。
{% endhint %}

e) 請在新創建的validator\_keys目錄中找到deposit\_data.json文件。這個 json 文件包含您的提款憑證的公鑰，您需要在質押時上傳它。再次請注意，您需要上傳的提款憑證是公鑰。XHash 將無法訪問您的提款密鑰或 ETH 代幣。

### 2.2 使用 Key Gen GUI 應用程序生成

我們在本教程中使用以[太坊官方啟動板](https://launchpad.ethereum.org/en/generate-keys)推薦的Wagyu Key Gen GUI 應用程序。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FIigXjLZx3fX3A2YUQyd6%2Fimage.png?alt=media\&token=be3843cc-e1bd-40b6-a52c-6089e4d2ed3e)

a) 在 [此處 ](https://github.com/stake-house/wagyu-key-gen/releases)下載適用於您的操作系統的 Wagyu Key Gen 應用程序。

查看HashCloak對 Wagyu Key Gen 的[審計報告](https://github.com/stake-house/wagyu-key-gen/files/7693548/Wagyu.Key.Gen.Audit.Report.pdf)。

{% hint style="warning" %}
注意：請確保您通過驗證 url 從官方 StakeHouse GitHub 帳戶下載：https ://github.com/stake-house/wagyu-key-gen/releases
{% endhint %}

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FNOm7sztyTcjQdBnmZ3re%2Fimage.png?alt=media\&token=dceb93c2-20af-4acd-b3df-6b5a2a820996)

b) 雙擊啟動您剛剛下載的 Wagyu Key Gen 應用程序。

{% hint style="info" %}
為安全起見，我們建議您斷開互聯網連接以完成此步驟。
{% endhint %}

c) 按照申請中提供給您的說明進行操作。您可以創建新的秘密恢復短語或使用現有的秘密恢復短語。要創建新的秘密恢復短語，請單擊CREATE NEW SECRET RECOVERY PHRASE。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FUy06vuHD40Ip2JvMSyII%2Fimage.png?alt=media\&token=a8111378-85db-47a5-ba0f-aafd8b1c4d82)

d) 選擇Mainnet並單擊OK。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FAQgSblxjEFxlptSueeff%2Fimage.png?alt=media\&token=d809b06b-36f9-4522-8d1a-980703706dd6)

e) 單擊CREATE以創建秘密助記詞。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2Fg0qytUvfhWoMRA6PUnjn%2Fimage.png?alt=media\&token=ab1058ec-1c98-4cb8-af93-e1b1b6328a3c)

f) 將助記詞記在安全的地方。單擊NEXT以繼續。

{% hint style="warning" %}
**注意：**&#x7576;您希望提取資金時，助記符是生成取款密鑰的唯一方法。請確保您已將其安全保存，最好是離線。
{% endhint %}

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FetH7We19IY7D6lhFoGHs%2Fimage.png?alt=media\&token=e1df6c67-188b-417e-9dfa-249c73cceddb)

g) 輸入秘密恢復短語，然後單擊CHECK。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FDAiZFhj00UckknpUpgS2%2F%E6%97%A0%E6%A0%87%E9%A2%98.png?alt=media\&token=87b6f067-0029-4b3d-9954-2183d7bd538e)

h) 設置要創建的驗證者key數量及密碼，確保將您設置的密碼保存在安全的地方。然後單擊`NEXT。`

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F4QFM9UxpWATSUv1ANNsw%2Fimage.png?alt=media\&token=2760a2e6-1e9e-4834-ba5a-216300a4a3a8)

i) 重新輸入您設置的密碼，然後單擊NEXT。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FhDvAEBI78DST43E5Q5au%2Fimage.png?alt=media\&token=f77b82d1-7472-4fdc-85ee-7cf2c22c0425)

j) 選擇一個文件夾來保存您的密鑰。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FsdqMbEAVqcEoeC5qkwzS%2Fimage.png?alt=media\&token=c459b87c-8793-4e77-b432-eed772f7c41f)

k) 創建完成，在對應文件夾下會生成兩個不同文件，分別是keystore 文件（keystore-xxxxxxx.json）和deposit data文件（deposit\_data-xxxxxx.json）。

![](https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FMNcUlWNrPug2ksuUhxXX%2Fimage.png?alt=media\&token=bb0c850d-d26b-45ab-92a4-5b9849a9f64e)

## 3.存款

您可以使用[以太坊官方啓動板](https://launchpad.ethereum.org/zh)發送交易，或者使用我們的[批量充值功能](https://deposit.xhash.com:9000/zh-tw)輕鬆完成多次充值。

## 3.1使用[以太坊官方啓動板](https://launchpad.ethereum.org/zh)發送交易

### 3.1.1 上傳deposit data到 [以太坊官方啟動板](https://launchpad.ethereum.org/en/generate-keys)

&#x20;回到 [`以太坊官方啟動板`](https://launchpad.ethereum.org/zh) 根據提示前往 上傳存款數據頁面，提交文件，然後點擊繼續

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F4Lf0GBR88cbsvfJdy48f%2FQQ%E6%88%AA%E5%9B%BE20230316142202.png?alt=media&amp;token=5bf854fb-6700-4ae9-bad2-06f08f916c69" alt=""><figcaption></figcaption></figure>

### 3.1.2 鏈接錢包

鏈接錢包，確保您的餘額足夠支付本次存款, 并點擊繼續

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F9wD6Eqcd5qRntgc6VnW8%2Fimage.png?alt=media&amp;token=9371b536-df43-4a21-a4cd-8c9c77008d68" alt=""><figcaption></figcaption></figure>

### 3.1.3 發送交易

點擊確認存款，在錢包上確認交易之後等待交易成功

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FX9agPQVcTGrugazZyBhU%2FQQ%E6%88%AA%E5%9B%BE20230316144427.png?alt=media&amp;token=c238fa45-148b-4db2-8cc6-6fb4d71b334a" alt=""><figcaption></figcaption></figure>

## 3.2使用[我們的批量存款功能](<https://deposit.xhash.com:9000/zh-tw >)轻松完成多笔存款

### 3.2.1上傳deposit data到[我們的批量存款功能](<https://deposit.xhash.com:9000/zh-tw >)

前往 [我們的批量存款頁面](https://deposit.xhash.com:9000) 並按照提示上傳入金數據頁面，提交文件，點擊繼續

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FPmzhfjZfYxjYLDC47Mws%2Fimage.png?alt=media&amp;token=b6a15b5b-3ae2-4b18-ba96-72aeb1538154" alt=""><figcaption></figcaption></figure>

## 3.2.2 檢查有關您的 Deposit\_Data 的摘要

檢查有關您的存款數據的摘要，然後單擊繼續

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FH3FD0T8HthJftd0eE0ej%2Fimage.png?alt=media&amp;token=52fe4c15-2a7f-426a-a8d8-aa25108553f0" alt=""><figcaption></figcaption></figure>

## 3.2.3 連接錢包

鏈接錢包，確保你的餘額足以支付這筆存款，然後點擊繼續

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2Fd44cwrzadEAVD09FxuXC%2Fimage.png?alt=media&amp;token=61c688e0-b3d3-41d4-b161-abeeb32d274f" alt=""><figcaption></figcaption></figure>

## 3.2.4 發送交易

點擊'發送存款'按鈕發送交易並等待交易成功，通過此頁面單次確認您最多可以發送100筆交易

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FR8wrlpDxjPKIZvaAD2Cr%2Fimage.png?alt=media&amp;token=e1871dd3-6a08-4e03-b2d2-cb7414bfa902" alt=""><figcaption></figcaption></figure>

## 4. 質押

### 4.1 上傳keystore到XHash

a) 進入XHash官網[`質押`](https://www.xhash.com/staking)頁面，點擊 `開始`。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F3I2wZQHuQz5RN7NM6hlR%2F%E8%B4%A8%E6%8A%BC%E9%A1%B5%E9%9D%A2%EF%BC%88%E5%BC%80%E5%A7%8B%EF%BC%89.png?alt=media&amp;token=db1d71b9-0bae-4ea9-b375-3f9d9b9f1aa6" alt=""><figcaption></figcaption></figure>

b) 上傳[步驟一](#2.-sheng-cheng-ti-kuan-ping-zheng)中生成的 `keystore.json`文件，同時輸入keystore密碼。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FzCUj8kZTBakRA6wkx9A2%2F%E8%B4%A8%E6%8A%BC%E9%A1%B5%E9%9D%A2%EF%BC%88%E4%B8%8A%E4%BC%A0%EF%BC%89.png?alt=media&amp;token=23822b29-4a53-48e1-b3a3-2a8ae175981d" alt=""><figcaption></figcaption></figure>

c) 仔細閱讀和檢查各項條款，勾選並點擊<mark style="color:blue;">`上傳`</mark>。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2F6IUEz6ynzU0LvL31F5Ig%2F%E8%B4%A8%E6%8A%BC%E9%A1%B5%E9%9D%A2%EF%BC%88%E5%8B%BE%E9%80%89%EF%BC%89.png?alt=media&amp;token=311ddde5-ef42-44c2-bfa1-25b5343efacb" alt=""><figcaption></figcaption></figure>

### 4.2 查看驗證者狀態

一旦您完成了質押，可以點擊質押儀表板来查看創建的ETH驗證者。您可以查看每個ETH驗證者的地址、狀態、餘額、獎勵和產量。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FlEbrNJTfOrPVvlW9kjjI%2F%E8%B4%A8%E6%8A%BC%E9%A1%B5%E9%9D%A2%EF%BC%88%E4%BB%AA%E8%A1%A8%E6%9D%BF%EF%BC%89.png?alt=media&amp;token=e4788985-11d5-43d2-b754-7baa24e58d4e" alt=""><figcaption></figcaption></figure>

##


# 无需助记词质押

在[**XHash**](https://www.xhash.com)中選擇非託管質押，选择无验证器密钥，然后质押32的倍数个ETH，连接钱包质押即可。

**第 1 步：**&#x9078;擇非託管質押，點擊“**開始質押**”。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FjLikbUwumB7gcZ5UAS30%2Fimage.png?alt=media&amp;token=514cdf05-98c5-4024-a980-11ee274cfb59" alt=""><figcaption></figcaption></figure>

**第 2 步：**&#x9EDE;擊“**否**”，選擇無驗證器秘鑰。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FGDjZDYTTnRFS81bIB4Mk%2Fimage.png?alt=media&amp;token=764399f5-c15d-4c7a-90d0-7c0a51fc0168" alt=""><figcaption></figcaption></figure>

**第 3 步：**&#x5728;質押頁面，**連接錢包**後，輸入相應參數，點擊“**質押**”，發送ETH存款交易。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FZQp1oWjoRWeWxfcIfQAk%2Fimage.png?alt=media&amp;token=c11df1b8-09c3-4505-a709-b52d5a10b957" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
發送交易合約地址為XHash批量存款合約：[0xa86341E5C278443c8648be44110167E1bbD9Cba6](https://etherscan.io/address/0xa86341E5C278443c8648be44110167E1bbD9Cba6)
{% endhint %}


# Restaking指南

## 什麼是再質押？&#x20;

再質押使得質押的 ETH 可以用作以太坊以外的協議的加密經濟安全，以換取協議費用和獎勵，目前最受歡迎的重質押項目是EigenLayer，XHash現支持透過參與EigenLayer的Native Restaking，需要32或32倍數的以太坊參與。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FkdKSk3p2jWmqFCM2gJo7%2Fimage_2024-01-30_17-53-34.png?alt=media&amp;token=f0a7fc93-5a16-460c-9eb3-ec12192d3aa2" alt=""><figcaption></figcaption></figure>


# EigenLayer

[XHash](https://xhash.com)現支持通過參與EigenLayer的Native restaking來獲取他們的再質押積分，如果您選擇SSV選項還能額外獲得SSV的獎勵。 一次質押，多種收益。

## 1.爲什麼要從XHash參與EigenLayer？&#x20;

* **快速且方便**：只需兩步，您可以先在EigenLayer的網站創建EigenPod合約，然後利用XHash的無需助記詞質押功能快速創建驗證者，您甚至不需要記住令人煩惱的助記詞！
* **更高收益**：除了獲得EigenLayer的再質押積分外還能額外獲得SSV的獎勵，一次質押，三種獎勵！
* **及時參與**：EigenLayer有時會暫停流動性代幣的再質押，但原生質押不受限制。 如果您想盡快獲取再質押積分就馬上加入我們！

## 2.什麼是EigenLayer？

&#x20;       EigenLayer 是一種基於以太坊的協議，引入了再質押機制（restake），這是加密經濟安全中的一種新原語，該原語允許在共識層上重複使用 ETH。 原生質押 ETH 或使用流動性質押代幣 (LST) 的用戶可以選擇加入 EigenLayer 智能合約來重新質押其 ETH 或 LST，並將加密經濟安全性擴展到網絡上的其他應用程序，以獲得額外獎勵。 <https://www.eigenlayer.xyz/>

## 3.什麼是EigenLayer的再質押積分？&#x20;

&#x20;       衡量您的 EigenLayer 再質押貢獻總額。 基於一段時間內質押的 ETH 數量，以每秒 ETH 為單位。 有關如何計算再質押積分的準確定義，請參閱下面的文档：

<https://docs.eigenlayer.xyz/restaking-guides/restaking-user-guide/restaked-points>


# 創建EigenPod

EigenPod是由用戶管理的智能合約，旨在促進 EigenLayer 協議監控和管理餘額和提款狀態。在規劃您的 EigenPod 和驗證器操作時，請查看以下注意事項：

* 您可以將任意數量的驗證器指向單個 EigenPod。
* 一個以太坊地址只能部署一個EigenPod。
* 部署 EigenPod 的地址成爲合約的所有者，並獲得再質押和提現操作的許可。
* EigenPod 的所有權無法轉讓。

**第 1 步：**&#x6253;开[EigenLayer 應用程序](https://app.eigenlayer.xyz/)並連接您的 Web3 錢包，確保您已連接到以太坊主網。

**第2步：**&#x9EDE;擊創建EigenPod：

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FaOUVZ5eaDfECTocOAl1k%2Fimage.png?alt=media&amp;token=4bd16229-5cff-490c-a1d2-b619f7867756" alt=""><figcaption></figcaption></figure>

如果成功，您將收到確認信息。請注意，您的 EigenPod 地址位於屏幕右側。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FrIk7v33fPZ1HCZYJNF55%2Fimage.png?alt=media&amp;token=cfa913bf-ce36-4677-9bce-545ab19e7f4d" alt=""><figcaption></figcaption></figure>

**第 3 步：**&#x8907;製此地址，在XHash中創建驗證者時作為驗證者的提款憑證。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FWozuxSKSzx6QMrzBog8Y%2Fimage.png?alt=media&amp;token=7b11c865-a204-4e57-926e-3d34563b3bc6" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
該地址負責與該 EigenPod 相關的所有後續再質押和提款活動。
{% endhint %}


# 在XHash創建驗證者

在[**XHash**](https://www.xhash.com)中選擇非託管質押，选择无验证器密钥，然后质押32的倍数个ETH，输入EigenPod的地址作为提币地址，连接钱包创建即可。

**第 1 步：**&#x9078;擇非託管質押，點擊“**開始質押**”。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FIQvTl4yQ2km00SvbdoXW%2Fimage.png?alt=media&amp;token=523d9638-b7d8-454f-9f42-3cd337c0d808" alt=""><figcaption></figcaption></figure>

**第 2 步：**&#x9EDE;擊“**否**”，選擇無驗證器秘鑰。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FGDjZDYTTnRFS81bIB4Mk%2Fimage.png?alt=media&amp;token=764399f5-c15d-4c7a-90d0-7c0a51fc0168" alt=""><figcaption></figcaption></figure>

**第 3 步：**&#x5728;質押頁面，**連接錢包**後，輸入相應參數，提幣地址設為在EigenLayer創建的EigenPod地址，點擊“**質押**”。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FZQp1oWjoRWeWxfcIfQAk%2Fimage.png?alt=media&amp;token=c11df1b8-09c3-4505-a709-b52d5a10b957" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
提幣地址務必設置為在EigenLayer創建的EigenPod地址。否則無法參與EigenLayer再質押。

質押驗證者時，發送交易合約地址為XHash批量存款合約：[0xa86341E5C278443c8648be44110167E1bbD9Cba6](https://etherscan.io/address/0xa86341E5C278443c8648be44110167E1bbD9Cba6)
{% endhint %}


# 從EigenLayer提款

EigenLayer中原生再質押的提款有兩種：

* **部分提款**：超過32 ETH（質押獎勵）的餘額被提現到以太坊地址。驗證者將繼續成為信標鏈的一部分並按預期進行驗證。
* **全額提款**：用戶可以完全停止質押活動。通過選擇此選項，他們啟動解鎖驗證者持有的全部餘額的過程，包括初始權益和任何累積獎勵。此操作有效的結束了驗證者對網絡的參與。


# 部分提款

{% hint style="info" %}
由於從以太坊提款的設計方式，用戶每次連續掃描所有驗證器(大約需要7-8天)只能啓動一次部分提款。

所有從 EigenLayer 主網取消質押的資金都需要經過 7 天的託管期才能提取。因此，在您發起取消質押後，您必須等待 7 天才能提取您的資產。
{% endhint %}

**第 1 步：**&#x53D6;消質押 - 單&#x64CA;**“Unstake”**&#x5C07;提款排隊並啓動託管期。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FCBdLq2q8me0DNkwLuVx2%2Fimage.png?alt=media&amp;token=2edda6ed-e1a6-4774-bd0c-b3668a1be8cc" alt=""><figcaption></figcaption></figure>

如果成功，您應該會收到確認信息。交易確認後，您應該會看到您的EigenPod餘額轉為取消質押待定狀態。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2Fw9Wv7C3iKejcjRffmPLe%2Fimage.png?alt=media&amp;token=c3e6791b-1b7a-45be-beba-a3f200277cee" alt=""><figcaption></figcaption></figure>

**第 2 步：**&#x7B49;待 7 天託管期結束。

**第 3 步：**&#x63D0;款 - 託管期結束後。點擊**Withdraw**將ETH 轉入您的錢包

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FRoHIC32FIpvWfy4hP2s6%2Fimage.png?alt=media&amp;token=036edebe-a306-4ee1-afa8-208fb1a19dbe" alt=""><figcaption></figcaption></figure>

如果成功，您將收到確認信息。


# 全額提款

{% hint style="info" %}
所有從 EigenLayer 主網取消質押的資金都需要經過 7 天的託管期才能提取。因此，在您發起取消質押後，您必須等待 7 天才能提取您的資產。
{% endhint %}

**第 1 步：**&#x5F9E;XHash退出驗證者。在XHash儀表板頁面，從驗證者列表中選擇驗證者，然後點擊"退出"，將驗證者退出質押。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FXThVWham9ASknxKRNyAq%2Fimage.png?alt=media&amp;token=d08f3e5c-c9a9-4096-b067-bf93d97fb6b0" alt=""><figcaption></figcaption></figure>

**第 2 步：**&#x7B49;待驗證者完全退出驗證者隊列。需要從驗證者隊列中完全退出，這可能需要幾天的時間。請參閱 [validatorqueue.com](https://www.validatorqueue.com/) 了解最新的預計時間.

一旦驗證者從以太坊提款完成，您質押的ETH餘額就會記入您的EigenPod地址，並可以在EigenLayer應用程序上查看。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FxNBxwFWWWjC5hcpO21LF%2Fimage.png?alt=media&amp;token=c92b98cc-e926-47c5-a4a1-3c61f671fd74" alt=""><figcaption></figcaption></figure>

**第 3 步：**&#x53D6;消質押 - 單&#x64CA;**“Unstake”**&#x4EE5;啟動7天的託管期。交易確認後，您應該可以看到您的EigenPod餘額轉為取消質押待定狀態。

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FIfZB0KAy1l1sd18YiNNn%2Fimage.png?alt=media&amp;token=412f2a00-456e-4268-9be0-8e35be63f36e" alt=""><figcaption></figcaption></figure>

**第 4 步：**&#x7B49;待 7 天託管期結束。

**第5步：**&#x63D0;取您的ETH。點擊**Withdraw**將ETH 轉入您的錢包

<figure><img src="https://2148531034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrZyyGqPcJPJE7MpJqhzI%2Fuploads%2FRhvo0EEvsh8rsmilNBZG%2Fimage.png?alt=media&amp;token=888d5ec2-720f-4d39-9155-a144afcab84c" alt=""><figcaption></figcaption></figure>

如果成功，您將收到確認信息。


# 質押 API

## 準備 <a href="#preparation" id="preparation"></a>

如需使用API，請先登錄網頁端，完成API key的申請，再據此文檔詳情進行開發。

您可以點擊 [这里](https://www.xhash.com/usercenter) 創建API key。

創建成功後，請務必記住以下信息：

* Access Key: API訪問祕鑰
* Private Key: 簽名認證加密所使用的祕鑰（僅申請時可見）

{% hint style="info" %}
每個用戶可以創建20個API key，每個API key可以綁定10個ip地址
{% endhint %}

## 接口地址

<https://stakingapi.xhash.com:18000>

## 簽名認證 <a href="#id-138a6766" id="id-138a6766"></a>

* 所有接口採用私鑰簽名，公鑰驗籤的方式請求
* 請求頭header中攜帶簽名信息，包含如下信息：

```
access_key: 您申請的 API Key 中的 Access Key
sign: 簽名信息，使用MD5withRSA簽名，MD5withRSA(requestBody+timestamp),沒有請求參數，requestBody爲""。
timestamp: 請求時間戳（毫秒）
```

* 所有接口採用post請求，請求參數放入requestBody

<pre><code>如訪問/api/v1/xhash/getUserDailyIncome接口
<strong>header：
</strong>"access_key"："50CEA00402A84BFF9B47CF44A947DA0B"
"sign"："sEm3E4qD8fD7mb54SxJLKajf28gItAkHNjk44QJgrjRqh9XQX6xNMdhsKXSAabcfQ77Mpp/PI6i9hW1XPnfkrLKDlAeaTMXKWxQaRKryzB99p782Re0mRoWFW1iZcvaUFzgb3aY3Oj7/xD0Qz6Y+cg/SZGM6KcTC2IL3PosoWPk="
"timestamp"："1666854104527"

<strong>requestBody：
</strong><strong>{
</strong>    "pageNum": 1,
    "pageSetNum": 10
}
</code></pre>

* 統一返回格式

```
  {
      "code": "",
      "data": object,
      "msg": ""
  }
  
  code="200" 爲操作成功，其餘失敗
```

## Example

{% tabs %}
{% tab title="Java" %}
{% file src="/files/s9UUXFSxNho5erd79bgE" %}

```
String accessKey = "A95B2CFA7B1940B799EFCE792AD...";
String privateKey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMQzb3GI8fTGUUXaZsZxnLBWnihO9iSua4z7v9tY...";
String url = "https://stakingapi.xhash.com:18000/api/v1/xhash/getUserDailyIncome";

Map<String, Object> requestBody = new HashMap<>();
requestBody.put("pageNum", 1);
requestBody.put("pageSetNum", 10);

String content = new GsonBuilder().serializeNulls().create().toJson(requestBody);

long timestamp = System.currentTimeMillis();
System.out.println(content + timestamp);
String sign = RSACoder.sign((content + timestamp).getBytes(), privateKey);

HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("access_key",accessKey);
httpHeaders.add("timestamp",timestamp + "");
httpHeaders.add("sign",sign);

HttpEntity<String> httpEntity = new HttpEntity<>(content, httpHeaders);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> result = restTemplate.postForEntity(url, httpEntity, String.class);
System.out.println(result);
```

{% endtab %}

{% tab title="Python" %}

```
import requests
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import MD5
import base64
import time
import calendar

url = "https://stakingapi.xhash.com:18000/api/v1/xhash/getUserDailyIncome"
accessKey = "0EDF9F7653344B10808972B287832727..."
privatekey="MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN7ALyd..."
datajson = '{"pageNum":1,"pageSetNum":10}'
timestamp = str(int(round(calendar.timegm(time.gmtime())*1000)))
data = datajson + (timestamp)

private_keyBytes = base64.b64decode(privatekey)
prikey = RSA.importKey(private_keyBytes)
signer = PKCS1_v1_5.new(prikey)
hash_obj = MD5.new(data.encode('utf-8'))
signtrue = base64.b64encode(signer.sign(hash_obj))
sign = str(signtrue)[2:-1]

headers = {
  'access_key': accessKey,
  'sign': sign,
  'timestamp': timestamp
}
result = requests.post(url, headers=headers, data=datajson)
print(result.text)
```

{% endtab %}

{% tab title="Node" %}

```
const https = require('https');
const crypto = require('crypto');
const accessKey = "0EDF9F7653344B10808972B28C..."
const privateKey = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN7ALyd8Bkx..."

const signer = (json) => {
    const privateKeys = "-----BEGIN PRIVATE KEY-----\n" + privateKey + "\n-----END PRIVATE KEY-----"
    const sign = crypto.createSign('md5');
    sign.update(json);
    return sign.sign(privateKeys, 'base64');
}

const postData = JSON.stringify({
    "pageNum": 1,
    "pageSetNum": 10
})

const timestamp = new Date().valueOf()
const dataJsonStr = `${postData}${timestamp}`
const sign = signer(dataJsonStr)
const options = {
    method: 'POST',
    host: 'stakingapi.xhash.com',
    port: 18000,
    path: '/api/v1/xhash/getUserDailyIncome',
    headers: {
        'access_key': accessKey,
        'sign': sign,
        'timestamp': timestamp
    }
};

var req = https.request(options, (res) => {
    res.setEncoding('utf8');
    res.on('data', (chunk) => {
        console.log(`${chunk}`);
    });
});

req.write(postData);
req.end();
```

{% endtab %}
{% endtabs %}

## 接口詳情

### 獲取用戶餘額和未支付金額

**HTTP request**

`POST /api/v1/xhash/getUserStatus`

**Body 请求参数**\
無

**返回參數**

<table><thead><tr><th></th><th width="108"></th><th width="252"></th><th></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>描述</strong></td><td><strong>備註</strong></td></tr><tr><td>clBalance</td><td>number</td><td>共識層餘額</td><td>Gwei</td></tr><tr><td>waitPayment</td><td>number</td><td>執行層待支付餘額</td><td>Gwei</td></tr></tbody></table>

**返回示例**

```
{
  "code": "200",
  "data": {
    "clBalance": 1446286721091,
    "waitPayment": 1596525011
  },
  "msg": "Success"
}
```

### 獲取用戶詳情

**HTTP request**

`POST /api/v1/xhash/getUserDetailStatus`

**Body 请求参数**\
無

**返回參數**

<table><thead><tr><th width="241"></th><th width="108"></th><th width="252"></th><th></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>描述</strong></td><td><strong>備註</strong></td></tr><tr><td>validatorsOnline</td><td>int</td><td>驗證者在線數量</td><td></td></tr><tr><td>validatorsOffline</td><td>int</td><td>驗證者離線數量</td><td></td></tr><tr><td>totalBalance</td><td>string</td><td>共識層總餘額</td><td>Gwei</td></tr><tr><td>totalChange</td><td>string</td><td>執行層+共識層 總收益</td><td>Gwei</td></tr><tr><td>hoursIncome24</td><td>string</td><td>執行層+共識層 24小時收益</td><td>Gwei</td></tr><tr><td>partailWithdrawalsAmount</td><td>number</td><td>共識層總提取</td><td>Gwei</td></tr><tr><td>waitPayment</td><td>string</td><td>執行層待支付</td><td>Gwei</td></tr><tr><td>pendingPayment</td><td>string</td><td>執行層支付中</td><td>Gwei</td></tr><tr><td>paid</td><td>string</td><td>執行層已支付</td><td>Gwei</td></tr><tr><td>avgRealApr</td><td>float</td><td>所有驗證者平均年化</td><td></td></tr></tbody></table>

**返回示例**

```
{
    "code": "200",
    "data": {
        "validatorsOnline": 45,
        "validatorsOffline": 0,
        "totalBalance": "1440081374281",
        "totalChange": "48615375055.435027176",
        "hoursIncome24": "236051566.84745468",
        "partailWithdrawalsAmount": 35685091263,
        "waitPayment": "400428103.199571345",
        "pendingPayment": "0",
        "paid": "13441757945.295420862",
        "avgRealApr": 0.05681605041
    },
    "msg": "Success"
}
```

### 獲取用戶每日收益

**HTTP request**

`POST /api/v1/xhash/getUserDailyIncome`

**Body 请求参数**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="117"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>是否必填</strong></td><td><strong>默認值</strong></td><td><strong>描述</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>頁數</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>每頁條數</td></tr></tbody></table>

**返回參數**

<table><thead><tr><th></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>描述</strong></td><td><strong>備註</strong></td></tr><tr><td>userId</td><td>int</td><td>用戶id</td><td></td></tr><tr><td>totalReward</td><td>float</td><td>總收益</td><td>Eth</td></tr><tr><td>clReward</td><td>float</td><td>共識層收益</td><td>Eth</td></tr><tr><td>elReward</td><td>float</td><td>執行層收益</td><td>Eth</td></tr><tr><td>mevReward</td><td>float</td><td>執行層MEV收益</td><td>Eth</td></tr><tr><td>txReward</td><td>float</td><td>執行層手續費收益</td><td>Eth</td></tr><tr><td>rewardDay</td><td>int</td><td>收益日期</td><td>second</td></tr><tr><td>validatorNum</td><td>int</td><td>當日產生收益的驗證者數量</td><td></td></tr><tr><td>total</td><td>int</td><td>記錄總條數</td><td></td></tr></tbody></table>

**返回示例**

```
{
  "code": "200",
  "data": {
    "pageNum": 1,
    "pageData": [
      {
        "userId": 123456,
        "totalReward": 0.15852195658793655,
        "clReward": 0.142707974,
        "elReward": 0.01581398258793658,
        "mevReward": 0.001352162267224239,
        "txReward": 0.014461820320712356,
        "rewardDay": 1666569600,
        "validatorNum": 2
      },
      ...
      ...
    ],
    "total": 27
  },
  "msg": "Success"
}
```

### 獲取用戶支付歷史記錄

**HTTP Request**

`POST /api/v1/xhash/getUserPaymentHistory`

**Body 请求参数**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="117"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>是否必填</strong></td><td><strong>默認值</strong></td><td><strong>描述</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>頁數</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>每頁條數</td></tr></tbody></table>

**返回參數**

<table><thead><tr><th></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>描述</strong></td><td><strong>備註</strong></td></tr><tr><td>userId</td><td>int</td><td>user ID</td><td></td></tr><tr><td>realAmount</td><td>float</td><td>payment amount</td><td>Eth</td></tr><tr><td>chainAmount</td><td>float</td><td>execution-layer amount on chain</td><td>Eth</td></tr><tr><td>withHoldTxFee</td><td>float</td><td>tx fee withholding</td><td>Eth</td></tr><tr><td>realTxFee</td><td>float</td><td>tx fee on chain</td><td>Eth</td></tr><tr><td>retained</td><td>float</td><td>tx feen retained</td><td>Eth</td></tr><tr><td>txHash</td><td>string</td><td>tx hash on chain</td><td></td></tr><tr><td>status</td><td>int</td><td>payment status</td><td>0:paying, 1:finished</td></tr><tr><td>chainTime</td><td>int </td><td>the time on chain</td><td></td></tr><tr><td>updateTime</td><td>int </td><td>payment update time</td><td></td></tr><tr><td>total</td><td>int</td><td>number of all rewards</td><td></td></tr></tbody></table>

**返回示例**

```
{
  "code": "200",
  "data": {
    "pageNum": 1,
    "pageData": [
      {
        "userId": 123456,
        "realAmount": 0.148897612,
        "chainAmount": 0,
        "withHoldTxFee": 0.148897612,
        "realTxFee": 0,
        "retained": 0,
        "txHash": "",
        "status": 0,
        "chainTime": 0,
        "updateTime": 1666842847
      }
    ],
    "total": 1
  },
  "msg": "Success"
}
```

### 獲取用戶驗證者列表

**HTTP Request**

`POST /api/v1/xhash/getUserValidatorList`

**Body 请求参数**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="117"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>是否必填</strong></td><td><strong>默認值</strong></td><td><strong>描述</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>頁數 [1,...]</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>每頁條數 [10,100]</td></tr></tbody></table>

**返回參數**

<table><thead><tr><th width="211"></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>描述</strong></td><td><strong>備註</strong></td></tr><tr><td>id</td><td>int</td><td>sequence id</td><td></td></tr><tr><td>userId</td><td>int</td><td>user ID</td><td></td></tr><tr><td>validatorIndex</td><td>int</td><td>validator index</td><td></td></tr><tr><td>validatorPublicKey</td><td>string</td><td>validator publicKey</td><td></td></tr><tr><td>totalIncome</td><td>int</td><td>consensus-layer income</td><td>Gwei</td></tr><tr><td>effectiveBalance</td><td>int</td><td>consensus-layer effective balance</td><td>Gwei</td></tr><tr><td>finalizedBalance</td><td>int</td><td>consensus-layer finalized balance </td><td>Gwei</td></tr><tr><td>currentBalance</td><td>int</td><td>consensus-layer balance </td><td>Gwei</td></tr><tr><td>currentEffectiveness</td><td>string</td><td>effectiveness</td><td></td></tr><tr><td>apr</td><td>float</td><td>apr by 7 day</td><td></td></tr><tr><td>node_status</td><td>string</td><td>validator status in xhash</td><td></td></tr><tr><td>chain_status</td><td>string</td><td>consensus-layer status</td><td></td></tr><tr><td>created_time</td><td></td><td>timestamp in xhash</td><td>second</td></tr><tr><td>total</td><td>int</td><td>number of all rewards</td><td></td></tr></tbody></table>

**返回示例**

```
{
  "code": "200",
  "data": {
    "pageNum": 1,
    "pageData": [
      {
        "id": 45,
        "userId": 123456,
        "validatorIndex": 429489,
        "validatorPublicKey": "0x827b58e886b0024022120a549a7a50bc2b44b51e0d09663d5f543c17fba3f2ec3faf30126979241d0fd1297838de74d8",
        "totalIncome": 118681206,
        "effectiveBalance": 32000000000,
        "finalizedBalance": 32118648446,
        "currentBalance": 32118648446,
        "currentEffectiveness": 99.01,
        "apr": 0.03623521,
        "node_status": "Active",
        "chain_status": "Active",
        "created_time": 1663310642
      },
      ...
      ...
    ],
    "total": 45
  },
  "msg": "Success"
}
```

### 獲取共識層提幣歷史記錄

**HTTP Request**

`POST /api/v1/xhash/getUserPartailWithdrawals`

**Body 请求参数**

<table><thead><tr><th width="149"></th><th width="124"></th><th></th><th width="117"></th><th width="192"></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>是否必填</strong></td><td><strong>默認值</strong></td><td><strong>描述</strong></td></tr><tr><td>pageNum</td><td>int</td><td>true</td><td>-</td><td>頁數 [1,...]</td></tr><tr><td>pageSetNum</td><td>int</td><td>true</td><td>-</td><td>每頁條數 [10,100]</td></tr></tbody></table>

**返回參數**

<table><thead><tr><th width="211"></th><th width="116"></th><th width="296"></th><th></th></tr></thead><tbody><tr><td><strong>參數名</strong></td><td><strong>数据類型</strong></td><td><strong>描述</strong></td><td><strong>備註</strong></td></tr><tr><td>id</td><td>int</td><td></td><td></td></tr><tr><td>userId</td><td>int</td><td>用戶id</td><td></td></tr><tr><td>validatorIndex</td><td>int</td><td>validator index</td><td></td></tr><tr><td>validatorPublicKey</td><td>string</td><td>validator publicKey</td><td></td></tr><tr><td>blockSlot</td><td>int</td><td>slot</td><td></td></tr><tr><td>withdrawalIndex</td><td>int</td><td>withdrawal Index</td><td></td></tr><tr><td>address</td><td>string</td><td>共识层提取地址 </td><td></td></tr><tr><td>amount</td><td>float</td><td>共识层提取金额</td><td>eth</td></tr><tr><td>createdTime</td><td>long</td><td>时间戳，秒</td><td></td></tr></tbody></table>

**返回示例**

```
{
    "code": "200",
    "data": {
        "pageNum": 1,
        "pageData": [
            {
                "id": 0,
                "userId": 101527,
                "validatorIndex": 429481,
                "validatorPublicKey": "0xac34188ca2c6ec29e40534229698d38fc733908c34eeecd77df0f477481344b10fcebbabbb9cc233a09390d1afb6121d",
                "blockSlot": 6281691,
                "withdrawalIndex": 1122084,
                "address": "0x0708f87a089a91c65d48721aa941084648562287",
                "amount": "0.012279707",
                "createdTime": 1682204315
            },
            ...
            ...
        ],
        "total": 135
    },
    "msg": "Success"
}
```

## 錯誤碼

<table><thead><tr><th width="284"></th><th></th></tr></thead><tbody><tr><td><strong>code</strong></td><td><strong>message</strong></td></tr><tr><td>200</td><td>Success</td></tr><tr><td>400</td><td>Param error</td></tr><tr><td>401</td><td>Authentication failed</td></tr><tr><td>403</td><td>Ip not on whitelist</td></tr><tr><td>404</td><td>Path Not Found</td></tr><tr><td>405</td><td>Request timestamp expire</td></tr><tr><td>429</td><td>Requests has exceeded the per second limit</td></tr><tr><td>500</td><td>Server error</td></tr><tr><td>4001</td><td>Select user balance failed</td></tr><tr><td>4002</td><td>Page invalid</td></tr><tr><td>4003</td><td>Select user reward failed</td></tr><tr><td>4004</td><td>Select user payments history failed</td></tr><tr><td>4005</td><td>Select validator list failed</td></tr></tbody></table>


# 質押  Q\&A

<details>

<summary><mark style="color:blue;">什麼是以太坊升級（ETH2.0）？</mark></summary>

**以太坊路線圖涉及互連協議升級，這將使網絡更具可擴展性、更安全和更可持續。第一步是將以太坊的共識從 PoW 改為 PoS​​，這意味著將不再可能使用顯卡 GPU 或 ASIC 芯片礦機進行 PoW 挖礦。**

</details>

<details>

<summary><mark style="color:blue;">什麼是合併？</mark></summary>

**信標鏈（共識層）於 2020 年 12 月 1 日上線，它不會改變你今天使用的以太坊，它們是並行執行的，合併意味著信標鍊和當前的 ETH PoW 鏈將共同創建區塊，也意味著以太坊將其共識從 PoW 更改為 PoS​​。**

</details>

<details>

<summary><mark style="color:blue;">以太坊升級何時啟動（The Merge）？</mark></summary>

**根據以太坊基金會的博客，它將發生在 2022/09/10 和 2022/09/20 之間，最可能的日期是 2022/09/15。**

</details>

<details>

<summary><mark style="color:blue;">什麼是質押？</mark></summary>

**Staking 是持有某些加密貨幣的一種獲得獎勵的方式，對於以太坊來說，你需要質押 32 ETH 成為驗證者並鎖定一段時間，並持續獲得質押收益。**

</details>

<details>

<summary><mark style="color:blue;">如何加入 Staking 並獲得獎勵？</mark></summary>

**如果個人想要參與質押並獲得收益，需要在以太坊官網的質押啟動板質押 32 ETH 來創建驗者，然後需要購買一系列符合要求的硬件，開始其上的驗證器程序、共識層節點、執行層節點必須保證7\*24小時在線，並需要按時升級到最新版本。**

</details>

<details>

<summary><mark style="color:blue;">為什麼 XHash 是最佳選擇？</mark></summary>

**個人參與 Staking 需要大量時間來學習以太坊 Staking 的知識，購買硬件，搭建、維護和升級軟件，非常耗費人力，也不一定能保證收益。在XHash中，您只需幾個簡單的步驟即可創建您的驗證者節點，其餘工作將由XHash的專業團隊完成，用戶只需坐下來享受收益。**

</details>

<details>

<summary><mark style="color:blue;">什麼是非託管質押？</mark></summary>

**XHash提非託管質押服務，這意味著客戶的ETH由他們的錢包控制，XHash只有驗證密鑰但不能訪問你的ETH，最大限度地保證了安全性。**

</details>

<details>

<summary><mark style="color:blue;">我能賺多少錢？</mark></summary>

**質押收益以 APR（年化收益率）表示，APR 取決於質押在網絡上的 ETH 總供應量的百分比，目前為 4.3%。但是，目前驗證者只從信標鏈中獲得收益。合併後驗證者將從執行層獲得額外收益，如果質押比例不變，預計為 7%。**

</details>

<details>

<summary><mark style="color:blue;">我什麼時候可以提取我的資金？</mark></summary>

**為了安全地將網絡轉移到PoS，以太坊目前不具備提現功能，需要等待合併後的另一個硬分叉（上海）。合併預計將在 2022 年 9 月中旬進行，但上海硬分叉的時間仍不確定。它可能要到合併後的 6-12 個月才會發生，這意味著您質押的以太坊將繼續被鎖定，直到以太坊開放提款功能。**

</details>

<details>

<summary><mark style="color:blue;">質押有哪些風險？</mark></summary>

**Staking 的主要風險是導致資金損失的懲罰，懲罰有兩種，一種是網絡會對持續離線的驗證者進行懲罰，這個懲罰很小，例如，如果你獲得在線每小時0.001 ETH，離線每小時0.001 ETH。另一個是網絡將削減惡意行為的驗證者，任何被發現違反這些規則的驗證者都將被削減並從網絡中驅逐。Slashing 意味著驗證者的大部分股權被移除：在最壞的情況下，最高可達 32 ETH 的全部股權。驗證器軟件和質押提供者將具有內置的保護措施，以防止意外被削減。削減應該只影響故意行為不端的驗證者。**&#x20;

**XHash擁有全球領先的以太坊安全基礎設施，可以保證你最大程度的免受懲罰。**

</details>


