Skip to content

Commit 4ece304

Browse files
committed
add method to check if address is bech32
1 parent b6f3ce1 commit 4ece304

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ python-bitcoin-utils
33

44
This is a bitcoin library that provides tools/utilities to interact with the Bitcoin network. One of the primary goals of the library is to explain the low-level details of Bitcoin. The code is easy to read and properly documented explaining in detail all the thorny aspects of the implementation. It is a low-level library which assumes some high-level understanding of how Bitcoin works. In the future this might change.
55

6-
This is an early version of the library (v0.4.9) and currently, it supports private/public keys, all type of addresses and creation of any transaction (incl. segwit) with all SIGHASH types. All script op codes are included. Timelock and non-standanrd transactions are supported. Currently, a simple node proxy exists to enable easy calls to a Bitcoin core node. Extra functionality will be added continuously and the documentation will be improved as the work progresses.
6+
This is an early version of the library (v0.4.10) and currently, it supports private/public keys, all type of addresses and creation of any transaction (incl. segwit) with all SIGHASH types. All script op codes are included. Timelock and non-standanrd transactions are supported. Currently, a simple node proxy exists to enable easy calls to a Bitcoin core node. Extra functionality will be added continuously and the documentation will be improved as the work progresses.
77

88
The API documentation can be build with Sphinx but is also available as a PDF for convenience. One can currently use the library for experimenting and learning the inner workings of Bitcoin. It is not meant for production yet and parts of the API might be updated with new versions.
99

bitcoinutils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '0.4.9'
1+
__version__ = '0.4.10'
22

bitcoinutils/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,15 @@ def prepend_compact_size(data):
4747
return prefix + data
4848

4949

50+
'''
51+
Returns if an address (string) is bech32 or not
52+
TODO improve by checking if valid, etc.
53+
'''
54+
def is_address_bech32(address):
55+
if (address.startswith('bc') or
56+
address.startswith('tb')):
57+
return True
58+
59+
return False
60+
61+

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
# built documents.
5959
#
6060
# The short X.Y version.
61-
version = u'0.4.9'
61+
version = u'0.4.10'
6262
# The full version, including alpha/beta/rc tags.
63-
release = u'0.4.9'
63+
release = u'0.4.10'
6464

6565
# The language for content autogenerated by Sphinx. Refer to documentation
6666
# for a list of supported languages.

0 commit comments

Comments
 (0)