MIT-licensed C implementation of getblocktemplate
C Makefile M4 Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
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 Cory Fields Jul 23, 2016
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 Revert Segnet support Jul 28, 2016
blkmaker.c Add blktemplate_t.has_cbvalue boolean to differentiate between cbvalu… Feb 17, 2018
blkmaker.h Bump versions for 0.6.0 Dec 23, 2017
blkmaker_jansson.c Add blktemplate_t.has_cbvalue boolean to differentiate between cbvalu… Feb 17, 2018
blkmaker_jansson.h Make new BIP 9 features public May 25, 2016
blktemplate.c Merge branch 'master' into segwit Aug 12, 2016
blktemplate.h Add blktemplate_t.has_cbvalue boolean to differentiate between cbvalu… Feb 17, 2018
configure.ac Bump versions for 0.6.0 Dec 23, 2017
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 Update pkg-config file. Jan 15, 2018
private.h Merge integer unpacking code Jul 26, 2016
test.c Add blktemplate_t.has_cbvalue boolean to differentiate between cbvalu… Feb 17, 2018
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.