1/ In the series of "Let's explore #Ethereum killers Tuesday" we have NEAR blockchain or @NEARProtocol in Twitter

If you are a smart contract dev or blockchain investor you will find this thread interesting.

👇👇👇
2/ I participated in an online hackathon sponsored by NEAR: "Hack the rainbow".

This was around NEAR's Rainbow bridge product that allows tokens to move forth and back between NEAR and Ethereum blockchains.

gitcoin.co/hackathon/hack…
3/ The good

👇👇👇

NEAR project started back in 2018 as "decentralised platform", aim to be the developer-friendly blockchain solution. However, it was not until 2019 when the project evolved a full blockchain and things became more interesting.
4/ NEAR is a beast

It is the first blockchain with both state and transaction sharding.

While there are earlier blockchains like @zilliqa that shard the transactions (processing), NEAR is the first one that shards both state and transactions.
5/ Sharding the state means that NEAR shards can operate parallel.

* Validator nodes need to process transactions only for their own shard

* Blockchain can scale horizontally by just adding more nodes

* Transaction throughput can grow indefinitely
6/ State sharding is what Ethereum 2.0 promises, but it wont there be until Ethereum 2.0 reached its phase 4 ro phase 6, or "ever" in #DeFi time.

Expect Ethereum to match this performance around 2025.

eth.wiki/en/sharding/sh…
7/ Thus, in theory, unlike other competing blockchains out there, NEAR does not offer just "making more mileage out of existing tech" like AVA, EOS or Solana, but have innovated in the field of theoretical consensus, making it truly different.
8/ NEAR offers smart contracts in two languages: Rust (#rustlang) and AssemblyScript (#assemblyscript) - a statically typed variant of #TypeScript.

Smart contracts are compiled down to #WebAssembly (WASM) runtime. This is similar to EOS, Edgeware.
9/ A lot of effort has been put into the developer experience and trying to attract developers to the new blockchain.

NEAR was originally advertised as "developer friendliest blockchain."
10/ In theory, using Rust can make smart contract programming safer.

The compiler and run-time security features catch errors when in Solidity you need to run an external static analyser (mythril) and hope for the best.

An example is integer overflow: stackoverflow.com/a/64136471/315…
11/ NEAR did early presale for accredited investors in 2019.

Retail investors could buy NEAR in Aug 2020 Coinlist sale that was a complete shitshow. NEAR team members were advised not to talk about Coinlist or the token sale.

12/ The token distribution is heavily skewed towards early private investors.

Thus, this is a "VC chain". Usually what we see is that early investors offload their bags as soon as possible, so NEAR near term price action is likely to be ugly. 🔥

near.org/blog/near-toke…
13/ How do sharded transactions work?

With sharding, you are not "losing the composability" like some proponents who do not understand technology.

In the software developer language, every cross-smart contract transaction is a cross-shard transaction
and is a promise.
14/ The caller SC creates a promise that is eventually executed in another callee SC.
Then the caller SC creates another promise that calls back itself when the first promise is done.

You can find the pattern here in my hackathon submission:

github.com/miohtama/advan…
15/ Here comes the difference to #Ethereum: Each shard is finalised independently, transactions across cross-shards do not roll back the state automatically.

In Ethereum if any of transaction in a smart contract chain fail with revert() the whole transaction is rolled back.
16/ Thus, in NEAR, developers of smart contracts need to design around the fact that the state is either pending with promises in progress or final, all cross contract calls done.

This is similar to commit cycle management in database design.
17/ Also, due to the design of NEAR protocol, there are no re-entrancy attacks like in Ethereum, because all cross contract calls can be only processed as promises after your smart contract initiator call is done.

(We come back to this later for nitpicking)
18/ Cross contract call creates a promise that adds a delay of one block. Each promise to process the return value adds delay of another block.

If Ethereum blockchain is 12 seconds, this means that NEAR can match this with 6 cross contract calls in the same wall clock time.
19/ Assuming NEAR shards have 1 second block time (not sure about this figure, I did not find stats.
20/ / The bad

NEAR advertises itself as a developer-friendly blockchain. They are not yet there.

The toolchain is immature and some of the design choices are suboptimal. For a smart contract developer, it makes NEAR less attractive choice.
21/ Even though NEAR team is fumbling, it is not fumbling as badly as EOS or others.

EOS focused solely on their block producers, completely missed boat on DeFi.

At least NEAR is going after high-quality DeFi projects, stablecoins.
22/ Ex 1: Rust toolchain

The toolchain cannot compile multiple smart contracts in a single project, but you need to create a new Rust library for each contract

stackoverflow.com/questions/6411…

If you are a senior developer you know this kind of project structuring is just insanity.
23/ Programming the smart contracts is done with NEAR Rust SDK.

docs.rs/near-sdk/2.0.0…

It is still underdocumented in the bits you need documentation most.
24/ For example, declaring smart contract bindings using a macro called near_bindgen, the first macro encounter:

docs.rs/near-sdk/2.0.0…

Zero documentation, zero comments.

github.com/near/near-sdk-…

It is difficult to tell what this thing is supposed to do and WHY.
25/ Promise errors cannot be resolved.

It is like @soliditylang 0.3. You know something failed in a smart contract call, but you have no idea if it is an recoverable error. There are no error returns. Senior #Ethereum developers know how bad this is.

stackoverflow.com/a/64054342/315…
26/ / Smart contract arguments are serialised.But sometimes they are serialised using Borsh ( borsh.io ) sometimes using JSON (promise).

What is the point of using JSON in the first place for the system that needs to push most out of each CPU cycle to scale?
27/ Take one of the efficient serialisation libraries and make it standard across the ecosystem.

As a hint, it is unlikely to be JSON (NEAR team already knows this well)

E.g.

- Dealing amounts like unit128 is not JSON's forte

- JSON is inefficient

en.wikipedia.org/wiki/Compariso…
28/ / NEP-21 token standard is a direct copy from ERC-20.

However, no thought was spent when cloning ERC-20, including the broken approve() / transferFrom() UX pattern and all of those lost token transfers because of it.
29/ Namely, the approve() pattern was left in ERC-20 originally because of fear of re-entrancy attacks.

NEAR cannot have re-entrancy attacks, so this choice does not make any sense and smells simple cargo culting.
30/ Luckily the team is now pushing for better allowance free token standard

github.com/nearprotocol/N…

Hopefully NEP-21 will be burnt soon and be forgotten, before it becomes widespread.
31/ NEAR does not have explicit events like in Solidity.
Instead, it has indexer and transaction status.

docs.near.org/docs/api/rpc#t…
32/ There is no way to tell NEAR "Give me all token transfer events since 2020" or "give me all token transfers to this address in an exchange hot wallet".

Integration with wallets and exchanges is hard until this can be queried with one liner.
33/ How NEAR can success?

Where do we find happy lemurs?

👇👇👇
34/ Although NEAR scales near infinitely, it is no argument for developers today, or likely for the next 3-4 years. You is mission is not to fix #Ethereum mainnet.
35/ NEAR is working on "EVM shard" to make it easier to attract existing Solidity projects.

Then NEAR is just yet another Ethereum chain, no different from @avalancheavax, @tronfoundation or Binance Smart Chain.
36/ Furthermore, Ethereum smart contracts need to be completely rewritten any case to take advance of the sharding of @NEARProtocol .

While you rewrite these, you could as well rewrite in #rustlang.
37/ NEAR also cannot compete as better EVM against L2 EVM scaling efforts of Ethereum.

Providing a Frankenstein EVM that does not use ETH as gas is not going to attract hardcore #Ethereum developers.
See: @RSKsmart, @Tronfoundation, @qtumofficial and other failed efforts.
38/ NEAR is working on two different programming languages: Rust (#rustlang) and AssemblyScript (#assemblyscript).

AssemblyScript is simpler, targeted towards more junior, more web, developers.

I think this is a wasted effort.
39/ Smart contract programming is for smart, senior, people who have a good understanding of computer science. You need to be disciplined and well versed in many low-level topics.

Dumbing down the development is not going to make the developers themselves any smarter.
40/ Thus, making easy smart contract language does not make sense. Real smart contract and #DeFi developers are already senior and use the best tool for the job, #rustlang.

Creating a toy language SDK for toy projects makes no business sense. You are not going to attract value.
41/ What @NEARProtocol could do instead?
42/ NEAR could live up its promise and build a better developer and user experience.

Because no one is going to come if the only selling argument is "cheaper transactions." In that case, we would all be using @Ripple now.
43/ Make tokens on NEAR trivial to integrate any backend, like payments and exchanges.

Solve the problems why it is so hard to use Ethereum tokens, like a need for ETH in the wallet for the gas.
44/ Make creating token-based NEAR dApps easy.

However, #Ethereum is already giving you a run for your money here due to the vast amount of example code.
45/ Make NEAR trivial to integrate mobile wallets with a good SDK, unlike Ethereum.

Wallets should not need massive backends for things like getting tokens in the user wallet and their icons.
46/ Make NEAR smart contract development more secure by using Rust.

Look top @soliditylang security issues and catch them during the compile time. Insecure code does not compile.

ethereum.stackexchange.com/questions/8551…
47/ Make NEAR tokens more attractive than ERC-20 with better features, like automatic add to wallets on the first transfer and token icons out of the box.

No more guides "how to add the custom token in MetaMask" or "how to buy ETH".
48/ When you have a good token standard and support ecosystem, then get over ones like $USDT and $USDC.

Having wide, trivial, wallet support and cheap transactions for stablecoins would be a killer application alone.
49/ That's all this time folks.

I will give @nearprotocol 50% / 50% chance to succeed.

NEAR has better fundamentals than any of other existing blockchains. But the developer experience is not good and scalability promise does not mean anything at the moment.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with 🐮 Mikko Ohtamaa

🐮 Mikko Ohtamaa Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @moo9000

9 Sep
1/ Your daily dose of $SUSHI 🍣🍣🍣

Because what else a #defi degens would needle in their veins on a Wednesday morning.

INCLUDES MIGRATION AND PENDING VOTING RESULTS

👇👇👇
2/ The first and the last of $SUSHI dev fund and deployment multi-signature wallet voting is almost at its end.

Six hours to go, but voting is trickling down.
3/ 6 out of 9 members of this upcoming wallet can confirm transactions as Sushi the unregistered organisation
Read 18 tweets
7 Sep
1/ THE SAGA OF SUSHI 🍣🍣🍣

Things that went right and wrong in $SUSHI.

Enter the thread 👇
2/ With Sushi" I mean commentators, farmers, traders, exchanges and all controversial characters in the saga. You.

There are only controversial characters on this one.
3/ There are no good guys.

Users were greedy - they though 1500% APY can be sustained.

Exchanges were greedy - Binance listed $SUSHI in 2 days when it usually takes months for a good project.
Read 47 tweets
6 Jun 19
@Johnny_Nashbro @block_one_ 2/ If you are building an vertical application (securities) and a blockchain (settlement system) at the same time you are trying to solve two problems. 1) Compliance and 2) Scalability... and everything between them.
@Johnny_Nashbro @block_one_ 3/ Compliance does not depend on scalability or vice versa. This is called a separation of concerns in development.

en.wikipedia.org/wiki/Separatio…

Both of these problems can be solved independently.
@Johnny_Nashbro @block_one_ 4/ Here is my rough image what are business problems (a lot of phone calls with regulators and lawyers), what are engineering problems (software development) and what are hardcore pure math a science problems in #blockchain space
Read 18 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!