network-schema

module
v0.0.0-...-4b30682 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License: MIT

README

masslbs networks schema

This repository specifies the structure and content of the communication between Relays and their Clients. It assumes familiarity with the general architecture of the mass market system and the smart contracts it uses.

On an abstract level, the Relays build an Append-Only Log per registered Store. These logs are accessible via a Request/Response scheme. The Clients cryptographically sign Events and write them to the Relay. A Relay keeps track of which Events were send and received from which Client and thus is able to push Events to Clients that haven't written them such that all Clients can build the same state of a Store eventually.

For a detailed description of each message see comments in the individual .proto files and the CHANGELOG.md.

For a detailed description of how Events are signed as well as the HTTP Reqeusts acompanying the WebSocket connection, see our documentation page.

This repo also contains a python folder with the code for the massmarket-hash-event pip package, used in our test suite.

tooling

Protobuf

Python Package

  • pyproject
  • web3.py for eth_typedData v4
  • pytest

License Maintenance

Updating the python package
nix develop
# to update schema_pb2.(py|pyi)
make
cd python
# make sure the tests pass first
pytest
# -n to switch off venv. nix already gives us that
$PYTHON -m build -n
# see bitwarden for login info
$PYTHON -m twine upload dist/*

General Principals

  • anything that mutates the shops state is an event and needs to be signed.
  • ideally the relays would not create any events; the relay should be limited to a sandboxed set events that it can create. If it attempts to create any other event it should be considered invalid.

LICENSE

MIT

Directories

Path Synopsis
go
cbor
Package cbor provides utility functions for encoding and decoding CBOR data using default options.
Package cbor provides utility functions for encoding and decoding CBOR data using default options.
hamt
Package hamt implements a Hash Array Mapped Trie (HAMT), a persistent data structure for efficiently storing key-value pairs.
Package hamt implements a Hash Array Mapped Trie (HAMT), a persistent data structure for efficiently storing key-value pairs.
mmr
Package mmr provides merkle mountain range abstraction over the implementation of the datatrails-merklelog package.
Package mmr provides merkle mountain range abstraction over the implementation of the datatrails-merklelog package.
objects
Package objects contains the type definitions and encodingfunctions for the shop schema
Package objects contains the type definitions and encodingfunctions for the shop schema
patch
Package patch provides a way to patch the contents of a shop.
Package patch provides a way to patch the contents of a shop.
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL