Giter Club home page Giter Club logo

btclib's People

Contributors

alessandromiola avatar andreabrandoli90 avatar clelli avatar danielefornaro avatar fametrano avatar fberetta8 avatar giacomocaironi avatar gionasoldati avatar giubby84 avatar hodlwave avatar leocomandini avatar nsollazzo avatar pmazzocchi avatar pre-commit-ci[bot] avatar sourcery-ai[bot] avatar st333p avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btclib's Issues

Help wanted: Creating a list of derived addresses from a xPub string

Hey,

I'm just starting out with Python, so I'm not sure how to accomplish this:

For example, I would have string key = 'zpub6rLtzSoXnXKPXHroRKGCwuRVHjgA5YL6oUkdZnCfbDLdtAKNXb1FX1EmPUYR1uYMRBpngvkdJwxqhLvM46trRy5MRb7oYdSLbb4w5VC4i3z'

How would I make the btclib package return a list like this?

0: bc1qvqatyv2xynyanrej2fcutj6w5yugy0gc9jx2nn
1: bc1q360p67y3jvards9f2eud5rlu07q8ampfp35vp7
2: bc1qs4k3p9w4ke5np3lr3lgnma9jcaxedau8mpwawu
3: bc1qpk48z0s7gvyrupm2wmd7nr0fdzkxa42372ver2

Any help would be appreciated. Thanks! :-)

b58 package missing

Hello, I installed the package via pip but when I want to use the b58 module like
from btclib import b58
I got the following error:
ImportError: cannot import name 'b58' from 'btclib' (/usr/local/lib/python3.9/site-packages/btclib/__init__.py)

Checking the packages shows that indeed it is not present
CleanShot 2022-02-04 at 00 07 10@2x

Any ideas what is wrong or how can I get that module installed?

Error that no btclib module

Hello,
Your code looks useful. However, I've installed the btclib under the python 3.6.5 and all went well with installation but when I try to run some of the files I get errors that there is no btclib module.

remove warning from release process

see RELEASE.md

/Users/ferdi/.pyenv/versions/btclib_3.11.1/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'btclib.mnemonic._data' as data is deprecated, please list it in `packages`.
    !!


    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'btclib.mnemonic._data' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'btclib.mnemonic._data' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'btclib.mnemonic._data' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.


!!

  check.warn(importable)
copying btclib/py.typed -> build/lib/btclib
creating build/lib/btclib/_data
copying btclib/_data/mainnet.json -> build/lib/btclib/_data
copying btclib/_data/regtest.json -> build/lib/btclib/_data
copying btclib/_data/testnet.json -> build/lib/btclib/_data
creating build/lib/btclib/mnemonic/_data
copying btclib/mnemonic/_data/english.txt -> build/lib/btclib/mnemonic/_data
copying btclib/mnemonic/_data/italian.txt -> build/lib/btclib/mnemonic/_data
creating build/lib/btclib/ecc/_data
copying btclib/ecc/_data/ec_Brainpool.json -> build/lib/btclib/ecc/_data
copying btclib/ecc/_data/ec_NIST.json -> build/lib/btclib/ecc/_data
copying btclib/ecc/_data/ec_SEC2v1_insecure.json -> build/lib/btclib/ecc/_data
copying btclib/ecc/_data/ec_SEC2v2.json -> build/lib/btclib/ecc/_data
/Users/ferdi/.pyenv/versions/btclib_3.11.1/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
installing to build/bdist.macosx-13.1-x86_64/wheel
running install

Valid taproot signature may not must has length of 64

Describe the bug
It seems not right to check signature of taproot is valid by assert length of it equals 64:

if any(signature and len(signature) != 64 for signature in signatures):

To Reproduce
There is an example on how to make a valid taproot signature which length is not 64:
bitcoinjs/bitcoinjs-lib#1934

Environment (please complete the following information):

  • OS: ubuntu
  • Python version: 3.10.13
  • btclib version: da0cfc1 master 2023.12.12

Import Error when try from btclib.tx import Tx

Describe the bug
When I try to import Tx from btclib.tx, Import Error raised.

To Reproduce
Steps to reproduce the behavior:
1.py

from btclib.tx import Tx
In [1]: from btclib.tx import Tx                                                                                                                                          
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-28f1196e232b> in <module>
----> 1 from btclib.tx import Tx

~/.local/lib/python3.8/site-packages/btclib/tx/__init__.py in <module>
     12 
     13 from btclib.tx.out_point import OutPoint
---> 14 from btclib.tx.tx import Tx, join_txs
     15 from btclib.tx.tx_in import TxIn
     16 from btclib.tx.tx_out import TxOut

~/.local/lib/python3.8/site-packages/btclib/tx/tx.py in <module>
     37 from btclib.exceptions import BTClibValueError
     38 from btclib.hashes import hash256
---> 39 from btclib.script import Witness
     40 from btclib.tx.tx_in import TX_IN_COMPARES_WITNESS, TxIn
     41 from btclib.tx.tx_out import TxOut

~/.local/lib/python3.8/site-packages/btclib/script/__init__.py in <module>
     12 
     13 from btclib.script.script import Command, Script, op_int, parse, serialize
---> 14 from btclib.script.script_pub_key import (
     15     ScriptPubKey,
     16     address,

~/.local/lib/python3.8/site-packages/btclib/script/script_pub_key.py in <module>
     15 from typing import Callable, Sequence
     16 
---> 17 from btclib import b32, b58, var_bytes
     18 from btclib.alias import Octets, String
     19 from btclib.ec import point_from_octets

~/.local/lib/python3.8/site-packages/btclib/b32.py in <module>
     52 from btclib.hashes import hash160, sha256
     53 from btclib.network import NETWORKS, network_from_key_value
---> 54 from btclib.script import TaprootScriptTree, output_pubkey
     55 from btclib.to_pub_key import Key, pub_keyinfo_from_key
     56 from btclib.utils import bytes_from_octets

ImportError: cannot import name 'TaprootScriptTree' from partially initialized module 'btclib.script' (most likely due to a circular import) (/home/wanlin_wang_cobo_com/.local/lib/python3.8/site-packages/btclib/script/__init__.py)

Expected behavior
Successfully imported.

Screenshots
N/A

Environment (please complete the following information):

  • OS: Ubuntu 20.04 LTS
  • Python version 3.8.10
  • btclib version latest(2023.2.3)

Additional context
I've tried 2023.1.17 version, still have this problem. I'm curious nobody else occur this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.