Skip to main content

pychainpoint

A Python 3 module for validating Chainpoint blockchain receipts. Fork of pychainpoint.

Installation

$ pip install chainpoint3

Usage

Use the is_valid_receipt function to validate your Chainpoint receipt.

chainpoint_validate.is_valid_receipt(receipt)

#  receipt - the receipt to be validated, as a string

Example

from chainpoint3 import Chainpoint

receipt = '''{
    "header": {
        "chainpoint_version": "1.1",
        "hash_type": "SHA-256",
        "merkle_root": "5faa75ca2c838ceac7fb1b62127cfba51f011813c6c491335c2b69d54dd7d79c",
        "tx_id": "b84a92f28cc9dbdc4cd51834f6595cf97f018b925167c299097754780d7dea09",
        "timestamp": 1445033433
    },
    "target": {
        "target_hash": "cbda53ca51a184b366cbde3cb026987c53021de26fa5aabf814917c894769b65",
        "target_proof": [{
            "parent": "4f0398f4707c7ddb8d5a85508bdaa9e22fb541fa0182ae54f25513b6bd3f8cb9",
            "left": "cbda53ca51a184b366cbde3cb026987c53021de26fa5aabf814917c894769b65",
            "right": "a52d9c0a0b077237f58c7e5b8b38d2dd7756176ca379947a093105574a465685"
        }, {
            "parent": "5faa75ca2c838ceac7fb1b62127cfba51f011813c6c491335c2b69d54dd7d79c",
            "left": "4f0398f4707c7ddb8d5a85508bdaa9e22fb541fa0182ae54f25513b6bd3f8cb9",
            "right": "3bd99c8660a226a62a7df1efc2a296a398ad91e2aa56d68fefd08571a853096e"
        }]
    }
}'''
validator = Chainpoint()
result = validator.is_valid_receipt(receipt)
Sample Valid Result
dict(
  is_valid=True,
  type: 'BTCOpReturn',
  source_id: 'f3be82fe1b5d8f18e009cb9a491781289d2e01678311fe2b2e4e84381aafadee',
  exists: true
)
Sample Invalid Result
dict(
  is_valid=False,
  error='Cannot parse receipt JSON'
)

Metadata

Release files for chainpoint3 0.1.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 chainpoint3 0.1.1
File Size Uploaded Provenance Actions
chainpoint3-0.1.1.tar.gz 6.0 kB Without provenance Details for chainpoint3-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 13.1 kB

Release files / chainpoint3-0.1.1.tar.gz

Download URL chainpoint3-0.1.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
07d6d1f155b6cb78344343ea681450c944091478a8a5780ca71b49c806a456dd
BLAKE2b-256 checksum
How to use checksums
a6c85548a774d9fc2ff029cfc7635dfe73f7f11228d4cd98e77435bbee9f9bd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.6.6

Release files / chainpoint3-0.1.1-py3-none-any.whl

Download URL chainpoint3-0.1.1-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6902a5b3326dfc2dd3d2d688bb7e60322c7628d204daf0c6731d42057dbfe981
BLAKE2b-256 checksum
How to use checksums
9a78610835f5bb19a54248e6010a09c253c8bc3097fdb39adc3d33cf3dd76ba7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.6.6

Security for chainpoint3 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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