# Understanding the EVM provider/signer concepts

## The provider

A **provider** in `Ethers.js` serves as a bridge between your application and the Ethereum blockchain. It facilitates communication, allowing your application to retrieve information from the Ethereum network. Think of it as a window into the blockchain, providing you with data without exposing the complexities of the underlying infrastructure.

### The different types of providers available in ethers:

### Declare a provider using ethers:

```javascript
const { ethers } = require('ethers');

// Replace the moonbeam RPC by your desired RPC provider
const provider = new ethers.providers.JsonRpcProvider(`https://moonbeam.unitedbloc.com`);

// Now you can use the provider to interact with the EVM blockchains
provider.getBlockNumber().then((blockNumber) => {
  console.log('Current Block Number:', blockNumber);
});
```

## The signer

Moving on to the concept of a **signer**, it plays a crucial role in facilitating transactions on the Ethereum blockchain. A signer is responsible for signing transactions with a private key, providing the necessary authorization to execute actions like sending Ether or interacting with smart contracts.

### Use a signer using ethers and send a transaction:

```javascript
const { ethers } = require('ethers');

// Replace 'your_private_key' with the private key of your Ethereum account
const privateKey = 'your_private_key';
const wallet = new ethers.Wallet(privateKey);

// Now, the wallet acts as a signer, allowing you to sign transactions
const transaction = {
  to: '0x0123456789ABCDEF0123456789ABCDEF01234567', // Replace with the recipient's address
  value: ethers.utils.parseEther('1.0'), // Sending 1 Ether
};

wallet.sendTransaction(transaction).then((transactionHash) => {
  console.log('Transaction Hash:', transactionHash);
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jungle-toolkit.gitbook.io/evm-xcm-jungle-toolkit/build-an-evm+substrate-wallet-compatible-architecture-in-your-dapp/implement-multiple-wallet-support-on-your-dapp-front-end/understanding-the-evm-provider-signer-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
