Near Blockchain Development Guide For Ethereum Developers
Rishabhraghwendra18
Posted on October 22, 2023
Near is a non-EVM-based blockchain, similar to Solana. The best part of it is that smart contracts can be written in JavaScript/TypeScript.
However, if you haven't built on non-EVM chains before, then this blog is for you. It includes a few new concepts and some interesting facts that a developer should know before building on Near.
Smart contracts are not immutable
On Near, smart contracts are not immutable. A smart contract can be updated or changed after it's deployed unless it changes the state of the previously deployed version of the contract. This feature has both pros and cons.
Pros
- This enables developers to add new features and fix bugs & security issues.
Cons
- This makes the network slightly centralized, as one entity or person has full rights to change the smart contract code as needed. Therefore, before trusting the smart contract, check who has full authority to change the code. It should be linked to a multi-sig wallet.
Access Keys and Private Keys
Access Keys and Private Keys may sound similar but they have different functionalities. Access keys are derived from Private keys but are shareable.
Access keys are those keys that authorize someone to perform specific tasks based on their access permissions. This concept is similar to role-based access in Web2. For example, a company can share its wallet access keys with its employees, allowing them to spend Near tokens on behalf of the company without needing to share the private keys.
These access keys are primarily used for smart contract updates. The access key with full access to a smart contract has the authority to make any changes and publish them to the network. Therefore, it's advisable to ensure complete decentralization of the smart contract by either removing all access keys after smart contract deployment or by giving access keys to a multi-sig wallet.
There are two types of access keys:
-
FullAccess
: This type of access grants full authority over the account, enabling actions like deleting the account, deploying a smart contract, calling any method on any contract, and transferring Near Ⓝ tokens. -
FunctionCall
: These keys only allow permission to call specific methods on a contract, potentially all methods, but do not permit attaching NEAR Ⓝ to the call."
Some Fun facts about Near Ⓝ
Fact 1: Contract codes are not visible on Block Explorer
This is a harsh reality, but the Near Block Explorer (https://nearblocks.io/) does not display the smart contract code, unlike what we can see on Etherscan.
Fact 2: Near has named wallet addresses.
You read it correctly. Unlike other blockchains where you receive an unmemorable hash as your wallet address, Near provides named wallet addresses by default, such as mine: rishabhrag.near
.
This wallet address is referred to as a TLD (Top Level Domain), and it can be used to create sub-domains as well, such as rishabhrag.school.near
.
These are some of the new concepts and facts I discovered when transitioning from an EVM-based blockchain to a non-EVM-based blockchain. I hope they will assist new developers who are venturing into Near, as it took me two days to grasp these new concepts.
If you found this information helpful and would like to show your appreciation, you can donate to me at rishabhrag.near
.
Your contribution would be greatly appreciated.
Thanks for reading, and have a fantastic day! Keep building on Near!
Posted on October 22, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.