MIT-licensed C implementation of getblocktemplate
C Makefile M4 Shell
Latest commit 5e409f2 Dec 1, 2016 @luke-jr luke-jr Merge branch '0.5.x'
Permalink
Failed to load latest commit information.
.gitignore Initial unit tests covering template and parsing Aug 13, 2016
.travis.yml Travis: Remove MemorySanitizer job for now, since it's broken with la… Dec 1, 2016
AUTHORS AUTHORS: Add myself Nov 21, 2014
COPYING COPYING: Update copyright year to 2014 Jan 19, 2014
Makefile.am Bugfix: Wrap test program to ensure the exit code is always 0/pass or… Dec 1, 2016
README "make example" builds example.c if libgcrypt present Jun 22, 2016
autogen.sh No longer call configure from autogen.sh Aug 22, 2014
base58.c base58: Remove now-unused b58digits array Aug 29, 2014
blkmaker.c Merge branch '0.5.x' Dec 1, 2016
blkmaker.h Make new BIP 9 features public May 25, 2016
blkmaker_jansson.c Merge branch '0.5.x' Aug 11, 2016
blkmaker_jansson.h Make new BIP 9 features public May 25, 2016
blktemplate.c ABI break: Remove blktemplate_t.{min,max}nonce, since it was never su… Aug 11, 2016
blktemplate.h ABI break: Remove blktemplate_t.{min,max}nonce, since it was never su… Aug 11, 2016
configure.ac test: Use libgcrypt for SHA256 Aug 13, 2016
example.c Bugfix: example: Deal with build and portability issues Aug 13, 2016
hex.c Add missing copyright headers Jun 13, 2013
libblkmaker_jansson.pc.in pc: Add libbase58 to Requires.private Nov 21, 2014
private.h Merge integer unpacking code Jul 26, 2016
test.c test: Check invalid and uppercase hex data Aug 13, 2016
test.sh Bugfix: Wrap test program to ensure the exit code is always 0/pass or… Dec 1, 2016
testinput.c Add missing copyright headers Jun 13, 2013

README

Dependencies:
	Jansson 2.0 with 'long long' support

Example dependencies:
	Jansson 2.1 (to read JSON from stdin)
	libgcrypt (for SHA256)

For usage, check out example.c. Run "make example" to build it.

Note that you must assign blkmk_sha256_impl to a function pointer:
	bool mysha256(void *hash_out, const void *data, size_t datasz)
hash_out must be able to overlap with data!

Also note that you should NOT roll ntime for data retrieved without explicitly
checking that it falls within the template's limitations (mintime, maxtime,
mintimeoff, and maxtimeoff); read the BIP 23 specification in detail to
understand how they work. It is usually best to simply get more data as often
as it is needed. For blkmk_get_mdata, you may specify that you intend to roll
the ntime header exactly once per second past usetime - it will then set
*out_expires such that the expiration occurs before you roll beyond any ntime
limits. If you are rolling ntime at any rate other than once per second, you
should NOT specify can_roll_ntime to blkmk_get_mdata, and must check that your
usage falls within the explicit template limits yourself.