# Create Wallet

## Key Management <a href="#key-management" id="key-management"></a>

This article is a guide about key management strategy on client side of your Decentralised Application on Brise Chain

### Setup Web3 <a href="#setup-web3" id="setup-web3"></a>

`web3.js` is a javascript library that allows our client-side application to talk to the blockchain. We configure web3 to communicate via Metamask.

`web3.js` doc is [here](https://web3js.readthedocs.io/en/v1.2.2/getting-started.html#adding-web3-js)

### Connect to BRISE network <a href="#connect-to-brise-network" id="connect-to-brise-network"></a>

```
    // mainnet 
     const web3 = new Web3('https://mainnet-rpc.brisescan.com');
    // testnet
    const web3 = new Web3('https://testnet-rpc.brisescan.com');
```

### Set up account <a href="#set-up-account" id="set-up-account"></a>

If the installation and instantiation of web3 was successful, the following should successfully return a random account:

```
    const account = web3.eth.accounts.create();
```

&#x20;

### Recover account <a href="#recover-account" id="recover-account"></a>

If you have backup the private key of your account, you can use it to restore your account.

```
    const account = web3.eth.accounts.privateKeyToAccount("$private-key")
```

&#x20;

### Full Example <a href="#full-example" id="full-example"></a>

```
const Web3 = require('web3');
async function main() {

    const web3 = new Web3('https://mainnet-rpc.brisescan.com');
    const loader = setupLoader({ provider: web3 }).web3;

    const account = web3.eth.accounts.create();
    console.log(account);
}
```

<br>


---

# 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://docs.bitgert.com/for-developers/create-wallet.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.
