1- python-bitcoinlib
2- -----------------
1+ # python-bitcoinlib
32
43This Python2/3 library provides an easy interface to the bitcoin data
54structures and protocol. The approach is low-level and "ground up", with a
@@ -8,17 +7,15 @@ focus on providing tools to manipulate the internals of how Bitcoin works.
87"The Swiss Army Knife of the Bitcoin protocol." - Wladimir J. van der Laan
98
109
11- Requirements
12- ------------
10+ ## Requirements
1311
1412 sudo apt-get install libssl-dev
1513
1614The RPC interface, bitcoin.rpc, is designed to work with Bitcoin Core v0.11.0
1715Older versions mostly work but there do exist some incompatibilities.
1816
1917
20- Structure
21- ---------
18+ ## Structure
2219
2320Everything consensus critical is found in the modules under bitcoin.core. This
2421rule is followed pretty strictly, for instance chain parameters are split into
@@ -49,16 +46,14 @@ corresponding Satoshi C++ code uses the same naming conventions: CTransaction,
4946CBlockHeader, nValue etc. Otherwise Python naming conventions are followed.
5047
5148
52- Mutable vs. Immutable objects
53- -----------------------------
49+ # Mutable vs. Immutable objects
5450
5551Like the Bitcoin Core codebase CTransaction is immutable and
5652CMutableTransaction is mutable; unlike the Bitcoin Core codebase this
5753distinction also applies to COutPoint, CTxIn, CTxOut, and CBlock.
5854
5955
60- Endianness Gotchas
61- ------------------
56+ # Endianness Gotchas
6257
6358Rather confusingly Bitcoin Core shows transaction and block hashes as
6459little-endian hex rather than the big-endian the rest of the world uses for
@@ -68,16 +63,14 @@ accomodate this. In addition see b2x() and b2lx() for conversion from bytes to
6863big/little-endian hex.
6964
7065
71- Module import style
72- -------------------
66+ # Module import style
7367
7468While not always good style, it's often convenient for quick scripts if import
7569* can be used. To support that all the modules have __ all__ defined
7670appropriately.
7771
7872
79- Example Code
80- ------------
73+ # Example Code
8174
8275See examples/ directory. For instance this example creates a transaction
8376spending a pay-to-script-hash transaction output:
@@ -89,8 +82,7 @@ Also see dust-b-gone for a simple example of Bitcoin Core wallet interaction
8982through the RPC interface: https://github.com/petertodd/dust-b-gone
9083
9184
92- Selecting the chain to use
93- --------------------------
85+ # Selecting the chain to use
9486
9587Do the following:
9688
@@ -102,8 +94,7 @@ selected is a global variable that changes behavior everywhere, just like in
10294the Satoshi codebase.
10395
10496
105- Unit tests
106- ----------
97+ # Unit tests
10798
10899Under bitcoin/tests using test data from Bitcoin Core. To run them:
109100
@@ -128,8 +119,7 @@ skipped):
128119
129120HTML coverage reports can then be found in the htmlcov/ subdirectory.
130121
131- Documentation
132- -------------
122+ # Documentation
133123
134124Sphinx documentation is in the "doc" subdirectory. Run "make help" from there
135125to see how to build. You will need the Python "sphinx" package installed.
0 commit comments