Skip to main content

Kasten 🖃

Binary serialization format with metadata, validation, and configurable hash IDs with proof-of-work (VDF) support.

Kasten is intended to wrap messages for transport agnostic communication.

Sending a message:

import kasten

# Bob creates message

message = b"hello world"
# Mode for any external lib to use
encrypt_mode = 0
packed_message: bytes = kasten.generator.pack.pack(message, 'txt', encrypt_mode)

# We pick the base generator which checks for sha3_256 validity and that's it
# However we could also pick KastenMimcGenerator which has both validity and proof-of-work ratelimiting
# Or, we could make our own. Both parties just need the same logic.
kasten = kasten.generator.KastenBaseGenerator.generate(packed_message)

message_checksum: bytes = kasten.id

# Bob sends packed_message and message_checksum to Alice

Receiving a message:

import kasten

# Alice receives message
bobs_message = b'\x93\xa3txt\x00\xce_F\xc7!\nhello world'
bobs_checksum = b"\xac\x83K=n\xdb\xba\x9aJ\xca:\x82]'9b\xd0\x98\xda\xee'\x9f\xf2\xd7\x94\x9e\x91\x94\x9dnh6\x02\x03\xf0\xfe\x85\xbdrLj]R\xeb;xB@"

# Recreate on Alice's end using the checksum, message, and the same generator
# The generator will automatically check message validity and throw a kasten.exceptions.InvalidID exception if failed
kasten_message = kasten.Kasten(bobs_checksum, bobs_message, kasten.generator.KastenBaseGenerator)

Release files for kasten 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kasten 3.0.0
File Size Uploaded
kasten-3.0.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kasten 3.0.0
File Interpreter ABI Platform
kasten-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.1 kB

Release files / kasten-3.0.0.tar.gz

Download URL kasten-3.0.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
52894af46d6e1339f0d5fa8961892b292f99176848bce11877fe4a435b6782e5
BLAKE2b-256 checksum
How to use checksums
9de332a2f1ac719384bb18df5632aa658c632605b0624d48a1f9797afce037aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

Release files / kasten-3.0.0-py3-none-any.whl

Download URL kasten-3.0.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b22ebdc5f475c2ef9ab74abc36552add0b37732a7ce2be6bd7977ee41b2163b4
BLAKE2b-256 checksum
How to use checksums
de5654fb5cbb834e555fc20c0aed1498d0cffdff95d73a04d5020a6b358cfbc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page