Skip to main content

Bitcoin Output Script Descriptors (with Miniscript)

Project description

Bitcoin Script Descriptors, with Miniscript extension

About

In Bitcoin, output Scripts are used to express the conditions by which the amount associated with the output may be spent.

Output Script Descriptors are a simple language which can be used to describe such Scripts generally and precisely. Bitcoin Output Script Descriptors are defined in a set of BIPs, the main one being bip-0380.

Miniscript is a language for writing (a subset of) Bitcoin Scripts in a structured way. It is an extension to Output Script Descriptors and is currently only defined within P2WSH context.

Miniscript permits:

  • To safely extend the Output Descriptor language to many more scripting features thanks to the typing system (composition).
  • Statical analysis of spending conditions, maximum spending cost of each branch, security properties, third-party malleability.
  • General satisfaction of any correctly typed ("valid") Miniscript. The satisfaction itself is also analyzable.
  • To extend the possibilities of external signers, because of all of the above and since it carries enough metadata.

Miniscript guarantees:

  • That for any statically-analyzed as "safe" Script, a witness can be constructed in the bounds of the consensus and standardness rules (standardness complete).
  • That unless the conditions of the Miniscript are met, no witness can be created for the Script (consensus sound).
  • Third-party malleability protection for the satisfaction of a sane Miniscript, which is too complex to summarize here.

This library provides an implementation of Segwit-native Output Descriptors and of Miniscript (to be used within wsh() descriptors), with a minimal amount of dependencies.

WIP: this is not ready for any real use!

This library is still a work in progress. It contains known bugs (in the satisfier for instance) and there are probably many unknown ones.

Still, it's ready for hacking around and contributions are welcome. See the issue tracker for ideas on where to start.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bip380-0.0.3.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

bip380-0.0.3-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file bip380-0.0.3.tar.gz.

File metadata

  • Download URL: bip380-0.0.3.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for bip380-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bc4c4a48c06ccb0b3d3840c08e10be049f22373484726e271e6af8094a76c619
MD5 43f162e510acd864c17bc6b2d03746fa
BLAKE2b-256 7ce55c2f9d918e02e22a02899a9a0c6604321545f3c742ecb12510f749781406

See more details on using hashes here.

File details

Details for the file bip380-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: bip380-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for bip380-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b871910d2ff307314c37379575fde43682637d242d5d7a3382d0b55eba2a1bd
MD5 0d4ccfa58c0e57c6b96103c1ec0dda6c
BLAKE2b-256 4c523c9fa8e18ef0a1e1a65871049a5692c54eb615d2c3e99b93899e7997711e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page