canoser
A python implementation of the LCS(Libra Canonical Serialization) for the Libra network.
What it is and what it does
Canoser is a Python library that implements canonical serialization (LCS) for the Libra blockchain network. It allows you to define data structures by inheriting from base classes like Struct, RustEnum, and RustOptional, then automatically serialize and deserialize them in a deterministic byte format. This is essential in blockchain consensus where independent validators need to compute identical hashes of the same logical data, even when running different implementations.
The library supports complex nested structures including arrays, maps, tuples, enums with variants, and optional types—all mirroring Rust/Libra semantics. Once you define a structure's fields, serialization and deserialization happen automatically without manual encoding logic. However, the package has been abandoned since 2020-04-02 and its repository is archived, meaning it receives no updates, security patches, or compatibility fixes for newer Python releases.
Use it for:
- Building Libra network clients or validators that need to serialize transaction arguments and account state in the canonical format.
- Comparing data structures across independent Libra implementations by hashing their canonical serializations.
- Defining and exchanging complex nested data types (enums, optional fields, arrays) that must serialize identically across different languages.
- Testing or prototyping Libra consensus logic in Python where canonical byte representation must match reference implementations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Canoser implements canonical serialization for Libra network data structures, enabling byte-consistent encoding and decoding of Python objects that can be safely compared across independent implementations.
No, unless you are maintaining legacy Libra integration code written before 2020. The package is abandoned with no active maintenance, no security updates, and no guarantee of compatibility with modern Python versions or current Libra ecosystem evolution. For new projects, seek an actively maintained canonical serialization library.
Install
canoser on PyPI
pip
pip install canoseruv
uv add canoserpoetry
poetry add canoserInstalling canoser
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2020-04-02 and the repository was archived. No active maintenance means no security updates or compatibility fixes for modern Python versions beyond what was last tested.
License in practice
Licensed under MIT (permissive), so you may use, modify, and distribute the package freely in commercial or private projects with minimal restrictions.
Quickstart
from canoser import Struct, Uint8, Uint64
class MyData(Struct):
_fields = [
('id', Uint64),
('bytes_field', [Uint8])
]
obj = MyData(id=1, bytes_field=[1, 2, 3])
serialized = obj.serialize()
deserialized = MyData.deserialize(serialized)
Requires Python 3.6 or above; package is no longer maintained, so compatibility with Python versions released after 2020 is not guaranteed.
Verify before relying
- Whether the package works reliably with Python versions beyond those tested before 2020.
- Whether serialized output remains compatible with current Libra network validators or if the spec has evolved since 2020.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,325 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 76,320/month — #14,635 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: canoser-0.8.2-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
poly-eip712-structsConstructs and serializes EIP-712 structured…
permissive · top 5,000 on PyPI
cbor2Encodes and decodes CBOR (Concise Binary Object…
permissive · top 1,000 on PyPI
mikeshardmind-base2048Encodes binary data into text using base2048, a…
copyleft · top 15,000 on PyPI
jcsCanonicalizes JSON according to RFC 8785,…
permissive · top 5,000 on PyPI
cobsEncodes and decodes data using Consistent…
permissive · top 15,000 on PyPI
canonicaljsonEncodes Python objects to canonical JSON with…
permissive · top 15,000 on PyPI
oslo.serializationoslo.serialization provides serialization and…
permissive · top 5,000 on PyPI
serpentSerpent serializes Python objects to…
permissive · top 15,000 on PyPI
dissect.cstructParse binary data using C-like structure…
permissive · top 15,000 on PyPI
rfc8785Implements RFC 8785 (JSON Canonicalization…
permissive · top 5,000 on PyPI