Skip to content

Commit

Permalink
Merge branch 'master' into 2379-doc-improve-chain-abstraction-overview
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero authored Jan 24, 2025
2 parents 7d03736 + eeab3f6 commit c7ee2d6
Show file tree
Hide file tree
Showing 26 changed files with 211 additions and 1,393 deletions.
4 changes: 2 additions & 2 deletions blog/2024-11-07.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ Check [this transaction](https://testnet.nearblocks.io/txns/GrVGFVFmGBcNP5xkoA21

In order to support Ethereum wallets, you only need to update your version of `wallet-selector`, and configure it to include the new `ethereum-wallets` module.

Do not worry! it is very simple, check our [**tutorial**](/tools/ethereum-wallets) and working example [**hello world frontend**](https://github.com/near-examples/hello-near-examples/tree/main/frontend).
Do not worry! it is very simple, check our [**tutorial**](/build/web3-apps/ethereum-wallets) and working example [**hello world frontend**](https://github.com/near-examples/hello-near-examples/tree/main/frontend).

---

## Resources

1. [**Integration Tutorial**](/tools/ethereum-wallets)
1. [**Integration Tutorial**](/build/web3-apps/ethereum-wallets)

2. [Hello World Example](https://github.com/near-examples/hello-near-examples/blob/main/frontend/)

Expand Down
59 changes: 0 additions & 59 deletions docs/1.concepts/3.advanced/near-indexer-framework.md

This file was deleted.

29 changes: 13 additions & 16 deletions docs/1.concepts/abstraction/meta-tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,20 @@ but will fail on Bob's shard.

---

## Function access keys in meta transactions
## Function Call Access Keys in Meta Transactions

[Function Call Access Keys](../protocol/access-keys.md#function-call-keys-function-call-keys)
are limited to signing transactions for specific methods on a specific contract.

Function access keys can limit the allowance, the receiving contract, and the
contract methods. The allowance limitation acts slightly strange with meta
transactions.

But first, both the methods and the receiver will be checked as expected. That
is, when the delegate action is unwrapped on Alice's shard, the access key is
loaded from the DB and compared to the function call. If the receiver or method
is not allowed, the function call action fails.
Additionally, they can have an allowance, which limits the amount of tokens that
can be spent on GAS fees. This limit however can be circumvented by using meta
transactions.

For allowance, however, there is no check. All costs have been covered by the
relayer. Hence, even if the allowance of the key is insufficient to make the call
directly, indirectly through meta transaction it will still work.
When a `DelegateAction` is processed in the network, the access key of the sender
is checked against the receiver and the methods called. If the access key is allowed to
make the call, the action is executed.

This behavior is in the spirit of allowance limiting how much financial
resources the user can use from a given account. But if someone were to limit a
function access key to one trivial action by setting a very small allowance,
that is circumventable by going through a relayer. An interesting twist that
comes with the addition of meta transactions.
The allowance however is not checked, as all costs have been covered by the
relayer. Hence, the action will be executed even if the allowance is insufficient
to cover the costs.
8 changes: 6 additions & 2 deletions docs/1.concepts/protocol/access-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
id: access-keys
title: Access Keys
---
In all blockchains, users control their accounts by holding a [`private key`](https://en.wikipedia.org/wiki/Public-key_cryptography) (a secret only they know) and using it to sign [transactions](./transactions.md).

In most blockchains, users control their accounts by holding a single [`private key`](https://en.wikipedia.org/wiki/Public-key_cryptography) (a secret only they know) and using it to sign [transactions](./transactions.md).

![img](@site/static/docs/assets/welcome-pages/access-keys.png)

NEAR accounts present the **unique** feature of being able to hold **multiple Access Keys**, each with its **own set of permissions**. We distinguish two types of Keys:
In NEAR we distinguish two types of Access Keys:

1. `Full-Access Keys`: Have full control over the account, and should **never be shared**
2. `Function-Call Keys`: Can only sign calls for specific contracts, and are **meant to be shared**

Every account in NEAR can hold **multiple keys**, and keys can be added or removed, allowing a
fine-grained control over the account's permissions.

---

## Full-Access Keys {#full-access-keys}
Expand Down
Loading

0 comments on commit c7ee2d6

Please sign in to comment.