This is a cargo workspace for Rust implementations of core Algorand functionality that is exposed to other languages via FFIs.
The core library should be idiomatic Rust. This is essential for maintainability and ease of use. This may result in some extra wrappers around the Rust library for the WASM and FFI bindings because the foreign languages and/or their binding generators might not support all the Rust features.
All the foreign bindings should have consistent interfaces. The way things are done in Python should be the same as the way things are done in JavaScript. Finding the lowest common denominator between languages is the goal, which comes with the trade-off that we might not be fully leveraging foreign language features.
The exported interfaces should be purely functional without any state owned by Rust. This is essential for maintaining consistency between the foreign bindings and memory safety. Some foreign languages, such as kotlin
or go
do not support integrating Rust-owned objects into garbage collection. If Rust owned stateful objects, users of these languages would need to manually manage the lifetimes of the objects or potentially leak memory. See this document for more information on garbage collection.
- algo_models - Currently a spike to determine feasibility of using UniFFI and wasm-pack. Handles msgpack encoding and decoding of Algorand transactions and allows attaching signatures to transactions.
./docs/decisions contains the ADRs for this project. Specific implementations might have their own ADRs in their respective directories.
./docs/research contains various Markdown documents summarize research related to this project
If you are new to Rust or UniFFI, check out the learning resources document
See the contributing guide for recommended editors settings and other guidelines for contribution.