Skip to main content

Appendix

A - Casper Rust Library

Casper provides low-level bindings for host-side ("external") functions for developers creating smart contracts in other programming languages. Developers can import these functions into a wasm module used as a contract on the Casper Network. Thus, the contract will have access to features specific to the Casper platform which are not supported by general wasm instructions (e.g., accessing the global state, creating new URefs). These are defined and automatically imported if the Casper Rust library is used to develop the contract. For an up-to-date description of exported functions, please visit the casper-contract crate documentation.

B - Serialization Format

The Casper serialization format is used to transfer data between wasm and the Casper host runtime. It is also used to persist global-state data in the Merkle trie. The definition of this format is described in the global state section.

A Rust reference implementation for those implementing this specification in another programming language can be found here:

Additionally, examples of all data types and their serializations are found in the GitHub code base. These examples include a set of useful serialization tests.