NEAR uses the account names system instead of just public keys. It creates a challenge on how to create, manage and delete accounts.
-
-
Prikaži ovu nit
-
Each account can have no, one or multiple access keys. Keys can have different permissions. The key management creates another challenge. You can add, remove, modify access keys on your account.
Prikaži ovu nit -
You can deploy contracts and call functions on contracts. And finally you can stake and simply transfer tokens. All of these actions and combinations of actions create a huge variety of different transaction types.
Prikaži ovu nit -
Imagine having a transaction type that creates an account with some initial balance and some given access key. It also may deploy a contract on it and maybe call a function on it to initialize the state. The number of combinations grows exponentially.
Prikaži ovu nit -
And NEAR had all those types in the early versions. It was a nightmare to handle it within a Runtime. The security of all these transactions was questionable. And finally we needed to update external API and tools with every new transaction type.
Prikaži ovu nit -
Until NEAR has switched to a single type transaction, that contains a batch of atomic actions. The transaction either executes the entire batch of actions or rolls back all the changes. The batch of actions is fully prepaid by the transaction signer.
Prikaži ovu nit -
The actions are: - Create account - Deploy Contract - Transfer - Function call - Stake - Add key - Delete key - Delete account
Prikaži ovu nit -
Using a combination of actions we can perform very complex transactions. The example above for a creating and initializing a new account is: 1. Create account 2. Deploy contract 3. Transfer 4. Add key 5. Function call
Prikaži ovu nit -
To transform a transaction to a receipt all we need is to charge the account with the full cost of all actions and send the new receipt to a shard of a receiver. It makes the Runtime logic much simpler, easier to understand and more secure.
Prikaži ovu nit -
The best part of actions is that they are accessible from a smart contract with exactly the same functionality as from a new transaction. So you can implement almost everything with a contract API.
Prikaži ovu nit -
For example a multi-sig account factory contract. This contract can create a new account, deploy multi-sig code on it, transfer some initial balance, add N given access keys and initialize the contract for these keys. All in one batch of actions in one receipt.
Prikaži ovu nit -
Please ask questions. I'm always excited to share ideas and answer questions regarding our design decisions. The technical documentation for actions is available here: https://nomicon.io/Runtime/Actions.html …
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
