# Source: https://docs.near.org/integrations/implicit-accounts.md

---
id: implicit-accounts
title: Implicit Accounts
sidebar_label: Implicit Accounts
description: "Learn about implicit accounts in NEAR, how they work with Ethereum-style addresses, and their role in chain abstraction and multi-chain integration."
---

This document provides an overview of implicit accounts in the NEAR Protocol, including how to create them, use them for transactions, and manage them effectively. Implicit accounts are particularly useful for exchanges and other services that need to facilitate transactions without requiring user interaction.

## Background {#background}

Implicit accounts work similarly to Bitcoin/Ethereum accounts.
 - They allow you to reserve an account ID before it's created by generating a ED25519 key-pair locally.
 - This key-pair has a public key that maps to the account ID.
 - The account ID is a lowercase hex representation of the public key.
 - An ED25519 Public key contains 32 bytes that maps to 64 characters account ID.
 - The corresponding secret key allows you to sign transactions on behalf of this account once it's created on chain.

:::info
You can find the implicit accounts specification [here](https://nomicon.io/DataStructures/Account.html#implicit-account-ids).
:::

## Creating an account locally {#creating-an-account-locally}

For the purpose of this demo, we'll use the `betanet` network.

## Set `betanet` network {#set-betanet-network}

```bash
export NEAR_ENV=betanet
```

## Generating the Implicit account

```bash
near account create-account fund-later use-auto-generation save-to-folder ~/.near-credentials/implicit
```

Example Output
```
The file "~/.near-credentials/testnet/8bca86065be487de45e795b2c3154fe834d53ffa07e0a44f29e76a2a5f075df8.json" was saved successfully

Here is your console command if you need to script it or re-run:
    near account create-account fund-later use-auto-generation save-to-folder ~/.near-credentials/implicit
```

## Using the Implicit Account
We can export our account ID to a bash env variable:
```bash
export ACCOUNT="8bca86065be487de45e795b2c3154fe834d53ffa07e0a44f29e76a2a5f075df8"
```

Assuming you've received tokens on your new account, you can transfer from it using the following command:

```bash
near tokens $ACCOUNT send-near <receiver> '<amount> NEAR' network-config testnet sign-with-keychain send
```

## Transferring to the implicit account {#transferring-to-the-implicit-account}

Let's say someone gives you their account ID `0861ea8ddd696525696ccf3148dd706c4fda981c64d8a597490472594400c223`. You can just transfer to it by running:

```bash
near tokens<your_account_id> send-near 0861ea8ddd696525696ccf3148dd706c4fda981c64d8a597490472594400c223 '<amount> NEAR' network-config testnet sign-with-keychain send
```

## BONUS: Converting public key using python (for learning purposes) {#bonus-converting-public-key-using-python-for-learning-purposes}

For this flow we'll use `python3` (with version `3.5+`) with `base58` library.

You can install this library with `pip3`:
```bash
pip3 install --user base58
```

Start python3 interpreter:
```bash
python3
```

The first thing is to get the data part from the public key (without `ed25519:` prefix). Let's store it in a variable `pk58`:
```python
pk58 = 'BGCCDDHfysuuVnaNVtEhhqeT4k9Muyem3Kpgq2U1m9HX'
```

Now let's import base58:
```python

```

Finally, let's convert our base58 public key representation to bytes and then to hex:
```python
base58.b58decode(pk58).hex()
```

Output:
```
'98793cd91a3f870fb126f66285808c7e094afcfc4eda8a970f6648cdf0dbd6de'
```

This gives us the same account ID as `near-cli`, so this is encouraging.

:::tip Got a question?
<a href="https://stackoverflow.com/questions/tagged/nearprotocol" target="_blank" rel="noopener noreferrer"> Ask it on StackOverflow! </a>
:::