Skip to main content

squeak

GitHub release codecov

Python library for Squeak protocol.

Requirements

  • python3

Test

make test

Install

pip install squeaklib

Examples

Create a squeak, verify its signature with the public key, and decrypt the content:

import time

from bitcoin.core import lx

from squeak.core import CheckSqueak
from squeak.core import MakeSqueakFromStr
from squeak.core.keys import SqueakPrivateKey

private_key = SqueakPrivateKey.generate()

block_height = 0
block_hash = lx('4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b')

content = "Hello world!"
timestamp = int(time.time())

squeak, secret_key = MakeSqueakFromStr(
    private_key,
    content,
    block_height,
    block_hash,
    timestamp,
)

CheckSqueak(squeak)  # No exception raised

print(squeak.GetHash())  # prints b"\x9e\xeb\xbc)N\x94\xe2\x85\x9b(d\x7f\x1e7\xb5{\xcbY\xef\xd4;\xf7P\xfe\x19'Q\xb7\x7f\xbda\xaf"
print(squeak.GetPubKey())  # prints SqueakPublicKey('02d2fe30552bb5ec3b6822cec25b7dd7d4163974e28f2f4ef40d1f9d09086704c6')
print(squeak.GetDecryptedContentStr(secret_key))  # Hello world!

Metadata

Release files for squeaklib 0.13.1

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

Source distribution (sdist)

Source distribution for squeaklib 0.13.1
File Size Uploaded
squeaklib-0.13.1.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for squeaklib 0.13.1
File Interpreter ABI Platform
squeaklib-0.13.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 26.0 kB

Release files / squeaklib-0.13.1.tar.gz

Download URL squeaklib-0.13.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c8465272ea2ea2cf1866480b570710cfa2c17cf3908fae51091123637ffd6d0e
BLAKE2b-256 checksum
How to use checksums
2a5777a33bdeafd1fa0447f5f1ca140c0499c9bf897dcf83d77b4ec66a7e6c49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / squeaklib-0.13.1-py2.py3-none-any.whl

Download URL squeaklib-0.13.1-py2.py3-none-any.whl
Size 15.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a54eaaed9a3d1d4ece203ed8227d348f7a0fd45275194020a0e688f0cd8a1275
BLAKE2b-256 checksum
How to use checksums
9b2cc7eded8c4f24bc40affbf3b7fae389c3bf26094a1b6aca172de5b0c24ccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.13.1 This release

2 release files

0.13.0

2 release files

0.11.0

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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