Skip to content

Commit

Permalink
update the proposal to restrict top level accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenwang1996 committed Jul 31, 2023
1 parent bcbc6dc commit d452196
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions neps/nep-0492.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LastUpdated: 2023-07-27

## Summary

This proposal aims to restrict the creation of Ethereum addresses on NEAR to both prevent loss of funds due to careless user behaviors and scams
This proposal aims to restrict the creation of top level accounts (other than implicit accounts) on NEAR to both prevent loss of funds due to careless user behaviors and scams
and create possibilities for future interopability solutions.

## Motivation
Expand All @@ -28,7 +28,7 @@ There are currently ~5000 Ethereum addresses already created on NEAR. It is also

## Specification

The proposed change is quite simple. Only the protocol registrar account (which can create top-level accounts <= 32 bytes) can create Ethereum addresses.
The proposed change is quite simple. Only the protocol registrar account can create top-level accounts that are not implicit accounts

## Reference Implementation

Expand All @@ -37,10 +37,10 @@ The implementation roughly looks as follows:
```Rust
fn action_create_account(...) {
...
if account_id.is_ethereum_address()
if account_id.is_top_level() && !account_id.is_implicit()
&& predecessor_id != &account_creation_config.registrar_account_id
{
// An Ethereum address can only be created by the registrar account
// Top level accounts that are not implicit can only be created by registrar
result.result = Err(ActionErrorKind::CreateAccountOnlyByRegistrar {
account_id: account_id.clone(),
registrar_account_id: account_creation_config.registrar_account_id.clone(),
Expand All @@ -63,11 +63,11 @@ Ethereum wallets such as Metamask could potentially support NEAR transactions th

## Consequences

In the short term, no Ethereum addresses would be allowed to be created, but this change would not create any problem for users.
In the short term, no new top-level accounts would be allowed to be created, but this change would not create any problem for users.

### Backwards Compatibility

There is no backwards compatibility concern.
For Ethereum addresses specifically, there are ~5000 existing ones, but this proposal per se do not deal with existing accounts.

## Copyright

Expand Down

0 comments on commit d452196

Please sign in to comment.