Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunit2481 committed May 20, 2024
1 parent 1848a62 commit 79a536e
Show file tree
Hide file tree
Showing 84 changed files with 159 additions and 110 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
128 changes: 64 additions & 64 deletions docs/use/Get-Started/Astar-EVM-wallet/Wallet/Ledger/ledger-evm.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
---
sidebar_position: 9
title: Ledger Astar/Shiden EVM on MetaMask
sidebar_position: 1
sidebar_label: Ledger for Astar EVM
title: Interact with Ledger on Astar EVM using MetaMask
---

import Figure from '/src/components/figure'
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Using Astar and Shiden EVM Ledger apps with MetaMask
## Introduction

## Intro
**Ledger devices** can be used on **Astar EVM Network** to perform and sign transactions using the Ledger default `Ethereum` application.
This means that MetaMask users can now sign transactions for EVM accounts on Astar Network using Ledger Nano S (plus) or Ledger X devices.

**Astar EVM** and **Shiden EVM** apps are now available on Ledger hardware wallet devices. This means that MetaMask users can now sign transactions for EVM accounts on those networks using Ledger Nano S (plus) or Ledger X devices.

This guide will show you how to set up Astar EVM and Shiden EVM on your Ledger hardware wallet and how to use it in combination with MetaMask.
This guide will show you how to set up **Astar EVM** on your Ledger hardware wallet and how to use it in combination with **MetaMask**.

:::info
Photos are taken using Nano S Plus device, and the example shows interaction with Astar EVM app, but the process is the same with Nano S and Nano X devices, as well as Shiden EVM app.
Photos are taken using Nano S Plus device, and the example shows interaction with Ethereum app, but the process is the same with Nano S and Nano X devices.
:::

## Requirements
Expand All @@ -29,85 +31,83 @@ Photos are taken using Nano S Plus device, and the example shows interaction wit
- [Download and install Ledger Live app for your OS](https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true)
- [Download and install MetaMask for your browser](https://metamask.io/download/)

### Astar/Shiden network set up on Metamask
### Astar Network set up on Metamask

If you already have this, feel free to skip this part.

1. In the MetaMask menu navigate to Settings → Networks, and click “Add a network”
2. Enter following details for Astar:
1. Network name: `Astar Network Mainnet`
2. New RPC URL:<br />
`https://astar.public.blastapi.io/`<br />
`https://astar-rpc.dwellir.com/`<br />
`https://astar.api.onfinality.io/public`
3. Chain ID: `592`
4. Currency Symbol: `ASTR`
5. Block Explorer URL(Optional): `https://astar.subscan.io/`
3. Click the “Save” button
4. Repeat steps 1-3 for Shiden network with following details:
1. Network name: `Shiden Network Mainnet`
2. New RPC URL:<br />
`https://shiden.public.blastapi.io`<br />
`https://shiden-rpc.dwellir.com`<br />
`https://shiden.api.onfinality.io/public`
3. Chain ID: `336`
4. Currency Symbol: `SDN`
5. Block Explorer URL(Optional): `https://shiden.subscan.io/`
5. Close the Settings menu and from the dropdown select the network you wish to interact with

### Install apps to your Ledger device

1. Open Ledger Live app and navigate to “Manager”
2. Connect your Ledger Device and unlock it
1. If asked, confirm Ledger Manager on your device
3. Search for “Astar EVM” or “Shiden EVM” in the app catalog
4. Click install

After this step, you should have one or both of these apps:

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/1-AstarEVM.jpg').default} height='200px' />

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/2-ShidenEVM.jpg').default} height='400px' />
1. In the MetaMask menu, navigate to `Settings``Networks`, and click **Add a network**;
2. Enter following details:

<TabItem value="astar" label="Astar Network" default>
| | Public endpoint Astar |
| --- | --- |
| Network name | Astar Network |
| New RPC URL | Astar Team: https://evm.astar.network |
| | BlastAPI: https://astar.public.blastapi.io |
| | Dwellir: https://astar-rpc.dwellir.com |
| | OnFinality: https://astar.api.onfinality.io/public |
| Chain ID | 592 |
| Currency symbol | ASTR |
| Block Explorer URL | https://astar.blockscout.com/ |
</TabItem>
<br></br>

3. Close the `Settings` menu and, from the drop-down menu, select the network you wish to interact with.

### Install Ethereum app to your Ledger device

1. Open **My Ledger** in Ledger Live.
2. Connect and unlock your Ledger device.
If asked, allow `My Ledger` to access your device.
3. Search for **Ethereum** in the app catalog.
4. Click Install.

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-live-ethereum.png').default} width="80%" />

After this step, you should have the Ethereum app installed:

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app.png').default} width="60%" />


## Connecting your Ledger device to MetaMask

1. In MetaMask menu select Connect Hardware wallet:
1. In MetaMask menu, select **Connect Hardware wallet**;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/connect_hw_wallet.png').default} height='400px' />
<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app_2.png').default} width="70%" />

2. On the next screen select Ledger and click Continue:
2. On the next screen select **Ledger** and click **Continue**;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/select_ledger.png').default} height='400px' />
<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app_3.png').default} width="70%" />

3. Pair and connect your Device when prompted by the browser:
3. Pair and **Connect** your Device when prompted by the browser;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/pair_hid.png').default} height='400px' />
<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app_4.png').default} width="70%" />

4. Select an account you wish to connect and click Unlock”:
4. Select an account you wish to connect and click **Unlock**;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/select_acc.png').default} height='400px' />
<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app_5.png').default} width="70%" />

5. You should now see your account and balance:

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/acc_balance.png').default} height='400px' />
<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app_6.png').default} width="70%" />

# Receiving tokens

To receive tokens, copy the address of your connected account by clicking your account name in MetaMask header, and send some tokens to that address from your preferred source.

# Sending tokens

1. In MetaMask click Send button and enter the address you wish to send to
2. Enter the amount to send and click Next
3. Connect your Ledger device and unlock it. Due to MetaMask limitations, it will prompt you to open Ethereum App. Ignore this and open Astar EVM app.
1. In MetaMask, click **Send** button and enter the address you wish to send to;
2. Enter the amount to send and click **Next**;
3. Connect your Ledger device and unlock it;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/confirm_tx.png').default} height='400px' />
<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/ledger-ethereum-app_7.png').default} width="80%" />

4. When your Ledger device screen is showing Application is ready, click Confirm in MetaMask:
4. When your Ledger device screen is showing `Application is ready`, click **Confirm** in MetaMask;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/3-ApplicationIsReady.jpg').default} height='200px' />

5. Review the transaction on your Ledger device:
5. Review the transaction on your Ledger device;

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/4-ReviewTransaction.jpg').default} height='200px' />

Expand All @@ -130,13 +130,13 @@ To receive tokens, copy the address of your connected account by clicking your a

<Figure src={require('/docs/use/get-started/astar-evm-wallet/wallet/ledger/img/12-Reject.jpg').default} height='200px' />

6. Check the transaction result in MetaMask Activity tab.
6. Check the transaction result in MetaMask `Activity` tab.

## Interacting with smart contracts

In order to interact with smart contracts, you need to enable blind signing in the Astar EVM app on your Ledger device:

1. Open the app
2. Navigate to Settings and confirm
3. Confirm the Blind signing option, so it turns to Enabled
4. Navigate to Back and confirm
1. Open the app;
2. Navigate to `Settings` and **Confirm**;
3. Confirm the `Blind signing` option, so it turns to `Enabled`;
4. Navigate to `Back` and **Confirm**.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
@@ -1,84 +1,101 @@
---
sidebar_position: 1
sidebar_label: Install Astar Ledger Native
title: Using Ledger device with Astar Native Accounts
sidebar_position: 2
sidebar_label: Ledger for Astar Native
title: Interact with Ledger using Astar Native Accounts
---

import Figure from "/src/components/figure"

Astar Native app is an app integrated with Ledger that users can use a ledger device as an account and sign transactions for substrate accounts. **Ledger Live is not supported hence user will not be able to create an account with Ledger Live**.
## Introduction

**Astar Native app** is an app integrated with Ledger that users can use a ledger device as an account and sign transactions for substrate accounts.

- [Release Version `2.83.0` by Zondax](https://github.com/Zondax/ledger-astar/releases/tag/v2.83.0)

**Ledger Live is not supported hence user will not be able to create an account with Ledger Live**.

:::danger
At the time of this release, the following operations are **NOT SUPPORTED:** on Ledger devices:
At the time of this release (Version `2.83.0`), the following operations are **NOT SUPPORTED** on Ledger devices:

- **EVM withdrawal**: It is not possible to claim tokens from the Astar EVM side.
- **XCM transfers**
- **Vesting**
:::

This tutorial walks through the process of setting up a Ledger device to participate in dApp staking using ASTR native tokens, initiating the first interaction between the device and the network, and also explains some limitations of using Ledger devices with the native dApp staking system.
This tutorial describes the process of configuring a Ledger device to manage assets, connect to the Astar portal and participate in dApp staking using native ASTR tokens. It also includes the initiation of the first interaction between the device and the network.

### Before staking, confirm that:
1. Ledger Live is up to date, and the Astar app is installed.
2. The Ledger device firmware is up to date.
3. A Ledger account has been imported to Polkadot.js.
4. A Chromium-based browser is available for all web-based operations, such as Google Chrome or Brave.
5. The Ledger device is configured to use WebHID as the preferred hardware connection method.
## Your Ledger device is ready for use

### Update Ledger Live and Device Firmware
- [Make sure you have set up your Ledger device](https://support.ledger.com/hc/en-us/articles/360000613793?docs=true)
- Update your device to latest firmware
- [Nano S](https://support.ledger.com/hc/en-us/articles/360002731113?docs=true)
- [Nano S Plus](https://support.ledger.com/hc/en-us/articles/4445777839901?docs=true)
- [Nano X](https://support.ledger.com/hc/en-us/articles/360013349800?docs=true)
- [Download and install Ledger Live app for your OS](https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true)
- [Download and install Polkadot.js extension for your browser](https://polkadot.js.org/extension/)

Ensure Ledger Live is up to date.
## Install Astar app to your Ledger device

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger1.png').default} width='1200px' />
1. Open **My Ledger** in Ledger Live.
2. Connect and unlock your Ledger device.
If asked, allow `My Ledger` to access your device.
3. Search for **Astar** (Version `2.83.0`) in the app catalog.
4. Click Install.

- If prompted to update the device Firmware do so, as it will update the Astar app as well.
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-live-astar-app.png').default} width="80%" />

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger2.png').default} width='1200px' />
After this step, you should have the Astar Native app installed:

- Once Ledger Live is up to date, ensure the latest Astar app (version 2.52.2 or higher) is installed.
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app.png').default} width="60%" />

:::tip
Ledger NanoS users should install the Astar XL version of the app, shown in the image below:
Ledger NanoS users should install the Astar XL (Version `2.83.0`) of the app, shown in the image below:
:::

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger3.png').default} width='1200px' />
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-live-astar-app-2.png').default} width="80%" />

### Import Ledger account to Polkadot.js
## Connect your Ledger device to Astar Network using Polkadot.js

- Open the Polkadot.js extension.
- Click the + sign menu option.
- Choose ‘Attach ledger account.’ Make sure your ledger is unlocked.
1. Install **[Polkadot.js extension](https://polkadot.js.org/extension/)**;
2. Open extenstion;
3. Open the extension and select **Attach Ledger account** as shown below;

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger4.png').default} width='600px' />
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app-2.png').default} width="70%" />

- Follow through the process of Importing a Ledger Account by specifying a descriptive name. The default name and settings are shown in the image below:
4. Make sure your Ledger device is connected to your PC and Astar app is open;
5. Select **Astar Network** and name your **Astar** account;

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger5.png').default} width='600px' />
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app-3.png').default} width="70%" />

### Configure the Ledger device connection method
6. Click **Import Account**.

- Once the Ledger account has been imported, visit the [Astar Network settings page on the Polkadot.js apps portal](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.astar.network#/settings) and ensure **Attach Ledger via WebHID** is the preferred connection method listed under *account options* > *manage hardware connections*, as shown in the image below:
You successfully connected to Ledger Astar account.

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger7.png').default} width='1200px' />
**Configure the Ledger device connection method**

### Visit the Astar Portal
1. Go to the **[Astar settings page on the Polkadot.js portal](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.astar.network#/settings)**;
2. Ensure **Attach Ledger via WebHID** is the preferred connection method listed under *account options* > *manage hardware connections*, as shown in the image below:

- Open a browser and visit the [Astar Portal](https://portal.astar.network).
- Connect the Polkadot.js extension to the Portal.
- Select the Ledger account that was imported during the last step. Check the toggle so Portal knows the device is a ledger. It can now be used to participate in dApp staking.
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app-4.png').default} width="80%" />

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger8.png').default} width='600px' />
## Connect your Ledger device to the Astar Portal

For detailed information about dApp staking or how to stake on the EVM side of Astar Portal using a Ledger device, please refer to the [Astar official documentation] (/docs/use/dapp-staking/for-stakers/) **LINK TO UPDATE** or [Ledger EVM staking guide](/docs/use/get-started/astar-evm-wallet/wallet/ledger/ledger-evm.md)
1. Open your browser and visit the [Astar Portal](https://portal.astar.network).
2. Connect the [Polkadot.js extension](https://polkadot.js.org/extension/) to the Portal.
3. Open the Astar Native app on your Ledger device;

:::tip
If you receive a **Ledger error: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface** message during the dApp staking claim process, ensure you are performing the operation using a Chromium-based browser such as Chrome or Brave, and the Ledger device connection method is WebHID, as outlined in the previous step.
:::
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app.png').default} width="60%" />

<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger6.png').default} width='600px' />
4. Select the Ledger account that was imported during the last step. Check the toggle to let Portal recognize the device as a ledger.

## Ledger NanoS and S-plus/X device limitations
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app-5.png').default} width="80%" />

Consider the following scenario: You stake on 2 dApps, and accumulate 2 eras worth of rewards each day. What happens if you do not claim the rewards for an entire month?
For detailed information about dApp staking or how to stake on the EVM side of Astar Portal using a Ledger device, please refer to the [Astar official documentation](/docs/use/dapp-staking/for-stakers/) or [Ledger EVM staking guide](/docs/use/get-started/astar-evm-wallet/index.md)

- Ledger Nano-S - The Nano-S device supports claiming a maximum of **2 eras** at a time, so for as long as there are more eras to claim in the dApp staking dashboard, you should continue to claim. Based on a month's worth of accumulated rewards (30 eras), 30 claims would need to be initiated using a Nano-S.
- Ledger Nano X - Based on a maximum of **6 eras per claim,** 10 claims would need to be initiated using a Nano X.
:::tip
If you receive a **Ledger error: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface** message during the dApp staking claim process, ensure you are performing the operation:
- Using a Chromium-based browser such as Chrome or Brave,
- The Ledger device connection method is WebHID, as outlined in the previous step
- The Ledger device is correctly connected to the Portal with the toggle activated.
:::

Staking on multiple dApps using a Ledger device may substantially increase the amount of time and/or administrative overhead required to participate in dApp staking in order to maximize benefits. However, although multiple claims may be required to retrieve all rewards from the Portal using a Ledger device, the fees remain the same per era claimed whether they occur in batches, or as individual transactions.
<Figure src={require('/docs/use/get-started/astar-substrate-wallet/wallet/ledger/img/ledger-astar-app-6.png').default} width="80%" />
Loading

0 comments on commit 79a536e

Please sign in to comment.