Endorsing an "official" Smart Contract environment for the Avalanche platform

While the notion of bring-your-own-VM sounds nice and a lot of emphasis is given to the EVM, we all know what a pain it has been to program in a language like Solidity and the numerous vulnerabilities that has resulted in its incorrect (though understandable) use. While promoting the EVM could help with adoption, it will also continue to proliferate the issues that come with it. Resorting to security audits and expecting users to purchase insurance feel like bandages to addressing a more fundamental problem.

Clearly a platform tailored for financial use cases such as Avalanche should endorse a better, safer and verifiable environment for writing contract logic than the EVM. So far (could be just me) there appears to have been little discussion on this topic.

  • Is there work being done on such a language?
  • Is the current position a wait-and-see approach?
  • Should the Avalanche community be promoting one of the existing but lesser known languages like DAML, Move, Pact?

Care to discuss?

7 Likes

At the moment, there is no official development of another smart contract language on Avalanche. But, Avalanche already natively supports many of the use cases and primitives for which Solidity contracts are usually needed on Ethereum and other networks:

All of that is out-of-the-box supported on the AvalancheVM, with no need for additional programming languages, contracts and third party support. And each of those itself has additional programmable capabilities that go beyond the scope of just creating and holding the assets. Solidity and porting over existing Ethereum functionality is hyped because the ecosystem is there, but true strength is in leveraging the native capabilities of the AvalancheVM and PlatformVM.

But, with all that said, developing new VMs that use different contract languages is open to everyone. At he moment it’s not as easy and accessible as it could be, but the foundation which is needed to enable it is there.

Which languages would you like to see supported?

As someone who actually writes Solidity code, I can 100% support the statement that smart contract tooling and development isn’t where it needs to be. I don’t think we have anything in active development at the moment, but I would love to see a world where there are multiple smart contract language VMs running on Avalanche. I’m ready for Python smart contracts. I’m sure there would be a market for a functional language, maybe even something that has native support for formal verification. It’s the wild west! There’s room for a lot of VMs over here. I think there’s a very real possibility that in the future the C-Chain won’t be one of our top 3 most important chains.

5 Likes

I could swear I heard someone whispering WebAssembly… :slight_smile:

1 Like

This has been on my mind as well. Glad you have brought it up.

How would you feel about an implementation with Reach? https://reach.sh/

I think you can already use reach with our C-Chain (minus some integration on their end). I believe they compile their language down to EVM bytecode, so you wouldn’t need to create a whole new virtual machine to use it. It would be REALLY cool if you could write your code once using reach and then deploy on multiple Avalanche VMs.

1 Like

There is at least one chain that embedded Chrome’s JavaScript V8 engine in their VM and just like that, anyone who codes JavaScript feels right at home coding smart contracts on their platform. Plus, V8 is pretty fast.

A super simple smart contract looks like this before compiled:

class HelloWorld {
    init() {} // needs to provide an init function that will be called during deployment
    hello(someone) {
        return "hello, "+ someone
    }
}

module.exports = HelloWorld;

Both V8 and JavaScript are pretty battle hardened at this point, so language bugs should be very rare. But, for sure one would need to be careful integrating V8.

1 Like

Cool! Thanks for sharing! What project was this from?