Oct 4, 2020
Casper Releases Node 0.20
In our largest release since the Testnet, our June release (version 0.20) adds contract headers, contract upgrades and support for multiple key types (secp256k1, secp256r1, ed25519) for accounts, bonding and transaction signing. The combination of these elements in this updated model allow for sophisticated smart contracts to be written and improve the experience of both using and maintaining stored session logic and smart contracts on the Casper network.
Technical Details about this Release
The Casper blockchain executes wasm contracts that are either passed in a session code as part of a transaction (one-time execution), or called from an address in the global blockchain state store. Casper transactions are meta-transactions, containing both payment code and session code in a single deployment. Both payment and session code can have arguments, which are passed in at runtime. With this release, these arguments must be named and typed. Once named, it’s possible to send arguments in any order when invoking the contract.
Technical Release Notes for Contract Headers:
- Users can now store a contract package at a stable hash. Contract packages can optionally include user defined access control groups (as a set of specific Urefs stored under a label).
- Each contract package is issued an access uref required for administration of the contract package, issued to the account that created the package. This Uref can be distributed if desired to allow multiple maintainers.
- Users can store one or more versions of their logic in a contract package under a stable hash, and manage those versions individually. Individual versions can be disabled or left available as desired (for instance, to allow a transition period between versions). This replaces the previous mechanism of storing and updating a contract under a Uref.
- Each version of stored logic can have one or more entry points defined. Each entry point can have zero or more named and typed arguments defined for it. Each entry point can be public / anonymous (allows any caller) or require inclusion in a user defined access group (defined and managed on the contract package). Additionally, entry points can be defined as session (run in the calling account’s context) or Contract (run in the contract’s context).
- Stored logic can be accessed directly using either the contract package hash and the sequential version of the logic, or the version specific contract hash. Alternatively, if a contract package hash is provided without a contract version the highest available version of that contract package will be defaulted to (note however it is the caller’s responsibility to ensure compatibility).
- The metadata describing contract packages and contract versions is systemically checked and is queryable; thus it is possible to inspect the definition of a contract package, its contract versions, and their endpoints including arguments and return values.
- Helper functions are provided in the contract_api to make using these new features easy for contract writers.
Rust Contracts DSL
The easiest way to use contract headers is to use the contracts DSL. These are macros that add the code to set up the contract in the runtime and create the entry points for the contracts. Check out the Developer guide for instructions on how to use them.
Support for Multiple Key Types
The Casper network now supports multiple encryption algorithms for account keys. Developers can now use any of these key types on the system. With secure enclave compatibility, Apple devices can function as hardware wallets for Casper accounts.
- Secp256k1 — Ethereum style keys
- Secp256r1 — Apple secure enclave keys
- Ed25519 — Casper key
We believe that offering key storage on devices with a robust recovery story is an imperative feature to any network or protocol. Our system supports robust key recovery functions such as key delegation and even on chain social recovery (it’s possible to assign several other accounts recovery permissions in a multi-signature fashion).
We continue to work on optimizations to improve the performance of the network. In this release we have ported the token transfer function to the host side of the contract runtime. This enables token transfers to take place without requiring wasm to be passed or stored in the global state.
Description of release packaging
Release packaging includes:
- Docker images available via DockerHub
- Debian package
- RPM package
Where do developers go to learn more and get started?
At release, links to installation packages and relevant documentation is available on GitHub.
- Packages available on Github
- Docs available at: https://docs.casperlabs.io/en/latest/dapp-dev-guide/index.html
Where will bugs be filed?
Report a bug on GitHub
Where do developers go for support?
Join our community on Discord: https://discord.gg/Q38s3Vh
CasperLabs is the blockchain platform purpose-built to scale opportunity for everyone. Building toward blockchain’s next frontier, CasperLabs is designed for real-world applications without sacrificing usability, cost, decentralization, or security. CasperLabs removes the barriers that prevent mainstream blockchain adoption by making blockchain friendly to use, open to the world, and future-proof to support innovations today and tomorrow. Guided by open-source principles and built from the ground up to empower individuals, the team seeks to provide an equitable foundation made for long-lasting impact.
Sign up for our newsletter!