├── .gitattributes ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── COPYING ├── INSTALL ├── Makefile.am ├── README.md ├── autogen.sh ├── btcputil ├── build-debian-package.sh ├── build-mac.sh ├── build-win.sh ├── build.sh ├── cleanup-tags.sh ├── fetch-params.sh ├── init-mac.sh ├── make-release.py └── release-notes.py ├── build-aux └── m4 │ ├── ax_boost_base.m4 │ ├── ax_boost_chrono.m4 │ ├── ax_boost_filesystem.m4 │ ├── ax_boost_program_options.m4 │ ├── ax_boost_system.m4 │ ├── ax_boost_thread.m4 │ ├── ax_boost_unit_test_framework.m4 │ ├── ax_check_compile_flag.m4 │ ├── ax_check_link_flag.m4 │ ├── ax_check_preproc_flag.m4 │ ├── ax_gcc_func_attribute.m4 │ ├── ax_pthread.m4 │ ├── bitcoin_find_bdb.m4 │ └── bitcoin_subdir_to_include.m4 ├── code_of_conduct.md ├── configure.ac ├── contrib ├── README.md ├── amqp │ └── amqp_sub.py ├── bitcoin-cli.bash-completion ├── bitcoin-tx.bash-completion ├── bitcoind.bash-completion ├── bitrpc │ ├── README.md │ └── bitrpc.py ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── examples │ │ └── btcprivate.conf │ ├── postinst │ ├── postrm │ ├── preinst │ ├── prerm │ ├── rules │ ├── zcash.examples │ ├── zcash.install │ └── zcash.manpages ├── devtools │ ├── README.md │ ├── clang-format-diff.py │ ├── fix-copyright-headers.py │ ├── gen-manpages.sh │ ├── git-subtree-check.sh │ ├── github-merge.sh │ ├── optimize-pngs.py │ ├── security-check.py │ ├── split-debug.sh │ ├── symbol-check.py │ └── test-security-check.py ├── gitian-descriptors │ ├── README.md │ ├── gitian-linux.yml │ ├── gitian-osx-signer.yml │ ├── gitian-osx.yml │ ├── gitian-win-signer.yml │ └── gitian-win.yml ├── gitian-downloader │ ├── daira.asc │ ├── jack.asc │ ├── kevin.asc │ ├── nathan.asc │ ├── sean.asc │ └── simon.asc ├── init │ ├── README.md │ ├── bitcoind.conf │ ├── bitcoind.init │ ├── bitcoind.openrc │ ├── bitcoind.openrcconf │ └── bitcoind.service ├── linearize │ ├── README.md │ ├── example-linearize.cfg │ ├── linearize-data.py │ └── linearize-hashes.py ├── macdeploy │ ├── Base.lproj │ │ └── InfoPlist.strings │ ├── DS_Store │ ├── LICENSE │ ├── README.md │ ├── background.png │ ├── background.psd │ ├── background.tiff │ ├── background@2x.png │ ├── detached-sig-apply.sh │ ├── detached-sig-create.sh │ └── fancy.plist ├── qos │ ├── README.md │ └── tc.sh ├── seeds │ ├── README.md │ ├── generate-seeds.py │ ├── makeseeds.py │ ├── nodes_main.txt │ └── nodes_test.txt ├── spendfrom │ ├── README.md │ ├── setup.py │ └── spendfrom.py ├── test-patches │ ├── README.md │ └── temp-revert-2.patch ├── testgen │ ├── README.md │ ├── base58.py │ └── gen_base58_test_vectors.py ├── tidy_datadir.sh ├── verify-commits │ ├── gpg.sh │ ├── pre-push-hook.sh │ ├── trusted-git-root │ ├── trusted-keys │ └── verify-commits.sh ├── verifysfbinaries │ ├── README.md │ └── verify.sh └── zmq │ └── zmq_sub.py ├── depends ├── .gitignore ├── Makefile ├── README.md ├── builders │ ├── darwin.mk │ ├── default.mk │ └── linux.mk ├── config.guess ├── config.site.in ├── config.sub ├── description.md ├── funcs.mk ├── hosts │ ├── darwin.mk │ ├── default.mk │ ├── linux.mk │ └── mingw32.mk ├── packages.md ├── packages │ ├── bdb.mk │ ├── boost.mk │ ├── googlemock.mk │ ├── googletest.mk │ ├── libevent.mk │ ├── libgmp.mk │ ├── librustzcash.mk │ ├── libsnark.mk │ ├── libsodium.mk │ ├── miniupnpc.mk │ ├── native_ccache.mk │ ├── openssl.mk │ ├── packages.mk │ ├── proton.mk │ ├── rust.mk │ └── zeromq.mk └── patches │ ├── boost │ ├── deprecated_auto_ptr.patch │ └── include_poll.patch │ ├── miniupnpc │ ├── fix-solaris-compilation.patch │ ├── patch-strlen-patch.patch │ └── strlen-before-memcmp.patch │ └── proton │ └── minimal-build.patch ├── doc ├── Doxyfile ├── amqp.md ├── authors.md ├── bitcoin-release-notes │ ├── release-notes-0.10.0.md │ ├── release-notes-0.10.1.md │ ├── release-notes-0.10.2.md │ ├── release-notes-0.10.3.md │ ├── release-notes-0.11.1.md │ ├── release-notes-0.11.2.md │ ├── release-notes-0.3.12.md │ ├── release-notes-0.3.13.md │ ├── release-notes-0.3.14.md │ ├── release-notes-0.3.15.md │ ├── release-notes-0.3.16.md │ ├── release-notes-0.3.17.md │ ├── release-notes-0.3.18.md │ ├── release-notes-0.3.19.md │ ├── release-notes-0.3.20.1.md │ ├── release-notes-0.3.20.2.md │ ├── release-notes-0.3.20.md │ ├── release-notes-0.3.21.md │ ├── release-notes-0.3.22.md │ ├── release-notes-0.3.23.md │ ├── release-notes-0.3.24.md │ ├── release-notes-0.4.0.md │ ├── release-notes-0.4.1.md │ ├── release-notes-0.4.2.md │ ├── release-notes-0.4.3.md │ ├── release-notes-0.4.4.md │ ├── release-notes-0.4.5.md │ ├── release-notes-0.4.6.md │ ├── release-notes-0.5.0.md │ ├── release-notes-0.5.1.md │ ├── release-notes-0.5.2.md │ ├── release-notes-0.5.3.md │ ├── release-notes-0.5.4.md │ ├── release-notes-0.5.5.md │ ├── release-notes-0.6.0.md │ ├── release-notes-0.6.1.md │ ├── release-notes-0.6.2.md │ ├── release-notes-0.6.3.md │ ├── release-notes-0.7.0.md │ ├── release-notes-0.7.1.md │ ├── release-notes-0.7.2.md │ ├── release-notes-0.8.0.md │ ├── release-notes-0.8.1.md │ ├── release-notes-0.8.2.md │ ├── release-notes-0.8.3.md │ ├── release-notes-0.8.4.md │ ├── release-notes-0.8.5.md │ ├── release-notes-0.8.6.md │ ├── release-notes-0.9.0.md │ ├── release-notes-0.9.1.md │ ├── release-notes-0.9.2.1.md │ ├── release-notes-0.9.2.md │ ├── release-notes-0.9.3.md │ ├── release-notes-0.9.4.md │ └── release-notes-0.9.5.md ├── developer-notes.md ├── dnsseed-policy.md ├── files.md ├── init.md ├── man │ ├── Makefile.am │ ├── btcp-cli.1 │ ├── btcpd.1 │ ├── zcash-fetch-params.1 │ └── zcash-tx.1 ├── payment-api.md ├── release-notes.md ├── release-notes │ ├── release-notes-0.11.2.z2.md │ ├── release-notes-0.11.2.z3.md │ ├── release-notes-0.11.2.z4.md │ ├── release-notes-0.11.2.z5.md │ ├── release-notes-0.11.2.z6.md │ ├── release-notes-0.11.2.z7.md │ ├── release-notes-0.11.2.z8.md │ ├── release-notes-0.11.2.z9.md │ ├── release-notes-1.0.0-beta1.md │ ├── release-notes-1.0.0-beta2.md │ ├── release-notes-1.0.0-rc1.md │ ├── release-notes-1.0.0-rc2.md │ ├── release-notes-1.0.0-rc3.md │ ├── release-notes-1.0.0-rc4.md │ ├── release-notes-1.0.0.md │ ├── release-notes-1.0.1.md │ ├── release-notes-1.0.10-1.md │ ├── release-notes-1.0.10.md │ ├── release-notes-1.0.2.md │ ├── release-notes-1.0.3.md │ ├── release-notes-1.0.4.md │ ├── release-notes-1.0.5.md │ ├── release-notes-1.0.6.md │ ├── release-notes-1.0.7-1.md │ ├── release-notes-1.0.7.md │ ├── release-notes-1.0.8-1.md │ ├── release-notes-1.0.8.md │ └── release-notes-1.0.9.md ├── release-process.md ├── security-warnings.md ├── testnet.md ├── tor.md ├── translation_strings_policy.md ├── unit-tests.md ├── wallet-backup.md └── zmq.md ├── fork-instructions.md ├── libzcashconsensus.pc.in ├── qa ├── pull-tester │ ├── rpc-tests.sh │ ├── run-bitcoin-cli │ ├── run-bitcoind-for-test.sh.in │ └── tests-config.sh.in ├── rpc-tests │ ├── .gitignore │ ├── README.md │ ├── bip65-cltv-p2p.py │ ├── bipdersig-p2p.py │ ├── decodescript.py │ ├── disablewallet.py │ ├── forknotify.py │ ├── fundrawtransaction.py │ ├── getblocktemplate.py │ ├── getblocktemplate_longpoll.py │ ├── getblocktemplate_proposals.py │ ├── getchaintips.py │ ├── hardforkdetection.py │ ├── httpbasics.py │ ├── invalidateblock.py │ ├── invalidblockrequest.py │ ├── keypool.py │ ├── listtransactions.py │ ├── maxblocksinflight.py │ ├── mempool_coinbase_spends.py │ ├── mempool_resurrect_test.py │ ├── mempool_spendcoinbase.py │ ├── mempool_tx_input_limit.py │ ├── merkle_blocks.py │ ├── nodehandling.py │ ├── p2p-acceptblock.py │ ├── p2p-versionbits-warning.py │ ├── prioritisetransaction.py │ ├── proton_test.py │ ├── proxy_test.py │ ├── pruning.py │ ├── rawtransactions.py │ ├── receivedby.py │ ├── reindex.py │ ├── rest.py │ ├── rpcbind_test.py │ ├── script_test.py │ ├── signrawtransactions.py │ ├── smartfees.py │ ├── test_framework │ │ ├── __init__.py │ │ ├── authproxy.py │ │ ├── bignum.py │ │ ├── blockstore.py │ │ ├── blocktools.py │ │ ├── comptool.py │ │ ├── mininode.py │ │ ├── netutil.py │ │ ├── script.py │ │ ├── socks5.py │ │ ├── test_framework.py │ │ └── util.py │ ├── txn_doublespend.py │ ├── wallet.py │ ├── wallet_1941.py │ ├── wallet_nullifiers.py │ ├── wallet_protectcoinbase.py │ ├── wallet_shieldcoinbase.py │ ├── wallet_treestate.py │ ├── walletbackup.py │ ├── zapwallettxes.py │ ├── zcjoinsplit.py │ ├── zcjoinsplitdoublespend.py │ └── zmq_test.py └── zcash │ ├── check-security-hardening.sh │ ├── checksec.sh │ ├── create_benchmark_archive.py │ ├── ensure-no-dot-so-in-depends.py │ ├── full-test-suite.sh │ ├── performance-measurements.sh │ └── test-depends-sources-mirror.py ├── share ├── certs │ ├── BitcoinFoundation_Apple_Cert.pem │ ├── BitcoinFoundation_Comodo_Cert.pem │ └── PrivateKeyNotes.md ├── genbuild.sh ├── pixmaps │ ├── addressbook16.bmp │ ├── addressbook16mask.bmp │ ├── addressbook20.bmp │ ├── addressbook20mask.bmp │ ├── bitcoin-bc.ico │ ├── bitcoin.ico │ ├── bitcoin128.png │ ├── bitcoin128.xpm │ ├── bitcoin16.png │ ├── bitcoin16.xpm │ ├── bitcoin256.png │ ├── bitcoin256.xpm │ ├── bitcoin32.png │ ├── bitcoin32.xpm │ ├── bitcoin64.png │ ├── bitcoin64.xpm │ ├── check.ico │ ├── favicon.ico │ ├── nsis-header.bmp │ ├── nsis-wizard.bmp │ ├── send16.bmp │ ├── send16mask.bmp │ ├── send16masknoshadow.bmp │ ├── send20.bmp │ └── send20mask.bmp ├── setup.nsi.in └── ui.rc └── src ├── .clang-format ├── Makefile.am ├── Makefile.gtest.include ├── Makefile.test.include ├── Makefile.zcash.include ├── addrman.cpp ├── addrman.h ├── alert.cpp ├── alert.h ├── alertkeys.h ├── amount.cpp ├── amount.h ├── amqp ├── amqpabstractnotifier.cpp ├── amqpabstractnotifier.h ├── amqpconfig.h ├── amqpnotificationinterface.cpp ├── amqpnotificationinterface.h ├── amqppublishnotifier.cpp ├── amqppublishnotifier.h └── amqpsender.h ├── arith_uint256.cpp ├── arith_uint256.h ├── asyncrpcoperation.cpp ├── asyncrpcoperation.h ├── asyncrpcqueue.cpp ├── asyncrpcqueue.h ├── base58.cpp ├── base58.h ├── bitcoin-cli-res.rc ├── bitcoin-cli.cpp ├── bitcoin-tx-res.rc ├── bitcoin-tx.cpp ├── bitcoind-res.rc ├── bitcoind.cpp ├── bloom.cpp ├── bloom.h ├── chain.cpp ├── chain.h ├── chainparams.cpp ├── chainparams.h ├── chainparamsbase.cpp ├── chainparamsbase.h ├── chainparamsseeds.h ├── checkpoints.cpp ├── checkpoints.h ├── checkqueue.h ├── clientversion.cpp ├── clientversion.h ├── coincontrol.h ├── coins.cpp ├── coins.h ├── compat.h ├── compat ├── byteswap.h ├── endian.h ├── glibc_compat.cpp ├── glibc_sanity.cpp ├── glibcxx_sanity.cpp ├── sanity.h └── strnlen.cpp ├── compressor.cpp ├── compressor.h ├── config └── .empty ├── consensus ├── consensus.h ├── params.h └── validation.h ├── core_io.h ├── core_memusage.h ├── core_read.cpp ├── core_write.cpp ├── crypto ├── common.h ├── equihash.cpp ├── equihash.h ├── equihash.tcc ├── hmac_sha256.cpp ├── hmac_sha256.h ├── hmac_sha512.cpp ├── hmac_sha512.h ├── ripemd160.cpp ├── ripemd160.h ├── sha1.cpp ├── sha1.h ├── sha256.cpp ├── sha256.h ├── sha512.cpp └── sha512.h ├── deprecation.cpp ├── deprecation.h ├── gtest ├── json_test_vectors.cpp ├── json_test_vectors.h ├── main.cpp ├── test_block.cpp ├── test_checkblock.cpp ├── test_checktransaction.cpp ├── test_circuit.cpp ├── test_deprecation.cpp ├── test_equihash.cpp ├── test_joinsplit.cpp ├── test_keystore.cpp ├── test_libzcash_utils.cpp ├── test_mempool.cpp ├── test_merkletree.cpp ├── test_metrics.cpp ├── test_miner.cpp ├── test_noteencryption.cpp ├── test_pow.cpp ├── test_proofs.cpp ├── test_random.cpp ├── test_rpc.cpp ├── test_tautology.cpp ├── test_transaction.cpp ├── test_txid.cpp ├── test_validation.cpp └── utils.cpp ├── hash.cpp ├── hash.h ├── httprpc.cpp ├── httprpc.h ├── httpserver.cpp ├── httpserver.h ├── init.cpp ├── init.h ├── key.cpp ├── key.h ├── keystore.cpp ├── keystore.h ├── leveldb ├── .gitignore ├── AUTHORS ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── NEWS ├── README ├── README.md ├── TODO ├── WINDOWS.md ├── build_detect_platform ├── db │ ├── autocompact_test.cc │ ├── builder.cc │ ├── builder.h │ ├── c.cc │ ├── c_test.c │ ├── corruption_test.cc │ ├── db_bench.cc │ ├── db_impl.cc │ ├── db_impl.h │ ├── db_iter.cc │ ├── db_iter.h │ ├── db_test.cc │ ├── dbformat.cc │ ├── dbformat.h │ ├── dbformat_test.cc │ ├── dumpfile.cc │ ├── filename.cc │ ├── filename.h │ ├── filename_test.cc │ ├── leveldb_main.cc │ ├── log_format.h │ ├── log_reader.cc │ ├── log_reader.h │ ├── log_test.cc │ ├── log_writer.cc │ ├── log_writer.h │ ├── memtable.cc │ ├── memtable.h │ ├── repair.cc │ ├── skiplist.h │ ├── skiplist_test.cc │ ├── snapshot.h │ ├── table_cache.cc │ ├── table_cache.h │ ├── version_edit.cc │ ├── version_edit.h │ ├── version_edit_test.cc │ ├── version_set.cc │ ├── version_set.h │ ├── version_set_test.cc │ ├── write_batch.cc │ ├── write_batch_internal.h │ └── write_batch_test.cc ├── doc │ ├── bench │ │ ├── db_bench_sqlite3.cc │ │ └── db_bench_tree_db.cc │ ├── benchmark.html │ ├── doc.css │ ├── impl.html │ ├── index.html │ ├── log_format.txt │ └── table_format.txt ├── helpers │ └── memenv │ │ ├── memenv.cc │ │ ├── memenv.h │ │ └── memenv_test.cc ├── include │ └── leveldb │ │ ├── c.h │ │ ├── cache.h │ │ ├── comparator.h │ │ ├── db.h │ │ ├── dumpfile.h │ │ ├── env.h │ │ ├── filter_policy.h │ │ ├── iterator.h │ │ ├── options.h │ │ ├── slice.h │ │ ├── status.h │ │ ├── table.h │ │ ├── table_builder.h │ │ └── write_batch.h ├── issues │ ├── issue178_test.cc │ └── issue200_test.cc ├── port │ ├── README │ ├── atomic_pointer.h │ ├── port.h │ ├── port_example.h │ ├── port_posix.cc │ ├── port_posix.h │ ├── port_win.cc │ ├── port_win.h │ ├── thread_annotations.h │ └── win │ │ └── stdint.h ├── table │ ├── block.cc │ ├── block.h │ ├── block_builder.cc │ ├── block_builder.h │ ├── filter_block.cc │ ├── filter_block.h │ ├── filter_block_test.cc │ ├── format.cc │ ├── format.h │ ├── iterator.cc │ ├── iterator_wrapper.h │ ├── merger.cc │ ├── merger.h │ ├── table.cc │ ├── table_builder.cc │ ├── table_test.cc │ ├── two_level_iterator.cc │ └── two_level_iterator.h └── util │ ├── arena.cc │ ├── arena.h │ ├── arena_test.cc │ ├── bloom.cc │ ├── bloom_test.cc │ ├── cache.cc │ ├── cache_test.cc │ ├── coding.cc │ ├── coding.h │ ├── coding_test.cc │ ├── comparator.cc │ ├── crc32c.cc │ ├── crc32c.h │ ├── crc32c_test.cc │ ├── env.cc │ ├── env_posix.cc │ ├── env_test.cc │ ├── env_win.cc │ ├── filter_policy.cc │ ├── hash.cc │ ├── hash.h │ ├── hash_test.cc │ ├── histogram.cc │ ├── histogram.h │ ├── logging.cc │ ├── logging.h │ ├── mutexlock.h │ ├── options.cc │ ├── posix_logger.h │ ├── random.h │ ├── status.cc │ ├── testharness.cc │ ├── testharness.h │ ├── testutil.cc │ └── testutil.h ├── leveldbwrapper.cpp ├── leveldbwrapper.h ├── limitedmap.h ├── main.cpp ├── main.h ├── memusage.h ├── merkleblock.cpp ├── merkleblock.h ├── metrics.cpp ├── metrics.h ├── miner.cpp ├── miner.h ├── mruset.h ├── net.cpp ├── net.h ├── netbase.cpp ├── netbase.h ├── noui.cpp ├── noui.h ├── obj-test └── .gitignore ├── obj └── .gitignore ├── policy ├── fees.cpp └── fees.h ├── pow.cpp ├── pow.h ├── pow └── tromp │ ├── equi.h │ ├── equi_miner.h │ └── osx_barrier.h ├── primitives ├── block.cpp ├── block.h ├── transaction.cpp └── transaction.h ├── protocol.cpp ├── protocol.h ├── pubkey.cpp ├── pubkey.h ├── random.cpp ├── random.h ├── rest.cpp ├── reverselock.h ├── rpcblockchain.cpp ├── rpcclient.cpp ├── rpcclient.h ├── rpcmining.cpp ├── rpcmisc.cpp ├── rpcnet.cpp ├── rpcprotocol.cpp ├── rpcprotocol.h ├── rpcrawtransaction.cpp ├── rpcserver.cpp ├── rpcserver.h ├── scheduler.cpp ├── scheduler.h ├── script ├── interpreter.cpp ├── interpreter.h ├── script.cpp ├── script.h ├── script_error.cpp ├── script_error.h ├── sigcache.cpp ├── sigcache.h ├── sign.cpp ├── sign.h ├── standard.cpp ├── standard.h ├── zcashconsensus.cpp └── zcashconsensus.h ├── secp256k1 ├── .gitignore ├── .travis.yml ├── COPYING ├── Makefile.am ├── README.md ├── TODO ├── autogen.sh ├── build-aux │ └── m4 │ │ ├── ax_jni_include_dir.m4 │ │ ├── ax_prog_cc_for_build.m4 │ │ └── bitcoin_secp.m4 ├── configure.ac ├── contrib │ ├── lax_der_parsing.c │ ├── lax_der_parsing.h │ ├── lax_der_privatekey_parsing.c │ └── lax_der_privatekey_parsing.h ├── include │ ├── secp256k1.h │ ├── secp256k1_ecdh.h │ └── secp256k1_recovery.h ├── libsecp256k1.pc.in ├── obj │ └── .gitignore ├── sage │ ├── group_prover.sage │ ├── secp256k1.sage │ └── weierstrass_prover.sage └── src │ ├── asm │ └── field_10x26_arm.s │ ├── basic-config.h │ ├── bench.h │ ├── bench_ecdh.c │ ├── bench_internal.c │ ├── bench_recover.c │ ├── bench_sign.c │ ├── bench_verify.c │ ├── ecdsa.h │ ├── ecdsa_impl.h │ ├── eckey.h │ ├── eckey_impl.h │ ├── ecmult.h │ ├── ecmult_const.h │ ├── ecmult_const_impl.h │ ├── ecmult_gen.h │ ├── ecmult_gen_impl.h │ ├── ecmult_impl.h │ ├── field.h │ ├── field_10x26.h │ ├── field_10x26_impl.h │ ├── field_5x52.h │ ├── field_5x52_asm_impl.h │ ├── field_5x52_impl.h │ ├── field_5x52_int128_impl.h │ ├── field_impl.h │ ├── gen_context.c │ ├── group.h │ ├── group_impl.h │ ├── hash.h │ ├── hash_impl.h │ ├── java │ ├── org │ │ └── bitcoin │ │ │ ├── NativeSecp256k1.java │ │ │ ├── NativeSecp256k1Test.java │ │ │ ├── NativeSecp256k1Util.java │ │ │ └── Secp256k1Context.java │ ├── org_bitcoin_NativeSecp256k1.c │ ├── org_bitcoin_NativeSecp256k1.h │ ├── org_bitcoin_Secp256k1Context.c │ └── org_bitcoin_Secp256k1Context.h │ ├── modules │ ├── ecdh │ │ ├── Makefile.am.include │ │ ├── main_impl.h │ │ └── tests_impl.h │ └── recovery │ │ ├── Makefile.am.include │ │ ├── main_impl.h │ │ └── tests_impl.h │ ├── num.h │ ├── num_gmp.h │ ├── num_gmp_impl.h │ ├── num_impl.h │ ├── scalar.h │ ├── scalar_4x64.h │ ├── scalar_4x64_impl.h │ ├── scalar_8x32.h │ ├── scalar_8x32_impl.h │ ├── scalar_impl.h │ ├── scalar_low.h │ ├── scalar_low_impl.h │ ├── secp256k1.c │ ├── testrand.h │ ├── testrand_impl.h │ ├── tests.c │ ├── tests_exhaustive.c │ └── util.h ├── sendalert.cpp ├── serialize.h ├── streams.h ├── support ├── allocators │ ├── secure.h │ └── zeroafterfree.h ├── cleanse.cpp ├── cleanse.h ├── events.h ├── pagelocker.cpp └── pagelocker.h ├── sync.cpp ├── sync.h ├── test ├── Checkpoints_tests.cpp ├── DoS_tests.cpp ├── Makefile ├── README.md ├── accounting_tests.cpp ├── addrman_tests.cpp ├── alert_tests.cpp ├── allocator_tests.cpp ├── arith_uint256_tests.cpp ├── base32_tests.cpp ├── base58_tests.cpp ├── base64_tests.cpp ├── bctest.py ├── bignum.h ├── bip32_tests.cpp ├── bitcoin-util-test.py ├── bloom_tests.cpp ├── buildenv.py.in ├── checkblock_tests.cpp ├── coins_tests.cpp ├── compress_tests.cpp ├── crypto_tests.cpp ├── data │ ├── README.md │ ├── alertTests.raw │ ├── base58_encode_decode.json │ ├── base58_keys_invalid.json │ ├── base58_keys_valid.json │ ├── bitcoin-util-test.json │ ├── blanktx.hex │ ├── g1_compressed.json │ ├── g2_compressed.json │ ├── merkle_commitments.json │ ├── merkle_path.json │ ├── merkle_roots.json │ ├── merkle_roots_empty.json │ ├── merkle_serialization.json │ ├── merkle_witness_serialization.json │ ├── script_invalid.json │ ├── script_valid.json │ ├── sighash.json │ ├── tt-delin1-out.hex │ ├── tt-delout1-out.hex │ ├── tt-locktime317000-out.hex │ ├── tx394b54bb.hex │ ├── tx_invalid.json │ ├── tx_valid.json │ ├── txcreate1.hex │ ├── txcreate2.hex │ └── txcreatesign.hex ├── equihash_tests.cpp ├── getarg_tests.cpp ├── hash_tests.cpp ├── key_tests.cpp ├── main_tests.cpp ├── mempool_tests.cpp ├── miner_tests.cpp ├── mruset_tests.cpp ├── multisig_tests.cpp ├── netbase_tests.cpp ├── pmt_tests.cpp ├── policyestimator_tests.cpp ├── pow_tests.cpp ├── raii_event_tests.cpp ├── reverselock_tests.cpp ├── rpc_tests.cpp ├── rpc_wallet_tests.cpp ├── sanity_tests.cpp ├── scheduler_tests.cpp ├── script_P2SH_tests.cpp ├── script_tests.cpp ├── scriptnum_tests.cpp ├── serialize_tests.cpp ├── sha256compress_tests.cpp ├── sighash_tests.cpp ├── sigopcount_tests.cpp ├── skiplist_tests.cpp ├── test_bitcoin.cpp ├── test_bitcoin.h ├── timedata_tests.cpp ├── torcontrol_tests.cpp ├── transaction_tests.cpp ├── uint256_tests.cpp ├── univalue_tests.cpp ├── util_tests.cpp └── versionbits_tests.cpp ├── threadsafety.h ├── timedata.cpp ├── timedata.h ├── tinyformat.h ├── torcontrol.cpp ├── torcontrol.h ├── txdb.cpp ├── txdb.h ├── txmempool.cpp ├── txmempool.h ├── ui_interface.h ├── uint252.h ├── uint256.cpp ├── uint256.h ├── undo.h ├── univalue ├── .gitignore ├── .travis.yml ├── COPYING ├── Makefile.am ├── README ├── TODO ├── autogen.sh ├── build-aux │ └── m4 │ │ └── .gitignore ├── configure.ac ├── gen │ └── gen.cpp ├── include │ └── univalue.h ├── lib │ ├── .gitignore │ ├── univalue.cpp │ ├── univalue_escapes.h │ ├── univalue_read.cpp │ ├── univalue_utffilter.h │ └── univalue_write.cpp ├── pc │ ├── libunivalue-uninstalled.pc.in │ └── libunivalue.pc.in └── test │ ├── .gitignore │ ├── fail1.json │ ├── fail10.json │ ├── fail11.json │ ├── fail12.json │ ├── fail13.json │ ├── fail14.json │ ├── fail15.json │ ├── fail16.json │ ├── fail17.json │ ├── fail18.json │ ├── fail19.json │ ├── fail2.json │ ├── fail20.json │ ├── fail21.json │ ├── fail22.json │ ├── fail23.json │ ├── fail24.json │ ├── fail25.json │ ├── fail26.json │ ├── fail27.json │ ├── fail28.json │ ├── fail29.json │ ├── fail3.json │ ├── fail30.json │ ├── fail31.json │ ├── fail32.json │ ├── fail33.json │ ├── fail34.json │ ├── fail35.json │ ├── fail36.json │ ├── fail37.json │ ├── fail38.json │ ├── fail39.json │ ├── fail4.json │ ├── fail40.json │ ├── fail41.json │ ├── fail42.json │ ├── fail5.json │ ├── fail6.json │ ├── fail7.json │ ├── fail8.json │ ├── fail9.json │ ├── no_nul.cpp │ ├── pass1.json │ ├── pass2.json │ ├── pass3.json │ ├── round1.json │ ├── round2.json │ ├── round3.json │ ├── round4.json │ ├── round5.json │ ├── round6.json │ ├── round7.json │ ├── test_json.cpp │ └── unitester.cpp ├── util.cpp ├── util.h ├── utilmoneystr.cpp ├── utilmoneystr.h ├── utilstrencodings.cpp ├── utilstrencodings.h ├── utiltest.cpp ├── utiltest.h ├── utiltime.cpp ├── utiltime.h ├── validationinterface.cpp ├── validationinterface.h ├── version.h ├── versionbits.cpp ├── versionbits.h ├── wallet ├── asyncrpcoperation_sendmany.cpp ├── asyncrpcoperation_sendmany.h ├── asyncrpcoperation_shieldcoinbase.cpp ├── asyncrpcoperation_shieldcoinbase.h ├── crypter.cpp ├── crypter.h ├── db.cpp ├── db.h ├── gtest │ ├── test_wallet.cpp │ └── test_wallet_zkeys.cpp ├── rpcdump.cpp ├── rpcwallet.cpp ├── test │ └── wallet_tests.cpp ├── wallet.cpp ├── wallet.h ├── wallet_ismine.cpp ├── wallet_ismine.h ├── walletdb.cpp └── walletdb.h ├── zcash ├── Address.cpp ├── Address.hpp ├── CreateJoinSplit.cpp ├── GenerateParams.cpp ├── IncrementalMerkleTree.cpp ├── IncrementalMerkleTree.hpp ├── JoinSplit.cpp ├── JoinSplit.hpp ├── Note.cpp ├── Note.hpp ├── NoteEncryption.cpp ├── NoteEncryption.hpp ├── Proof.cpp ├── Proof.hpp ├── Zcash.h ├── circuit │ ├── commitment.tcc │ ├── gadget.tcc │ ├── merkle.tcc │ ├── note.tcc │ ├── prfs.tcc │ └── utils.tcc ├── prf.cpp ├── prf.h ├── util.cpp └── util.h ├── zcbenchmarks.cpp ├── zcbenchmarks.h └── zmq ├── zmqabstractnotifier.cpp ├── zmqabstractnotifier.h ├── zmqconfig.h ├── zmqnotificationinterface.cpp ├── zmqnotificationinterface.h ├── zmqpublishnotifier.cpp └── zmqpublishnotifier.h /.gitattributes: -------------------------------------------------------------------------------- 1 | src/clientversion.cpp export-subst 2 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building Bitcoin Private 2 | 3 | See the Bitcoin Private github wiki (https://github.com/BTCPrivate/BitcoinPrivate/wiki) for instructions on building btcpd, 4 | the intended-for-services, no-graphical-interface, reference 5 | implementation of Bitcoin Private. 6 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | srcdir="$(dirname $0)" 4 | cd "$srcdir" 5 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then 6 | LIBTOOLIZE="${GLIBTOOLIZE}" 7 | export LIBTOOLIZE 8 | fi 9 | autoreconf --install --force --warnings=all 10 | -------------------------------------------------------------------------------- /btcputil/cleanup-tags.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Warning: This deletes tags on "origin", so point that at the right target! 4 | # 5 | # Note: It doesn't delete any local tags. 6 | 7 | set -exu -o pipefail 8 | 9 | ZCASH_TAG_RGX='^v[0-9]+.[0-9]+.[0-9]+.z[0-9]+' 10 | MAXJOBS=7 11 | 12 | i=0 13 | 14 | for nonzctag in $(git ls-remote origin \ 15 | | grep refs/tags/ \ 16 | | grep -v '\^{}$' \ 17 | | sed 's,^.*refs/tags/,,'\ 18 | | grep -Ev "$ZCASH_TAG_RGX" 19 | ) 20 | do 21 | git push origin ":refs/tags/${nonzctag}" & 22 | i="$(expr "$i" + 1)" 23 | [ "$i" -ge "$MAXJOBS" ] && wait -n 24 | done 25 | 26 | wait 27 | -------------------------------------------------------------------------------- /build-aux/m4/bitcoin_subdir_to_include.m4: -------------------------------------------------------------------------------- 1 | dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE]) 2 | dnl SUBDIRECTORY-NAME must end with a path separator 3 | AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ 4 | if test "x$2" = "x"; then 5 | AC_MSG_RESULT([default]) 6 | else 7 | echo "#include <$2$3.h>" >conftest.cpp 8 | newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`] 9 | AC_MSG_RESULT([${newinclpath}]) 10 | if test "x${newinclpath}" != "x"; then 11 | eval "$1=\"\$$1\"' -I${newinclpath}'" 12 | fi 13 | fi 14 | ]) 15 | -------------------------------------------------------------------------------- /contrib/bitrpc/README.md: -------------------------------------------------------------------------------- 1 | ### BitRPC 2 | Allows for sending of all standard Bitcoin commands via RPC rather than as command line args. 3 | 4 | ### Looking for Wallet Tools? 5 | BitRPC.py is able to do the exact same thing as `walletchangepass.py` and `walletunlock.py`. Their respective commands in BitRPC.py are: 6 | 7 | bitrpc.py walletpassphrasechange 8 | bitrpc.py walletpassphrase -------------------------------------------------------------------------------- /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /contrib/debian/control: -------------------------------------------------------------------------------- 1 | Source: zcash 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Zcash Company 5 | Homepage: https://z.cash 6 | Build-Depends: autoconf, automake, bsdmainutils, build-essential, 7 | git, g++-multilib, libc6-dev, libtool, 8 | m4, ncurses-dev, pkg-config, python, 9 | unzip, wget, zlib1g-dev 10 | Vcs-Git: https://github.com/zcash/zcash.git 11 | Vcs-Browser: https://github.com/zcash/zcash 12 | 13 | Package: btcprivate 14 | Version: 1.0.6 15 | Depends: ${shlibs:Depends} 16 | Description: HTTPS for money. 17 | Based on Bitcoin's code, it intends to offer a far higher standard 18 | of privacy and anonymity through a sophisticiated zero-knowledge 19 | proving scheme which preserves confidentiality of transaction metadata. 20 | This package provides the daemon, btcpd, and the CLI tool, 21 | btcp-cli, to interact with the daemon. 22 | -------------------------------------------------------------------------------- /contrib/debian/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see https://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | 21 | case "$1" in 22 | configure) 23 | ;; 24 | 25 | abort-upgrade|abort-remove|abort-deconfigure) 26 | ;; 27 | 28 | *) 29 | echo "postinst called with unknown argument \`$1'" >&2 30 | exit 1 31 | ;; 32 | esac 33 | 34 | # dh_installdeb will replace this with shell code automatically 35 | # generated by other debhelper scripts. 36 | 37 | #DEBHELPER# 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /contrib/debian/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see https://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 24 | ;; 25 | 26 | *) 27 | echo "postrm called with unknown argument \`$1'" >&2 28 | exit 1 29 | ;; 30 | esac 31 | 32 | # dh_installdeb will replace this with shell code automatically 33 | # generated by other debhelper scripts. 34 | 35 | #DEBHELPER# 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /contrib/debian/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # preinst script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `install' 10 | # * `install' 11 | # * `upgrade' 12 | # * `abort-upgrade' 13 | # for details, see https://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | 17 | case "$1" in 18 | install|upgrade) 19 | ;; 20 | 21 | abort-upgrade) 22 | ;; 23 | 24 | *) 25 | echo "preinst called with unknown argument \`$1'" >&2 26 | exit 1 27 | ;; 28 | esac 29 | 30 | # dh_installdeb will replace this with shell code automatically 31 | # generated by other debhelper scripts. 32 | 33 | #DEBHELPER# 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /contrib/debian/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see https://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | 19 | 20 | case "$1" in 21 | remove|upgrade|deconfigure) 22 | ;; 23 | 24 | failed-upgrade) 25 | ;; 26 | 27 | *) 28 | echo "prerm called with unknown argument \`$1'" >&2 29 | exit 1 30 | ;; 31 | esac 32 | 33 | # dh_installdeb will replace this with shell code automatically 34 | # generated by other debhelper scripts. 35 | 36 | #DEBHELPER# 37 | 38 | exit 0 39 | -------------------------------------------------------------------------------- /contrib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | 17 | %: 18 | dh $@ --with autotools_dev 19 | 20 | 21 | # dh_make generated override targets 22 | # This is example for Cmake (See https://bugs.debian.org/641051 ) 23 | #override_dh_auto_configure: 24 | # dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) 25 | 26 | -------------------------------------------------------------------------------- /contrib/debian/zcash.examples: -------------------------------------------------------------------------------- 1 | DEBIAN/examples/btcprivate.conf 2 | -------------------------------------------------------------------------------- /contrib/debian/zcash.install: -------------------------------------------------------------------------------- 1 | usr/bin/btcpd 2 | usr/bin/btcp-cli 3 | usr/bin/zcash-fetch-params 4 | -------------------------------------------------------------------------------- /contrib/debian/zcash.manpages: -------------------------------------------------------------------------------- 1 | DEBIAN/manpages/btcp-cli.1 2 | DEBIAN/manpages/btcpd.1 3 | -------------------------------------------------------------------------------- /contrib/devtools/gen-manpages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} 4 | SRCDIR=${SRCDIR:-$TOPDIR/src} 5 | MANDIR=${MANDIR:-$TOPDIR/doc/man} 6 | 7 | BTCPD=${BTCPD:-$SRCDIR/btcpd} 8 | ZCASHCLI=${ZCASHCLI:-$SRCDIR/btcp-cli} 9 | ZCASHTX=${ZCASHTX:-$SRCDIR/zcash-tx} 10 | 11 | [ ! -x $BTCPD ] && echo "$BTCPD not found or not executable." && exit 1 12 | 13 | # The autodetected version git tag can screw up manpage output a little bit 14 | ZECVERSTR=$($ZCASHCLI --version | head -n1 | awk '{ print $NF }') 15 | ZECVER=$(echo $ZECVERSTR | awk -F- '{ OFS="-"; NF--; print $0; }') 16 | ZECCOMMIT=$(echo $ZECVERSTR | awk -F- '{ print $NF }') 17 | 18 | # Create a footer file with copyright content. 19 | # This gets autodetected fine for btcpd if --version-string is not set, 20 | # but has different outcomes for btcp-cli. 21 | echo "[COPYRIGHT]" > footer.h2m 22 | $BTCPD --version | sed -n '1!p' >> footer.h2m 23 | 24 | for cmd in $BTCPD $ZCASHCLI $ZCASHTX; do 25 | cmdname="${cmd##*/}" 26 | help2man -N --version-string=$ZECVER --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} 27 | sed -i "s/\\\-$ZECCOMMIT//g" ${MANDIR}/${cmdname}.1 28 | done 29 | 30 | rm -f footer.h2m 31 | -------------------------------------------------------------------------------- /contrib/devtools/split-debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 3 ]; 4 | then echo "usage: $0 " 5 | fi 6 | 7 | /usr/bin/objcopy --enable-deterministic-archives -p --only-keep-debug $1 $3 8 | /usr/bin/objcopy --enable-deterministic-archives -p --strip-debug $1 $2 9 | /usr/bin/strip --enable-deterministic-archives -p -s $2 10 | /usr/bin/objcopy --enable-deterministic-archives -p --add-gnu-debuglink=$3 $2 11 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-osx-signer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "bitcoin-dmg-signer" 3 | suites: 4 | - "trusty" 5 | architectures: 6 | - "amd64" 7 | packages: 8 | - "libc6:i386" 9 | - "faketime" 10 | remotes: 11 | - "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git" 12 | "dir": "signature" 13 | files: 14 | - "bitcoin-osx-unsigned.tar.gz" 15 | script: | 16 | WRAP_DIR=$HOME/wrapped 17 | mkdir -p ${WRAP_DIR} 18 | export PATH=`pwd`:$PATH 19 | FAKETIME_PROGS="dmg genisoimage" 20 | 21 | # Create global faketime wrappers 22 | for prog in ${FAKETIME_PROGS}; do 23 | echo '#!/bin/bash' > ${WRAP_DIR}/${prog} 24 | echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} 25 | echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} 26 | echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} 27 | echo "\$REAL \$@" >> $WRAP_DIR/${prog} 28 | chmod +x ${WRAP_DIR}/${prog} 29 | done 30 | 31 | UNSIGNED=bitcoin-osx-unsigned.tar.gz 32 | SIGNED=bitcoin-osx-signed.dmg 33 | 34 | tar -xf ${UNSIGNED} 35 | ./detached-sig-apply.sh ${UNSIGNED} signature/osx 36 | ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -apple -o uncompressed.dmg signed-app 37 | ${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED} 38 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-win-signer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "bitcoin-win-signer" 3 | suites: 4 | - "trusty" 5 | architectures: 6 | - "amd64" 7 | packages: 8 | - "libssl-dev" 9 | - "autoconf" 10 | remotes: 11 | - "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git" 12 | "dir": "signature" 13 | files: 14 | - "osslsigncode-1.7.1.tar.gz" 15 | - "osslsigncode-Backports-to-1.7.1.patch" 16 | - "bitcoin-win-unsigned.tar.gz" 17 | script: | 18 | BUILD_DIR=`pwd` 19 | SIGDIR=${BUILD_DIR}/signature/win 20 | UNSIGNED_DIR=${BUILD_DIR}/unsigned 21 | 22 | echo "f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9 osslsigncode-1.7.1.tar.gz" | sha256sum -c 23 | echo "a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911 osslsigncode-Backports-to-1.7.1.patch" | sha256sum -c 24 | 25 | mkdir -p ${UNSIGNED_DIR} 26 | tar -C ${UNSIGNED_DIR} -xf bitcoin-win-unsigned.tar.gz 27 | 28 | tar xf osslsigncode-1.7.1.tar.gz 29 | cd osslsigncode-1.7.1 30 | patch -p1 < ${BUILD_DIR}/osslsigncode-Backports-to-1.7.1.patch 31 | 32 | ./configure --without-gsf --without-curl --disable-dependency-tracking 33 | make 34 | find ${UNSIGNED_DIR} -name "*-unsigned.exe" | while read i; do 35 | INFILE="`basename "${i}"`" 36 | OUTFILE="`echo "${INFILE}" | sed s/-unsigned//`" 37 | ./osslsigncode attach-signature -in "${i}" -out "${OUTDIR}/${OUTFILE}" -sigin "${SIGDIR}/${INFILE}.pem" 38 | done 39 | -------------------------------------------------------------------------------- /contrib/init/README.md: -------------------------------------------------------------------------------- 1 | Sample configuration files for: 2 | 3 | SystemD: bitcoind.service 4 | Upstart: bitcoind.conf 5 | OpenRC: bitcoind.openrc 6 | bitcoind.openrcconf 7 | CentOS: bitcoind.init 8 | 9 | have been made available to assist packagers in creating node packages here. 10 | 11 | See doc/init.md for more information. 12 | -------------------------------------------------------------------------------- /contrib/init/bitcoind.openrcconf: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/bitcoind: config file for /etc/init.d/bitcoind 2 | 3 | # Config file location 4 | #BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" 5 | 6 | # What directory to write pidfile to? (created and owned by $BITCOIND_USER) 7 | #BITCOIND_PIDDIR="/var/run/bitcoind" 8 | 9 | # What filename to give the pidfile 10 | #BITCOIND_PIDFILE="${BITCOIND_PIDDIR}/bitcoind.pid" 11 | 12 | # Where to write bitcoind data (be mindful that the blockchain is large) 13 | #BITCOIND_DATADIR="/var/lib/bitcoind" 14 | 15 | # User and group to own bitcoind process 16 | #BITCOIND_USER="bitcoin" 17 | #BITCOIND_GROUP="bitcoin" 18 | 19 | # Path to bitcoind executable 20 | #BITCOIND_BIN="/usr/bin/bitcoind" 21 | 22 | # Nice value to run bitcoind under 23 | #BITCOIND_NICE=0 24 | 25 | # Additional options (avoid -conf and -datadir, use flags above) 26 | BITCOIND_OPTS="-disablewallet" 27 | 28 | # The timeout in seconds OpenRC will wait for bitcoind to terminate 29 | # after a SIGTERM has been raised. 30 | # Note that this will be mapped as argument to start-stop-daemon's 31 | # '--retry' option, which means you can specify a retry schedule 32 | # here. For more information see man 8 start-stop-daemon. 33 | BITCOIND_SIGTERM_TIMEOUT=60 34 | -------------------------------------------------------------------------------- /contrib/init/bitcoind.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Bitcoin's distributed currency daemon 3 | After=network.target 4 | 5 | [Service] 6 | User=bitcoin 7 | Group=bitcoin 8 | 9 | Type=forking 10 | PIDFile=/var/lib/bitcoind/bitcoind.pid 11 | ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \ 12 | -conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet 13 | 14 | Restart=always 15 | PrivateTmp=true 16 | TimeoutStopSec=60s 17 | TimeoutStartSec=2s 18 | StartLimitInterval=120s 19 | StartLimitBurst=5 20 | 21 | [Install] 22 | WantedBy=multi-user.target 23 | -------------------------------------------------------------------------------- /contrib/linearize/README.md: -------------------------------------------------------------------------------- 1 | # Linearize 2 | Construct a linear, no-fork, best version of the blockchain. 3 | 4 | ## Step 1: Download hash list 5 | 6 | $ ./linearize-hashes.py linearize.cfg > hashlist.txt 7 | 8 | Required configuration file settings for linearize-hashes: 9 | * RPC: rpcuser, rpcpassword 10 | 11 | Optional config file setting for linearize-hashes: 12 | * RPC: host, port 13 | * Block chain: min_height, max_height 14 | 15 | ## Step 2: Copy local block data 16 | 17 | $ ./linearize-data.py linearize.cfg 18 | 19 | Required configuration file settings: 20 | * "input": bitcoind blocks/ directory containing blkNNNNN.dat 21 | * "hashlist": text file containing list of block hashes, linearized-hashes.py 22 | output. 23 | * "output_file": bootstrap.dat 24 | or 25 | * "output": output directory for linearized blocks/blkNNNNN.dat output 26 | 27 | Optional config file setting for linearize-data: 28 | * "netmagic": network magic number 29 | * "max_out_sz": maximum output file size (default `1000*1000*1000`) 30 | * "split_timestamp": Split files when a new month is first seen, in addition to 31 | reaching a maximum file size. 32 | * "file_timestamp": Set each file's last-modified time to that of the 33 | most recent block in that file. 34 | -------------------------------------------------------------------------------- /contrib/linearize/example-linearize.cfg: -------------------------------------------------------------------------------- 1 | 2 | # bitcoind RPC settings (linearize-hashes) 3 | rpcuser=someuser 4 | rpcpassword=somepassword 5 | host=127.0.0.1 6 | port=7932 7 | #port=17932 8 | 9 | # bootstrap.dat hashlist settings (linearize-hashes) 10 | max_height=313000 11 | 12 | # bootstrap.dat input/output settings (linearize-data) 13 | 14 | # mainnet 15 | netmagic=f9beb4d9 16 | genesis=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 17 | input=/home/example/.bitcoin/blocks 18 | 19 | # testnet 20 | #netmagic=0b110907 21 | #genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 22 | #input=/home/example/.bitcoin/testnet3/blocks 23 | 24 | output_file=/home/example/Downloads/bootstrap.dat 25 | hashlist=hashlist.txt 26 | split_year=1 27 | 28 | # Maxmimum size in bytes of out-of-order blocks cache in memory 29 | out_of_order_cache_sz = 100000000 30 | -------------------------------------------------------------------------------- /contrib/macdeploy/Base.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | { CFBundleDisplayName = "Bitcoin Core"; CFBundleName = "Bitcoin Core"; } 2 | -------------------------------------------------------------------------------- /contrib/macdeploy/DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/contrib/macdeploy/DS_Store -------------------------------------------------------------------------------- /contrib/macdeploy/README.md: -------------------------------------------------------------------------------- 1 | ### MacDeploy ### 2 | 3 | For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package: 4 | 5 | sudo easy_install argparse 6 | 7 | This script should not be run manually, instead, after building as usual: 8 | 9 | make deploy 10 | 11 | During the process, the disk image window will pop up briefly where the fancy 12 | settings are applied. This is normal, please do not interfere. 13 | 14 | When finished, it will produce `Bitcoin-Core.dmg`. 15 | 16 | -------------------------------------------------------------------------------- /contrib/macdeploy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/contrib/macdeploy/background.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/contrib/macdeploy/background.psd -------------------------------------------------------------------------------- /contrib/macdeploy/background.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/contrib/macdeploy/background.tiff -------------------------------------------------------------------------------- /contrib/macdeploy/background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/contrib/macdeploy/background@2x.png -------------------------------------------------------------------------------- /contrib/macdeploy/detached-sig-apply.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | UNSIGNED="$1" 5 | SIGNATURE="$2" 6 | ARCH=x86_64 7 | ROOTDIR=dist 8 | TEMPDIR=signed.temp 9 | OUTDIR=signed-app 10 | 11 | if [ -z "$UNSIGNED" ]; then 12 | echo "usage: $0 " 13 | exit 1 14 | fi 15 | 16 | if [ -z "$SIGNATURE" ]; then 17 | echo "usage: $0 " 18 | exit 1 19 | fi 20 | 21 | rm -rf ${TEMPDIR} && mkdir -p ${TEMPDIR} 22 | tar -C ${TEMPDIR} -xf ${UNSIGNED} 23 | cp -rf "${SIGNATURE}"/* ${TEMPDIR} 24 | 25 | if [ -z "${PAGESTUFF}" ]; then 26 | PAGESTUFF=${TEMPDIR}/pagestuff 27 | fi 28 | 29 | if [ -z "${CODESIGN_ALLOCATE}" ]; then 30 | CODESIGN_ALLOCATE=${TEMPDIR}/codesign_allocate 31 | fi 32 | 33 | find ${TEMPDIR} -name "*.sign" | while read i; do 34 | SIZE=`stat -c %s "${i}"` 35 | TARGET_FILE="`echo "${i}" | sed 's/\.sign$//'`" 36 | 37 | echo "Allocating space for the signature of size ${SIZE} in ${TARGET_FILE}" 38 | ${CODESIGN_ALLOCATE} -i "${TARGET_FILE}" -a ${ARCH} ${SIZE} -o "${i}.tmp" 39 | 40 | OFFSET=`${PAGESTUFF} "${i}.tmp" -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` 41 | if [ -z ${QUIET} ]; then 42 | echo "Attaching signature at offset ${OFFSET}" 43 | fi 44 | 45 | dd if="$i" of="${i}.tmp" bs=1 seek=${OFFSET} count=${SIZE} 2>/dev/null 46 | mv "${i}.tmp" "${TARGET_FILE}" 47 | rm "${i}" 48 | echo "Success." 49 | done 50 | mv ${TEMPDIR}/${ROOTDIR} ${OUTDIR} 51 | rm -rf ${TEMPDIR} 52 | echo "Signed: ${OUTDIR}" 53 | -------------------------------------------------------------------------------- /contrib/macdeploy/fancy.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | window_bounds 6 | 7 | 300 8 | 300 9 | 800 10 | 620 11 | 12 | background_picture 13 | background.tiff 14 | icon_size 15 | 96 16 | applications_symlink 17 | 18 | items_position 19 | 20 | Applications 21 | 22 | 370 23 | 156 24 | 25 | Bitcoin-Qt.app 26 | 27 | 128 28 | 156 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /contrib/qos/README.md: -------------------------------------------------------------------------------- 1 | ### Qos ### 2 | 3 | This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 7933, but not if the destination IP is within a LAN (defined as 192.168.x.x). 4 | 5 | This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. 6 | -------------------------------------------------------------------------------- /contrib/seeds/README.md: -------------------------------------------------------------------------------- 1 | ### Seeds ### 2 | 3 | Utility to generate the seeds.txt list that is compiled into the client 4 | (see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)). 5 | 6 | The 512 seeds compiled into the 0.10 release were created from sipa's DNS seed data, like this: 7 | 8 | curl -s http://bitcoin.sipa.be/seeds.txt | makeseeds.py 9 | -------------------------------------------------------------------------------- /contrib/seeds/nodes_main.txt: -------------------------------------------------------------------------------- 1 | # List of fixed seed nodes for mainnet 2 | 3 | # Onion nodes 4 | q2dmolnsfq6wooor.onion:8133 5 | -------------------------------------------------------------------------------- /contrib/seeds/nodes_test.txt: -------------------------------------------------------------------------------- 1 | # List of fixed seed nodes for testnet 2 | 3 | # Onion nodes 4 | mnsj6hmvtvdwx4xu.onion:18233 5 | -------------------------------------------------------------------------------- /contrib/spendfrom/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | setup(name='btcspendfrom', 3 | version='1.0', 4 | description='Command-line utility for bitcoin "coin control"', 5 | author='Gavin Andresen', 6 | author_email='gavin@bitcoinfoundation.org', 7 | requires=['jsonrpc'], 8 | scripts=['spendfrom.py'], 9 | ) 10 | -------------------------------------------------------------------------------- /contrib/test-patches/README.md: -------------------------------------------------------------------------------- 1 | ### Test Patches ### 2 | 3 | These patches are applied when the automated pull-tester 4 | tests each pull and when master is tested using jenkins. 5 | You can find more information about the tests run at 6 | [http://jenkins.bluematt.me/pull-tester/files/ 7 | ](http://jenkins.bluematt.me/pull-tester/files/) -------------------------------------------------------------------------------- /contrib/test-patches/temp-revert-2.patch: -------------------------------------------------------------------------------- 1 | commit cfae26916dba311f6f75d444301c1f9362267c3e 2 | Author: Matt Corallo 3 | Date: Sun Mar 24 20:45:50 2013 -0400 4 | 5 | Revert "Checkpoint at first block in 11 March chain fork" 6 | 7 | This reverts commit f817c496a1482d05b22c8e539de67f07db1c09d9. 8 | 9 | diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp 10 | index 62234b9..9b11f0b 100644 11 | --- a/src/checkpoints.cpp 12 | +++ b/src/checkpoints.cpp 13 | @@ -44,7 +44,6 @@ namespace Checkpoints 14 | (193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")) 15 | (210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")) 16 | (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) 17 | - (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) 18 | ; 19 | static const CCheckpointData data = { 20 | &mapCheckpoints, 21 | -------------------------------------------------------------------------------- /contrib/testgen/README.md: -------------------------------------------------------------------------------- 1 | ### TestGen ### 2 | 3 | Utilities to generate test vectors for the data-driven Bitcoin tests. 4 | 5 | Usage: 6 | 7 | gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json 8 | gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json -------------------------------------------------------------------------------- /contrib/verify-commits/gpg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | INPUT=$(/dev/null); do 6 | case "$LINE" in "[GNUPG:] VALIDSIG"*) 7 | while read KEY; do 8 | case "$LINE" in "[GNUPG:] VALIDSIG $KEY "*) VALID=true;; esac 9 | done < ./contrib/verify-commits/trusted-keys 10 | esac 11 | done 12 | if ! $VALID; then 13 | exit 1 14 | fi 15 | echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null 16 | -------------------------------------------------------------------------------- /contrib/verify-commits/pre-push-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if ! [[ "$2" =~ [git@]?[www.]?github.com[:|/]bitcoin/bitcoin[.git]? ]]; then 3 | exit 0 4 | fi 5 | 6 | while read LINE; do 7 | set -- A $LINE 8 | if [ "$4" != "refs/heads/master" ]; then 9 | continue 10 | fi 11 | if ! ./contrib/verify-commits/verify-commits.sh $3 > /dev/null 2>&1; then 12 | echo "ERROR: A commit is not signed, can't push" 13 | ./contrib/verify-commits/verify-commits.sh 14 | exit 1 15 | fi 16 | done < /dev/stdin 17 | -------------------------------------------------------------------------------- /contrib/verify-commits/trusted-git-root: -------------------------------------------------------------------------------- 1 | 053038e5ba116cb319fb85f3cb3e062cf1b3df15 2 | -------------------------------------------------------------------------------- /contrib/verify-commits/trusted-keys: -------------------------------------------------------------------------------- 1 | 71A3B16735405025D447E8F274810B012346C9A6 2 | 1F4410F6A89268CE3197A84C57896D2FF8F0B657 3 | 01CDF4627A3B88AAE4A571C87588242FBE38D3A8 4 | AF8BE07C7049F3A26B239D5325B3083201782B2F 5 | 81291FA67D2C379A006A053FEAB5AF94D9E9ABE7 6 | -------------------------------------------------------------------------------- /contrib/verify-commits/verify-commits.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(dirname "$0") 4 | 5 | echo "Please verify all commits in the following list are not evil:" 6 | git log "$DIR" 7 | 8 | VERIFIED_ROOT=$(cat "${DIR}/trusted-git-root") 9 | 10 | HAVE_FAILED=false 11 | IS_SIGNED () { 12 | if [ $1 = $VERIFIED_ROOT ]; then 13 | return 0; 14 | fi 15 | if ! git -c "gpg.program=${DIR}/gpg.sh" verify-commit $1 > /dev/null 2>&1; then 16 | return 1; 17 | fi 18 | local PARENTS=$(git show -s --format=format:%P $1) 19 | for PARENT in $PARENTS; do 20 | if IS_SIGNED $PARENT > /dev/null; then 21 | return 0; 22 | fi 23 | done 24 | if ! "$HAVE_FAILED"; then 25 | echo "No parent of $1 was signed with a trusted key!" > /dev/stderr 26 | echo "Parents are:" > /dev/stderr 27 | for PARENT in $PARENTS; do 28 | git show -s $PARENT > /dev/stderr 29 | done 30 | HAVE_FAILED=true 31 | fi 32 | return 1; 33 | } 34 | 35 | if [ x"$1" = "x" ]; then 36 | TEST_COMMIT="HEAD" 37 | else 38 | TEST_COMMIT="$1" 39 | fi 40 | 41 | IS_SIGNED "$TEST_COMMIT" 42 | RES=$? 43 | if [ "$RES" = 1 ]; then 44 | if ! "$HAVE_FAILED"; then 45 | echo "$TEST_COMMIT was not signed with a trusted key!" 46 | fi 47 | else 48 | echo "There is a valid path from $TEST_COMMIT to $VERIFIED_ROOT where all commits are signed!" 49 | fi 50 | 51 | exit $RES 52 | -------------------------------------------------------------------------------- /contrib/verifysfbinaries/README.md: -------------------------------------------------------------------------------- 1 | ### Verify SF Binaries ### 2 | This script attempts to download the signature file `SHA256SUMS.asc` from https://bitcoin.org. 3 | 4 | It first checks if the signature passes, and then downloads the files specified in the file, and checks if the hashes of these files match those that are specified in the signature file. 5 | 6 | The script returns 0 if everything passes the checks. It returns 1 if either the signature check or the hash check doesn't pass. If an error occurs the return value is 2. -------------------------------------------------------------------------------- /depends/.gitignore: -------------------------------------------------------------------------------- 1 | SDKs/ 2 | work/ 3 | built/ 4 | sources/ 5 | config.site 6 | x86_64* 7 | i686* 8 | mips* 9 | arm* 10 | -------------------------------------------------------------------------------- /depends/builders/darwin.mk: -------------------------------------------------------------------------------- 1 | build_darwin_CC = gcc-5 2 | build_darwin_CXX = g++-5 3 | build_darwin_AR: = $(shell xcrun -f ar) 4 | build_darwin_RANLIB: = $(shell xcrun -f ranlib) 5 | build_darwin_STRIP: = $(shell xcrun -f strip) 6 | build_darwin_OTOOL: = $(shell xcrun -f otool) 7 | build_darwin_NM: = $(shell xcrun -f nm) 8 | build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 9 | build_darwin_SHA256SUM = shasum -a 256 10 | build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o 11 | 12 | #darwin host on darwin builder. overrides darwin host preferences. 13 | darwin_CC= gcc-5 -mmacosx-version-min=$(OSX_MIN_VERSION) 14 | darwin_CXX= g++-5 -mmacosx-version-min=$(OSX_MIN_VERSION) 15 | darwin_AR:=$(shell xcrun -f ar) 16 | darwin_RANLIB:=$(shell xcrun -f ranlib) 17 | darwin_STRIP:=$(shell xcrun -f strip) 18 | darwin_LIBTOOL:=$(shell xcrun -f libtool) 19 | darwin_OTOOL:=$(shell xcrun -f otool) 20 | darwin_NM:=$(shell xcrun -f nm) 21 | darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 22 | darwin_native_toolchain= 23 | -------------------------------------------------------------------------------- /depends/builders/default.mk: -------------------------------------------------------------------------------- 1 | default_build_CC = gcc 2 | default_build_CXX = g++ 3 | default_build_AR = ar 4 | default_build_RANLIB = ranlib 5 | default_build_STRIP = strip 6 | default_build_NM = nm 7 | default_build_OTOOL = otool 8 | default_build_INSTALL_NAME_TOOL = install_name_tool 9 | 10 | define add_build_tool_func 11 | build_$(build_os)_$1 ?= $$(default_build_$1) 12 | build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) 13 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 14 | endef 15 | $(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) 16 | define add_build_flags_func 17 | build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) 18 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 19 | endef 20 | $(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags)))) 21 | -------------------------------------------------------------------------------- /depends/builders/linux.mk: -------------------------------------------------------------------------------- 1 | build_linux_SHA256SUM = sha256sum 2 | build_linux_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O 3 | -------------------------------------------------------------------------------- /depends/hosts/darwin.mk: -------------------------------------------------------------------------------- 1 | OSX_MIN_VERSION=10.7 2 | OSX_SDK_VERSION=10.9 3 | OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk 4 | LD64_VERSION=241.9 5 | darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 6 | darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 7 | 8 | darwin_CFLAGS=-pipe 9 | darwin_CXXFLAGS=$(darwin_CFLAGS) 10 | 11 | darwin_release_CFLAGS=-O2 12 | darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) 13 | 14 | darwin_debug_CFLAGS=-O1 15 | darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) 16 | 17 | darwin_native_toolchain=native_cctools 18 | -------------------------------------------------------------------------------- /depends/hosts/default.mk: -------------------------------------------------------------------------------- 1 | default_host_CC = $(host_toolchain)gcc 2 | default_host_CXX = $(host_toolchain)g++ 3 | default_host_AR = $(host_toolchain)ar 4 | default_host_RANLIB = $(host_toolchain)ranlib 5 | default_host_STRIP = $(host_toolchain)strip 6 | default_host_LIBTOOL = $(host_toolchain)libtool 7 | default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool 8 | default_host_OTOOL = $(host_toolchain)otool 9 | default_host_NM = $(host_toolchain)nm 10 | 11 | define add_host_tool_func 12 | $(host_os)_$1?=$$(default_host_$1) 13 | $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) 14 | $(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) 15 | host_$1=$$($(host_arch)_$(host_os)_$1) 16 | endef 17 | 18 | define add_host_flags_func 19 | $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) 20 | $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) 21 | host_$1 = $$($(host_arch)_$(host_os)_$1) 22 | host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) 23 | endef 24 | 25 | $(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) 26 | $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) 27 | -------------------------------------------------------------------------------- /depends/hosts/linux.mk: -------------------------------------------------------------------------------- 1 | linux_CFLAGS=-pipe -fPIC 2 | linux_CXXFLAGS=$(linux_CFLAGS) 3 | 4 | linux_release_CFLAGS=-O1 5 | linux_release_CXXFLAGS=$(linux_release_CFLAGS) 6 | 7 | linux_debug_CFLAGS=-O1 8 | linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) 9 | 10 | linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 11 | 12 | ifeq (86,$(findstring 86,$(build_arch))) 13 | i686_linux_CC=gcc -m32 14 | i686_linux_CXX=g++ -m32 15 | i686_linux_AR=ar 16 | i686_linux_RANLIB=ranlib 17 | i686_linux_NM=nm 18 | i686_linux_STRIP=strip 19 | 20 | x86_64_linux_CC=gcc -m64 21 | x86_64_linux_CXX=g++ -m64 22 | x86_64_linux_AR=ar 23 | x86_64_linux_RANLIB=ranlib 24 | x86_64_linux_NM=nm 25 | x86_64_linux_STRIP=strip 26 | else 27 | i686_linux_CC=$(default_host_CC) -m32 28 | i686_linux_CXX=$(default_host_CXX) -m32 29 | x86_64_linux_CC=$(default_host_CC) -m64 30 | x86_64_linux_CXX=$(default_host_CXX) -m64 31 | endif 32 | -------------------------------------------------------------------------------- /depends/hosts/mingw32.mk: -------------------------------------------------------------------------------- 1 | mingw32_CC=x86_64-w64-mingw32-gcc-posix 2 | mingw32_CXX=x86_64-w64-mingw32-g++-posix 3 | mingw32_CFLAGS=-pipe -fopenmp -DPTW32_STATIC_LIB 4 | mingw32_CXXFLAGS=$(mingw32_CFLAGS) -std=c++11 5 | 6 | mingw32_release_CFLAGS=-O2 7 | mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) 8 | 9 | mingw32_debug_CFLAGS=-O1 10 | mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) 11 | 12 | mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 13 | -------------------------------------------------------------------------------- /depends/packages/bdb.mk: -------------------------------------------------------------------------------- 1 | package=bdb 2 | $(package)_version=6.2.23 3 | $(package)_download_path=http://download.oracle.com/berkeley-db 4 | $(package)_file_name=db-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=47612c8991aa9ac2f6be721267c8d3cdccf5ac83105df8e50809daea24e95dc7 6 | $(package)_build_subdir=build_unix 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-shared --enable-cxx --disable-replication 10 | $(package)_config_opts_mingw32=--enable-mingw 11 | $(package)_config_opts_linux=--with-pic 12 | endef 13 | 14 | define $(package)_config_cmds 15 | ../dist/$($(package)_autoconf) 16 | endef 17 | 18 | define $(package)_preprocess_cmds 19 | sed -i -e "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h 20 | endef 21 | 22 | define $(package)_build_cmds 23 | $(MAKE) libdb_cxx-6.2.a libdb-6.2.a 24 | endef 25 | 26 | define $(package)_stage_cmds 27 | $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include 28 | endef 29 | -------------------------------------------------------------------------------- /depends/packages/googlemock.mk: -------------------------------------------------------------------------------- 1 | # url=https://github.com/google/googlemock/archive/release-1.7.0.tar.gz 2 | 3 | package=googlemock 4 | $(package)_version=1.7.0 5 | $(package)_dependencies=googletest 6 | 7 | $(package)_download_path=https://github.com/google/$(package)/archive/ 8 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 9 | $(package)_download_file=release-$($(package)_version).tar.gz 10 | $(package)_sha256_hash=3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232 11 | 12 | define $(package)_set_vars 13 | $(package)_build_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" 14 | endef 15 | 16 | BUILD_OS := $(shell uname) 17 | ifeq ($(BUILD_OS),Darwin) 18 | $(package)_install=ginstall 19 | else 20 | $(package)_install=install 21 | endif 22 | 23 | define $(package)_build_cmds 24 | $(MAKE) -C make GTEST_DIR='$(host_prefix)' gmock-all.o 25 | endef 26 | 27 | define $(package)_stage_cmds 28 | $($(package)_install) -D ./make/gmock-all.o $($(package)_staging_dir)$(host_prefix)/lib/libgmock.a && \ 29 | cp -a ./include $($(package)_staging_dir)$(host_prefix)/include 30 | endef 31 | -------------------------------------------------------------------------------- /depends/packages/googletest.mk: -------------------------------------------------------------------------------- 1 | package=googletest 2 | $(package)_version=1.7.0 3 | $(package)_download_path=https://github.com/google/$(package)/archive/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_download_file=release-$($(package)_version).tar.gz 6 | $(package)_sha256_hash=f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc 7 | 8 | define $(package)_set_vars 9 | $(package)_build_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" 10 | endef 11 | 12 | BUILD_OS := $(shell uname) 13 | ifeq ($(BUILD_OS),Darwin) 14 | $(package)_install=ginstall 15 | else 16 | $(package)_install=install 17 | endif 18 | 19 | define $(package)_build_cmds 20 | $(MAKE) -C make gtest.a 21 | endef 22 | 23 | define $(package)_stage_cmds 24 | $($(package)_install) -D ./make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \ 25 | cp -a ./include $($(package)_staging_dir)$(host_prefix)/include 26 | endef 27 | -------------------------------------------------------------------------------- /depends/packages/libevent.mk: -------------------------------------------------------------------------------- 1 | package=libevent 2 | $(package)_version=2.1.8 3 | $(package)_download_path=https://github.com/libevent/libevent/archive/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_download_file=release-$($(package)_version)-stable.tar.gz 6 | $(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d 7 | 8 | define $(package)_preprocess_cmds 9 | ./autogen.sh 10 | endef 11 | 12 | define $(package)_set_vars 13 | $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress 14 | $(package)_config_opts_release=--disable-debug-mode 15 | $(package)_config_opts_linux=--with-pic 16 | endef 17 | 18 | define $(package)_config_cmds 19 | $($(package)_autoconf) 20 | endef 21 | 22 | define $(package)_build_cmds 23 | $(MAKE) 24 | endef 25 | 26 | define $(package)_stage_cmds 27 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 28 | endef 29 | 30 | define $(package)_postprocess_cmds 31 | endef 32 | -------------------------------------------------------------------------------- /depends/packages/libgmp.mk: -------------------------------------------------------------------------------- 1 | package=libgmp 2 | $(package)_download_path=https://github.com/z-classic/$(package)/archive/ 3 | $(package)_file_name=$(package)-$($(package)_git_commit).tar.gz 4 | $(package)_download_file=$($(package)_git_commit).tar.gz 5 | $(package)_sha256_hash=59b2c2b5d58fdf5943bfde1fa709e9eb53e7e072c9699d28dc1c2cbb3c8cc32c 6 | $(package)_git_commit=aece03c7b6967f91f3efdac8c673f55adff53ab1 7 | $(package)_dependencies= 8 | $(package)_config_opts=--enable-cxx --disable-shared 9 | 10 | define $(package)_config_cmds 11 | $($(package)_autoconf) --host=$(host) --build=$(build) 12 | endef 13 | 14 | define $(package)_build_cmds 15 | $(MAKE) 16 | endef 17 | 18 | define $(package)_stage_cmds 19 | $(MAKE) DESTDIR=$($(package)_staging_dir) install ; echo '=== staging find for $(package):' ; find $($(package)_staging_dir) 20 | endef 21 | -------------------------------------------------------------------------------- /depends/packages/librustzcash.mk: -------------------------------------------------------------------------------- 1 | package=librustzcash 2 | $(package)_version=0.1 3 | $(package)_download_path=https://github.com/zcash/$(package)/archive/ 4 | $(package)_file_name=$(package)-$($(package)_git_commit).tar.gz 5 | $(package)_download_file=$($(package)_git_commit).tar.gz 6 | $(package)_sha256_hash=a5760a90d4a1045c8944204f29fa2a3cf2f800afee400f88bf89bbfe2cce1279 7 | $(package)_git_commit=91348647a86201a9482ad4ad68398152dc3d635e 8 | $(package)_dependencies=rust 9 | ifeq ($(host_os),mingw32) 10 | rust_build=cargo build --release --lib --target="x86_64-pc-windows-gnu" 11 | rust_target=target/x86_64-pc-windows-gnu/release/rustzcash.lib $($(package)_staging_dir)$(host_prefix)/lib/librustzcash.a 12 | else 13 | rust_build=cargo build --release 14 | rust_target=target/release/librustzcash.a $($(package)_staging_dir)$(host_prefix)/lib/ 15 | endif 16 | 17 | define $(package)_build_cmds 18 | $(rust_build) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | mkdir $($(package)_staging_dir)$(host_prefix)/lib/ && \ 23 | mkdir $($(package)_staging_dir)$(host_prefix)/include/ && \ 24 | cp $(rust_target) && \ 25 | cp include/librustzcash.h $($(package)_staging_dir)$(host_prefix)/include/ 26 | endef -------------------------------------------------------------------------------- /depends/packages/libsnark.mk: -------------------------------------------------------------------------------- 1 | package=libsnark 2 | $(package)_download_path=https://github.com/ZencashOfficial/$(package)/releases/download/v20170131/ 3 | $(package)_file_name=$(package)-$($(package)_git_commit).tar.gz 4 | 5 | $(package)_sha256_hash=0c243deec42b133948cd5d77848f7988a79e82e5bf570c39d9a96ee7a42f5302 6 | $(package)_git_commit=3854b20c25e8bc567aab2b558dec84d45f4a3e73 7 | 8 | define $(package)_set_vars 9 | $(package)_build_env=CC="$($(package)_cc)" CXX="$($(package)_cxx)" 10 | $(package)_build_env+=CXXFLAGS="$($(package)_cxxflags) -DBINARY_OUTPUT -DSTATICLIB -DNO_PT_COMPRESSION=1 " 11 | endef 12 | 13 | $(package)_dependencies=libgmp libsodium 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) lib DEPINST=$(host_prefix) CURVE=ALT_BN128 MULTICORE=1 NO_PROCPS=1 NO_GTEST=1 NO_DOCS=1 STATIC=1 NO_SUPERCOP=1 FEATUREFLAGS=-DMONTGOMERY_OUTPUT OPTFLAGS="-O2 -march=x86-64" 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) install STATIC=1 DEPINST=$(host_prefix) PREFIX=$($(package)_staging_dir)$(host_prefix) CURVE=ALT_BN128 NO_SUPERCOP=1 21 | endef 22 | -------------------------------------------------------------------------------- /depends/packages/libsodium.mk: -------------------------------------------------------------------------------- 1 | package=libsodium 2 | $(package)_version=1.0.11 3 | $(package)_download_path=https://download.libsodium.org/libsodium/releases/old/unsupported/ 4 | $(package)_file_name=libsodium-1.0.11.tar.gz 5 | $(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765 6 | $(package)_dependencies= 7 | $(package)_config_opts= 8 | 9 | define $(package)_preprocess_cmds 10 | cd $($(package)_build_subdir); ./autogen.sh 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) --enable-static --disable-shared 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/native_ccache.mk: -------------------------------------------------------------------------------- 1 | package=native_ccache 2 | $(package)_version=3.3.1 3 | $(package)_download_path=https://www.samba.org/ftp/ccache 4 | $(package)_file_name=ccache-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=cb6e4bafbb19ba0a2ec43386b123a5f92a20e1e3384c071d5d13e0cb3c84bf73 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts= 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | 23 | define $(package)_postprocess_cmds 24 | rm -rf lib include 25 | endef 26 | -------------------------------------------------------------------------------- /depends/packages/packages.mk: -------------------------------------------------------------------------------- 1 | rust_packages := rust librustzcash 2 | proton_packages := proton 3 | zcash_packages := libsnark libgmp libsodium 4 | packages := boost openssl libevent zeromq $(zcash_packages) googletest googlemock 5 | native_packages := native_ccache 6 | 7 | wallet_packages=bdb 8 | 9 | upnp_packages=miniupnpc 10 | -------------------------------------------------------------------------------- /depends/packages/proton.mk: -------------------------------------------------------------------------------- 1 | package=proton 2 | $(package)_version=0.17.0 3 | $(package)_download_path=http://apache.cs.utah.edu/qpid/proton/$($(package)_version) 4 | $(package)_file_name=qpid-proton-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6ffd26d3d0e495bfdb5d9fefc5349954e6105ea18cc4bb191161d27742c5a01a 6 | $(package)_patches=minimal-build.patch 7 | 8 | define $(package)_preprocess_cmds 9 | patch -p1 < $($(package)_patch_dir)/minimal-build.patch && \ 10 | mkdir -p build/proton-c/src 11 | endef 12 | 13 | define $(package)_config_cmds 14 | cd build; cmake .. -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=/ -DSYSINSTALL_BINDINGS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_PYTHON=OFF -DBUILD_PHP=OFF -DBUILD_JAVA=OFF -DBUILD_PERL=OFF -DBUILD_RUBY=OFF -DBUILD_JAVASCRIPT=OFF -DBUILD_GO=OFF 15 | endef 16 | 17 | define $(package)_build_cmds 18 | cd build; $(MAKE) VERBOSE=1 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | cd build; $(MAKE) VERBOSE=1 DESTDIR=$($(package)_staging_prefix_dir) install 23 | endef 24 | 25 | -------------------------------------------------------------------------------- /depends/packages/rust.mk: -------------------------------------------------------------------------------- 1 | package=rust 2 | $(package)_version=1.16.0 3 | $(package)_download_path=https://static.rust-lang.org/dist 4 | $(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz 5 | $(package)_sha256_hash_linux=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd 6 | $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz 7 | $(package)_sha256_hash_darwin=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 8 | $(package)_file_name_mingw32=rust-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz 9 | $(package)_sha256_hash_mingw32=523cd248363afdc4e2c0e1f219607897b6925294a33154d7e67224addfd15eb0 10 | 11 | define $(package)_stage_cmds 12 | ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig 13 | endef -------------------------------------------------------------------------------- /depends/packages/zeromq.mk: -------------------------------------------------------------------------------- 1 | package=zeromq 2 | $(package)_version=4.2.1 3 | $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=27d1e82a099228ee85a7ddb2260f40830212402c605a4a10b5e5498a7e0e9d03 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts=--without-documentation --disable-shared --disable-curve 9 | $(package)_config_opts_linux=--with-pic 10 | endef 11 | 12 | define $(package)_config_cmds 13 | $($(package)_autoconf) 14 | endef 15 | 16 | define $(package)_build_cmds 17 | $(MAKE) src/libzmq.la 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA 22 | endef 23 | 24 | define $(package)_postprocess_cmds 25 | rm -rf bin share 26 | endef 27 | -------------------------------------------------------------------------------- /depends/patches/boost/deprecated_auto_ptr.patch: -------------------------------------------------------------------------------- 1 | --- boost_1_62_0-orig/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp 2016-09-29 14:03:47.317997658 +1300 2 | +++ boost_1_62_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp 2016-09-29 14:07:41.308726372 +1300 3 | @@ -13,10 +13,16 @@ 4 | 5 | #if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) 6 | #include 7 | +#include 8 | #include 9 | #include 10 | #include // for std::auto_ptr 11 | #include 12 | + 13 | +#if defined( BOOST_SP_DISABLE_DEPRECATED ) 14 | +#pragma GCC diagnostic push 15 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" 16 | +#endif 17 | #endif 18 | 19 | #ifdef BOOST_SPIRIT_THREADSAFE 20 | @@ -370,4 +376,10 @@ 21 | 22 | }} // namespace boost::spirit 23 | 24 | +#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) 25 | +#if defined( BOOST_SP_DISABLE_DEPRECATED ) 26 | +#pragma GCC diagnostic pop 27 | +#endif 28 | +#endif 29 | + 30 | #endif 31 | -------------------------------------------------------------------------------- /depends/patches/boost/include_poll.patch: -------------------------------------------------------------------------------- 1 | --- boost_1_62_0-orig/boost/asio/detail/socket_types.hpp 2016-09-21 15:33:21.000000000 +0100 2 | +++ boost_1_62_0/boost/asio/detail/socket_types.hpp 2016-10-18 03:08:41.712254217 +0100 3 | @@ -58,7 +58,7 @@ 4 | #else 5 | # include 6 | # if !defined(__SYMBIAN32__) 7 | -# include 8 | +# include 9 | # endif 10 | # include 11 | # include 12 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/fix-solaris-compilation.patch: -------------------------------------------------------------------------------- 1 | From 71ce1d6dfa5424f8fe8633e23494c7638ea2c79e Mon Sep 17 00:00:00 2001 2 | From: Thomas Bernard 3 | Date: Thu, 10 Nov 2016 21:55:33 +0100 4 | Subject: [PATCH] fix for Solaris 11 compilation 5 | 6 | see #216 7 | --- 8 | miniupnpc/Makefile | 2 ++ 9 | miniupnpc/minissdpc.c | 3 +++ 10 | 2 files changed, 5 insertions(+) 11 | 12 | diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile 13 | index 5c23000..72cdc0f 100644 14 | --- a/miniupnpc/Makefile 15 | +++ b/miniupnpc/Makefile 16 | @@ -43,10 +43,12 @@ CFLAGS += -D_NETBSD_SOURCE 17 | endif 18 | ifneq ($(OS), FreeBSD) 19 | ifneq ($(OS), Darwin) 20 | +ifneq ($(OS), SunOS) 21 | #CFLAGS += -D_POSIX_C_SOURCE=200112L 22 | CFLAGS += -D_XOPEN_SOURCE=600 23 | endif 24 | endif 25 | +endif 26 | #CFLAGS += -ansi 27 | # -DNO_GETADDRINFO 28 | INSTALL = install 29 | diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c 30 | index f200f07..263160e 100644 31 | --- a/miniupnpc/minissdpc.c 32 | +++ b/miniupnpc/minissdpc.c 33 | @@ -73,6 +73,9 @@ struct sockaddr_un { 34 | 35 | #if !defined(HAS_IP_MREQN) && !defined(_WIN32) 36 | #include 37 | +#if defined(__sun) 38 | +#include 39 | +#endif 40 | #endif 41 | 42 | #if defined(HAS_IP_MREQN) && defined(NEED_STRUCT_IP_MREQN) 43 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/patch-strlen-patch.patch: -------------------------------------------------------------------------------- 1 | From 0aa7c46227acd8ddb135c577674ad454bf2fba86 Mon Sep 17 00:00:00 2001 2 | From: Thomas Bernard 3 | Date: Fri, 11 Nov 2016 17:53:21 +0100 4 | Subject: [PATCH] remove unsigned/signed comparison 5 | 6 | --- 7 | miniupnpc/portlistingparse.c | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/miniupnpc/portlistingparse.c b/miniupnpc/portlistingparse.c 11 | index 1bed763..07f3f87 100644 12 | --- a/miniupnpc/portlistingparse.c 13 | +++ b/miniupnpc/portlistingparse.c 14 | @@ -55,7 +55,7 @@ startelt(void * d, const char * name, int l) 15 | pdata->curelt = PortMappingEltNone; 16 | for(i = 0; elements[i].str; i++) 17 | { 18 | - if(strlen(elements[i].str) == l && memcmp(name, elements[i].str, l) == 0) 19 | + if(strlen(elements[i].str) == (size_t)l && memcmp(name, elements[i].str, l) == 0) 20 | { 21 | pdata->curelt = elements[i].code; 22 | break; 23 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/strlen-before-memcmp.patch: -------------------------------------------------------------------------------- 1 | From ec1c49bb0cd5e448e6f0adee7de3a831c4869bdd Mon Sep 17 00:00:00 2001 2 | From: Thomas Bernard 3 | Date: Fri, 11 Nov 2016 17:24:39 +0100 4 | Subject: [PATCH] check strlen before memcmp 5 | 6 | 1st try to fix #220 7 | --- 8 | miniupnpc/portlistingparse.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/miniupnpc/portlistingparse.c b/miniupnpc/portlistingparse.c 12 | index 0e09278..1bed763 100644 13 | --- a/miniupnpc/portlistingparse.c 14 | +++ b/miniupnpc/portlistingparse.c 15 | @@ -55,7 +55,7 @@ startelt(void * d, const char * name, int l) 16 | pdata->curelt = PortMappingEltNone; 17 | for(i = 0; elements[i].str; i++) 18 | { 19 | - if(memcmp(name, elements[i].str, l) == 0) 20 | + if(strlen(elements[i].str) == l && memcmp(name, elements[i].str, l) == 0) 21 | { 22 | pdata->curelt = elements[i].code; 23 | break; 24 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.12.md: -------------------------------------------------------------------------------- 1 | Version 0.3.12 is now available. 2 | 3 | Features: 4 | * json-rpc errors return a more standard error object. (thanks to Gavin Andresen) 5 | * json-rpc command line returns exit codes. 6 | * json-rpc "backupwallet" command. 7 | * Recovers and continues if an exception is caused by a message you received. Other nodes shouldn't be able to cause an exception, and it hasn't happened before, but if a way is found to cause an exception, this would keep it from being used to stop network nodes. 8 | 9 | If you have json-rpc code that checks the contents of the error string, you need to change it to expect error objects of the form {"code":,"message":}, which is the standard. See this thread: 10 | http://www.bitcoin.org/smf/index.php?topic=969.0 11 | 12 | Download: 13 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.12/ 14 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.14.md: -------------------------------------------------------------------------------- 1 | Version 0.3.14 is now available 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.14/ 3 | 4 | Changes: 5 | * Key pool feature for safer wallet backup 6 | Gavin Andresen: 7 | * TEST network mode with switch -testnet 8 | * Option to use SSL for JSON-RPC connections on unix/osx 9 | * validateaddress RPC command 10 | eurekafag: 11 | * Russian translation 12 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.15.md: -------------------------------------------------------------------------------- 1 | * paytxfee switch is now per KB, so it adds the correct fee for large transactions 2 | * sending avoids using coins with less than 6 confirmations if it can 3 | * BitcoinMiner processes transactions in priority order based on age of dependencies 4 | * make sure generation doesn't start before block 74000 downloaded 5 | * bugfixes by Dean Gores 6 | * testnet, keypoololdest and paytxfee added to getinfo 7 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.16.md: -------------------------------------------------------------------------------- 1 | Never released. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.17.md: -------------------------------------------------------------------------------- 1 | Version 0.3.17 is now available. 2 | 3 | Changes: 4 | * new getwork, thanks m0mchil 5 | * added transaction fee setting in UI options menu 6 | * free transaction limits 7 | * sendtoaddress returns transaction id instead of "sent" 8 | * getaccountaddress 9 | 10 | The UI transaction fee setting was easy since it was still there from 0.1.5 and all I had to do was re-enable it. 11 | 12 | The accounts-based commands: move, sendfrom and getbalance will be in the next release. We still have some more changes to make first. 13 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.18.md: -------------------------------------------------------------------------------- 1 | Changes: 2 | * Fixed a wallet.dat compatibility problem if you downgraded from 0.3.17 and then upgraded again 3 | * IsStandard() check to only include known transaction types in blocks 4 | * Jgarzik's optimisation to speed up the initial block download a little 5 | 6 | The main addition in this release is the Accounts-Based JSON-RPC commands that Gavin's been working on (more details at http://www.bitcoin.org/smf/index.php?topic=1886.0). 7 | * getaccountaddress 8 | * sendfrom 9 | * move 10 | * getbalance 11 | * listtransactions 12 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.19.md: -------------------------------------------------------------------------------- 1 | There's more work to do on DoS, but I'm doing a quick build of what I have so far in case it's needed, before venturing into more complex ideas. The build for this is version 0.3.19. 2 | 3 | - Added some DoS controls 4 | As Gavin and I have said clearly before, the software is not at all resistant to DoS attack. This is one improvement, but there are still more ways to attack than I can count. 5 | 6 | I'm leaving the -limitfreerelay part as a switch for now and it's there if you need it. 7 | 8 | - Removed "safe mode" alerts 9 | "safe mode" alerts was a temporary measure after the 0.3.9 overflow bug. We can say all we want that users can just run with "-disablesafemode", but it's better just not to have it for the sake of appearances. It was never intended as a long term feature. Safe mode can still be triggered by seeing a longer (greater total PoW) invalid block chain. 10 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.20.1.md: -------------------------------------------------------------------------------- 1 | Never released or release notes were lost. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.20.2.md: -------------------------------------------------------------------------------- 1 | The maxsendbuffer bug (0.3.20.1 clients not being able to download the block chain from other 0.3.20.1 clients) was only going to get 2 | worse as people upgraded, so I cherry-picked the bug fix and created a minor release yesterday. 3 | 4 | The Amazon Machine Images I used to do the builds are available: 5 | 6 | ami-38a05251 Bitcoin-v0.3.20.2 Mingw (Windows; Administrator password 'bitcoin development') 7 | ami-30a05259 Bitcoin_0.3.20.2 Linux32 8 | ami-8abc4ee3 Bitcoin_0.3.20.2 Linux64 9 | 10 | (mac build will be done soon) 11 | 12 | If you have already downloaded version 0.3.20.1, please either add this to your bitcoin.conf file: 13 | 14 | maxsendbuffer=10000 15 | maxreceivebuffer=10000 16 | 17 | ... or download the new version. 18 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.20.md: -------------------------------------------------------------------------------- 1 | Please checkout the git integration branch from: 2 | 3 | https://github.com/bitcoin/bitcoin 4 | 5 | ... and help test. The new features that need testing are: 6 | 7 | * -nolisten : https://github.com/bitcoin/bitcoin/pull/11 8 | * -rescan : scan block chain for missing wallet transactions 9 | * -printtoconsole : https://github.com/bitcoin/bitcoin/pull/37 10 | * RPC gettransaction details : https://github.com/bitcoin/bitcoin/pull/24 11 | * listtransactions new features : https://github.com/bitcoin/bitcoin/pull/10 12 | 13 | Bug fixes that also need testing: 14 | 15 | * -maxconnections= : https://github.com/bitcoin/bitcoin/pull/42 16 | * RPC listaccounts minconf : https://github.com/bitcoin/bitcoin/pull/27 17 | * RPC move, add time to output : https://github.com/bitcoin/bitcoin/pull/21 18 | * ...and several improvements to --help output. 19 | 20 | This needs more testing on Windows! Please drop me a quick private message, email, or IRC message if you are able to do some testing. If you find bugs, please open an issue at: 21 | 22 | https://github.com/bitcoin/bitcoin/issues 23 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.21.md: -------------------------------------------------------------------------------- 1 | Binaries for Bitcoin version 0.3.21 are available at: 2 | https://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.21/ 3 | 4 | Changes and new features from the 0.3.20 release include: 5 | 6 | * Universal Plug and Play support. Enable automatic opening of a port for incoming connections by running bitcoin or bitcoind with the - -upnp=1 command line switch or using the Options dialog box. 7 | 8 | * Support for full-precision bitcoin amounts. You can now send, and bitcoin will display, bitcoin amounts smaller than 0.01. However, sending fewer than 0.01 bitcoins still requires a 0.01 bitcoin fee (so you can send 1.0001 bitcoins without a fee, but you will be asked to pay a fee if you try to send 0.0001). 9 | 10 | * A new method of finding bitcoin nodes to connect with, via DNS A records. Use the -dnsseed option to enable. 11 | 12 | For developers, changes to bitcoin's remote-procedure-call API: 13 | 14 | * New rpc command "sendmany" to send bitcoins to more than one address in a single transaction. 15 | 16 | * Several bug fixes, including a serious intermittent bug that would sometimes cause bitcoind to stop accepting rpc requests. 17 | 18 | * -logtimestamps option, to add a timestamp to each line in debug.log. 19 | 20 | * Immature blocks (newly generated, under 120 confirmations) are now shown in listtransactions. 21 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.22.md: -------------------------------------------------------------------------------- 1 | Download URL: https://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.22/ 2 | 3 | This is largely a bugfix and TX fee schedule release. We also hope to make 0.3.23 a quick release, to fix problems that the network has seen due to explosive growth in the past week. 4 | 5 | Notable changes: 6 | * Client will accept and relay TX's with 0.0005 BTC fee schedule (users still pay 0.01 BTC per kb, until next version) 7 | * Non-standard transactions accepted on testnet 8 | * Source code tree reorganized (prep for autotools build) 9 | * Remove "Generate Coins" option from GUI, and remove 4way SSE miner. Internal reference CPU miner remains available, but users are directed to external miners for best hash production. 10 | * IRC is overflowing. Client now bootstraps to channels #bitcoin00 - #bitcoin99 11 | * DNS names now may be used with -addnode, -connect (requires -dns to enable) 12 | 13 | RPC changes: 14 | * 'listtransactions' adds 'from' param, for range queries 15 | * 'move' may take account balances negative 16 | * 'settxfee' added, to manually set TX fee 17 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.23.md: -------------------------------------------------------------------------------- 1 | Win32, Linux, MacOSX and source releases for bitcoin v0.3.23 have been uploaded to 2 | https://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.23/ 3 | 4 | This is another quick bugfix release, trying to deal with the influx of new bitcoin users. 5 | 6 | Main items of note: 7 | 8 | * P2P connect-to-node logic changed to reduce timeout a bit. The network saw a huge influx of new users, who do not permit incoming connections. This change is a short-term hack, to more quickly hunt for useful P2P connections. Better "leaf node" logic is in the works, but this should let us limp along until then. One may use -upnp to properly forward ports, and help the network. 9 | * Transaction fee reduced to 0.0005 for new transactions 10 | * Client will relay transactions with fees as low as 0.0001 BTC 11 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.4.2.md: -------------------------------------------------------------------------------- 1 | Never released or release notes were lost. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.4.3.md: -------------------------------------------------------------------------------- 1 | bitcoind version 0.4.3 is now available for download at: 2 | http://luke.dashjr.org/programs/bitcoin/files/bitcoind-0.4.3/ (until Gavin uploads to SourceForge) 3 | 4 | This is a bugfix-only release based on 0.4.0. 5 | 6 | Please note that the wxBitcoin GUI client is no longer maintained nor supported. If someone would like to step up to maintain this, they should contact Luke-Jr. 7 | 8 | Please report bugs for the daemon only using the issue tracker at github: 9 | https://github.com/bitcoin/bitcoin/issues 10 | 11 | Stable source code is hosted at Gitorious: 12 | http://gitorious.org/bitcoin/bitcoind-stable/archive-tarball/v0.4.3#.tar.gz 13 | 14 | BUG FIXES 15 | 16 | Cease locking memory used by non-sensitive information (this caused a huge performance hit on some platforms, especially noticable during initial blockchain download). 17 | Fixed some address-handling deadlocks (client freezes). 18 | No longer accept inbound connections over the internet when Bitcoin is being used with Tor (identity leak). 19 | Use the correct base transaction fee of 0.0005 BTC for accepting transactions into mined blocks (since 0.4.0, it was incorrectly accepting 0.0001 BTC which was only meant to be relayed). 20 | Add new DNS seeds (maintained by Pieter Wuille and Luke Dashjr). 21 | 22 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.4.5.md: -------------------------------------------------------------------------------- 1 | Never released or release notes were lost. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.5.2.md: -------------------------------------------------------------------------------- 1 | Bitcoin version 0.5.2 is now available for download at: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.5.2/ 3 | 4 | This is a bugfix-only release based on 0.5.1. 5 | 6 | Please report bugs using the issue tracker at github: 7 | https://github.com/bitcoin/bitcoin/issues 8 | 9 | Stable source code is hosted at Gitorious: 10 | http://gitorious.org/bitcoin/bitcoind-stable/archive-tarball/v0.5.2#.tar.gz 11 | 12 | BUG FIXES 13 | 14 | Check all transactions in blocks after the last checkpoint (0.5.0 and 0.5.1 skipped checking ECDSA signatures during initial blockchain download). 15 | Cease locking memory used by non-sensitive information (this caused a huge performance hit on some platforms, especially noticable during initial blockchain download; this was 16 | not a security vulnerability). 17 | Fixed some address-handling deadlocks (client freezes). 18 | No longer accept inbound connections over the internet when Bitcoin is being used with Tor (identity leak). 19 | Re-enable SSL support for the JSON-RPC interface (it was unintentionally disabled for the 0.5.0 and 0.5.1 release Linux binaries). 20 | Use the correct base transaction fee of 0.0005 BTC for accepting transactions into mined blocks (since 0.4.0, it was incorrectly accepting 0.0001 BTC which was only meant to be relayed). 21 | Don't show "IP" for transactions which are not necessarily IP transactions. 22 | Add new DNS seeds (maintained by Pieter Wuille and Luke Dashjr). 23 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.6.1.md: -------------------------------------------------------------------------------- 1 | Never released 2 | 3 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.6.3.md: -------------------------------------------------------------------------------- 1 | Bitcoin version 0.6.3 is now available for download at: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.6.3/ 3 | 4 | This is a bug-fix release, with no new features. 5 | 6 | Please report bugs using the issue tracker at github: 7 | https://github.com/bitcoin/bitcoin/issues 8 | 9 | CHANGE SUMMARY 10 | 11 | Fixed a serious denial-of-service attack that could cause the 12 | bitcoin process to become unresponsive. Thanks to Sergio Lerner 13 | for finding and responsibly reporting the problem. (CVE-2012-3789) 14 | 15 | Optimized the process of checking transaction signatures, to 16 | speed up processing of new block messages and make propagating 17 | blocks across the network faster. 18 | 19 | Fixed an obscure bug that could cause the bitcoin process to get 20 | stuck on an invalid block-chain, if the invalid chain was 21 | hundreds of blocks long. 22 | 23 | Bitcoin-Qt no longer automatically selects the first address 24 | in the address book (Issue #1384). 25 | 26 | Fixed minimize-to-dock behavior of Bitcon-Qt on the Mac. 27 | 28 | Added a block checkpoint at block 185,333 to speed up initial 29 | blockchain download. 30 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.8.1.md: -------------------------------------------------------------------------------- 1 | Bitcoin-Qt/bitcoind version 0.8.1 is now available from: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.1/ 3 | 4 | This is a maintenance release that adds a new network rule to avoid 5 | a chain-forking incompatibility with versions 0.7.2 and earlier. 6 | 7 | Please report bugs using the issue tracker at github: 8 | https://github.com/bitcoin/bitcoin/issues 9 | 10 | 11 | How to Upgrade 12 | -------------- 13 | 14 | If you are running an older version, shut it down. Wait 15 | until it has completely shut down (which might take a few minutes for older 16 | versions), then run the installer (on Windows) or just copy over 17 | /Applications/Bitcoin-Qt (on Mac) or bitcoind/bitcoin-qt (on Linux). 18 | 19 | If you are upgrading from version 0.7.2 or earlier, the first time you 20 | run 0.8.1 your blockchain files will be re-indexed, which will take 21 | anywhere from 30 minutes to several hours, depending on the speed of 22 | your machine. 23 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.8.3.md: -------------------------------------------------------------------------------- 1 | Bitcoin-Qt version 0.8.3 is now available from: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.3/ 3 | 4 | This is a maintenance release to fix a denial-of-service attack that 5 | can cause nodes to crash. 6 | 7 | Please report bugs using the issue tracker at github: 8 | https://github.com/bitcoin/bitcoin/issues 9 | 10 | 0.8.3 Release notes 11 | 12 | Truncate over-size messages to prevent a memory exhaustion attack. 13 | 14 | Fix a regression that causes excessive re-writing of the 'peers.dat' file. 15 | 16 | 17 | Thanks to Peter Todd for responsibly disclosing the vulnerability 18 | ( CVE-2013-4627 ) and creating a fix. 19 | -------------------------------------------------------------------------------- /doc/files.md: -------------------------------------------------------------------------------- 1 | * btcprivate.conf: contains configuration settings for btcpd 2 | * btcpd.pid: stores the process id of btcpd while running 3 | * blocks/blk000??.dat: block data (custom, 128 MiB per file) 4 | * blocks/rev000??.dat; block undo data (custom) 5 | * blocks/index/*; block index (LevelDB) 6 | * chainstate/*; block chain state database (LevelDB) 7 | * database/*: BDB database environment 8 | * db.log: wallet database log file 9 | * debug.log: contains debug information and general logging generated by btcpd 10 | * fee_estimates.dat: stores statistics used to estimate minimum transaction fees and priorities required for confirmation 11 | * peers.dat: peer IP address database (custom format) 12 | * wallet.dat: personal wallet (BDB) with keys and transactions 13 | * .cookie: session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown): since 0.12.0 14 | * onion_private_key: cached Tor hidden service private key for `-listenonion`: since 0.12.0 15 | -------------------------------------------------------------------------------- /doc/man/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man1_MANS=btcpd.1 btcp-cli.1 zcash-fetch-params.1 zcash-tx.1 2 | -------------------------------------------------------------------------------- /doc/man/zcash-fetch-params.1: -------------------------------------------------------------------------------- 1 | .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. 2 | .TH ZCASH-FETCH-PARAMS "1" "January 2017" "Zcash - zcash-fetch-params" "User Commands" 3 | .SH NAME 4 | zcash-fetch-params \- Downloads the Zcash network parameters 5 | .SH DESCRIPTION 6 | Zcash \- zcash-fetch\-params 7 | .PP 8 | This script will fetch the Zcash zkSNARK parameters and verify their 9 | integrity with sha256sum. 10 | .PP 11 | If they already exist locally, it will exit now and do nothing else. 12 | .PP 13 | This script will fetch the Zcash zkSNARK parameters and verify their 14 | integrity with sha256sum. 15 | .PP 16 | If they already exist locally, it will exit now and do nothing else. 17 | .SH "SEE ALSO" 18 | The full documentation for 19 | .B Zcash 20 | is maintained as a Texinfo manual. If the 21 | .B info 22 | and 23 | .B Zcash 24 | programs are properly installed at your site, the command 25 | .IP 26 | .B info Zcash 27 | .PP 28 | should give you access to the complete manual. 29 | -------------------------------------------------------------------------------- /doc/release-notes.md: -------------------------------------------------------------------------------- 1 | (note: this is a temporary file, to be added-to by anybody, and moved to 2 | release-notes at release time) 3 | 4 | Notable changes 5 | =============== 6 | 7 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-0.11.2.z6.md: -------------------------------------------------------------------------------- 1 | Jack Grigg (4): 2 | Equihash: Only compare the first n/(k+1) bits when sorting. 3 | Randomise the nonce in the block header. 4 | Clear mempool before using it for benchmark test, fix parameter name. 5 | Fix memory leak in large tx benchmark. 6 | 7 | Sean Bowe (5): 8 | Increase block size to 2MB and update performance test. 9 | Make sigop limit `20000` just as in Bitcoin, ignoring our change to the blocksize limit. 10 | Remove the mainnet checkpoints. 11 | Fix performance test for block verification. 12 | Make `validatelargetx` test more accurate. 13 | 14 | Taylor Hornby (1): 15 | Add example mock test of CheckTransaction. 16 | 17 | aniemerg (1): 18 | Suppress Libsnark Debugging Info. 19 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.0-rc4.md: -------------------------------------------------------------------------------- 1 | Daira Hopwood (3): 2 | Update pchMessageStart for mainnet and testnet. 3 | Update version numbers for 1.0.0-rc4. 4 | Add release notes for 1.0.0-rc4. 5 | 6 | Jack Grigg (4): 7 | Integrate production Founders' Reward keys 8 | Remove Founders' Reward override from #1398 9 | Regenerate mainnet and testnet genesis blocks for nMaxTipAge change 10 | Update tests for new genesis blocks 11 | 12 | Sean Bowe (1): 13 | Zcash zk-SNARK public parameters for 1.0 "Sprout". 14 | 15 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.0.md: -------------------------------------------------------------------------------- 1 | Jack Grigg (8): 2 | Rework zcutil/build-debian-package.sh to place files correctly 3 | Add lintian check to zcutil/build-debian-package.sh 4 | Fix DEBIAN/control errors raised by lintian 5 | Build libsnark with -march=x86-64 instead of -march=native 6 | Disable the metrics screen on regtest 7 | Add the Zcash genesis blocks 8 | Update tests for new genesis blocks 9 | Update version strings to 1.0.0 10 | 11 | Kevin Gallagher (6): 12 | Use fakeroot to build Debian package 13 | Update Debian package maintainer scripts 14 | Fixes executable mode of maintainer scripts 15 | Add DEBIAN/rules file (required by policy) 16 | Adds zcash.examples and zcash.manpages 17 | Run Lintian after built package is copied to $SRC_PATH 18 | 19 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.10-1.md: -------------------------------------------------------------------------------- 1 | Jack Grigg (1): 2 | Disable building Proton in Gitian 3 | 4 | Sean Bowe (2): 5 | Revert "Remove an unneeded version workaround as per @str4d's review comment." 6 | Revert "Delete old protocol version constants and simplify code that used them." 7 | 8 | Simon Liu (2): 9 | make-release.py: Versioning changes for 1.0.10-1. 10 | make-release.py: Updated manpages for 1.0.10-1. 11 | 12 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.2.md: -------------------------------------------------------------------------------- 1 | ITH4Coinomia (2): 2 | Update security-warnings.md 3 | Update init.cpp 4 | 5 | S. Matthew English (1): 6 | enforcing consistency 'tor' to 'Tor' 7 | 8 | Sean Bowe (1): 9 | Write R1CS output to file in GenerateParams. 10 | 11 | Simon (4): 12 | Fixes #1762 segfault when miner is interrupted. 13 | Fixes #1779 so that sending to multiple zaddrs no longer fails. 14 | Add GenIdentity, an identity function for MappedShuffle. 15 | Add transaction size and zaddr output limit checks to z_sendmany. 16 | 17 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.7-1.md: -------------------------------------------------------------------------------- 1 | Jay Graber (3): 2 | Add -t to git fetch for release-notes.py 3 | Update version to 1.0.7-1 4 | Update auto-generated manpages to 1.0.7-1 5 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.8-1.md: -------------------------------------------------------------------------------- 1 | Daira Hopwood (3): 2 | Don't rely on a finite upper bound on fee rate or priority. 3 | Simplify JoinSplit priority calculation. refs 1896 4 | Add check for JoinSplit priority as calculated by CCoinsViewCache::GetPriority. 5 | 6 | Jack Grigg (1): 7 | Use a larger -rpcclienttimeout for slow performance measurements 8 | 9 | Nathan Wilcox (2): 10 | Bump version numbers for v1.0.8-1. 11 | Commit the changes from gen-manpages.sh, except manually tweak the version strings. 12 | 13 | str4d (2): 14 | Update tests to check actual infinity as well as INF_FEERATE 15 | Add unit test for security issue 2017-04-11.a 16 | 17 | -------------------------------------------------------------------------------- /doc/testnet.md: -------------------------------------------------------------------------------- 1 | Connecting to testnet 2 | ========================================================== 3 | 4 | First, follow the build instructions in [README](/README.md) 5 | 6 | Then, to run btcpd and connect to testnet 7 | 8 | #### Linux 9 | ``` 10 | mkdir ~/.btcprivate 11 | touch ~/.btcprivate/btcprivate.conf 12 | ./src/btcpd -testnet -gen 13 | ``` 14 | 15 | #### Windows 16 | Click on Start/Windows Logo and type `cmd` once there type `start %AppData%\`. It will open the explorer in that directory. Create a new folder called "BTCPrivate" and a text file. Open the text file and save as as `btcprivate.conf` (be sure you remove the txt extension) in the directory. An empty file is sufficient 17 | 18 | Create a Batch file in the BTCP directory called "start-wallet.bat" with the following: 19 | 20 | ``` 21 | echo "Starting the BTCP Wallet" 22 | powershell -Command ".btcpd.exe" -testnet -gen 23 | @pause 24 | ``` 25 | 26 | Run start-wallet.bat and the blockchain will begin to be synced. After it is synced it will begin mining blocks. If you don't wish to mine remov the -gen option from the batch file. 27 | Now that you have your node up you can use `btcp-cli.exe` in cmd to make RPC calls to your node (i.e `btcp-cli.exe -testnet getinfo`). 28 | -------------------------------------------------------------------------------- /doc/unit-tests.md: -------------------------------------------------------------------------------- 1 | Compiling/running automated tests 2 | --------------------------------- 3 | 4 | Automated tests will be automatically compiled if dependencies were met in configure 5 | and tests weren't explicitly disabled. 6 | 7 | There are two scripts for running tests: 8 | 9 | * ``qa/zcash/full-test-suite.sh``, to run the main test suite 10 | * ``qa/pull-tester/rpc-tests.sh``, to run the RPC tests. 11 | 12 | The main test suite uses two different testing frameworks. Tests using the Boost 13 | framework are under ``src/test/``; tests using the Google Test/Google Mock 14 | framework are under ``src/gtest/`` and ``src/wallet/gtest/``. The latter framework 15 | is preferred for new Zcash unit tests. 16 | 17 | RPC tests are implemented in Python under the ``qa/rpc-tests/`` directory. 18 | -------------------------------------------------------------------------------- /fork-instructions.md: -------------------------------------------------------------------------------- 1 | 2 | # Instructions to set up a BitcoinPrivate full-node to Mine the Fork 3 | Linux ONLY, 500GB+ recommended 4 | 5 | *You will not receive a mining reward if you choose to help mine the fork* 6 | 7 | **Bitcoin Private** 8 | 9 | March 2, 2018 10 | 11 | # 12 | 13 | **Install Bitcoin Private** 14 | 15 | Follow the instructions [here](https://github.com/BTCPrivate/BitcoinPrivate/blob/master/README.md). 16 | 17 | **Download + Decompress Snapshot Data (BTC UTXOs)** 18 | ``` 19 | cd ~/.btcprivate/ 20 | curl https://s3.amazonaws.com/btcp.snapshot/utxo_snapshot.tar.gz | tar xvz 21 | ``` 22 | 23 | You can also generate the utxo_snapshot yourself [here](https://github.com/BTCPrivate/utxo_dump). 24 | 25 | **Make the config file** 26 | ``` 27 | mkdir ~/.btcprivate 28 | touch ~/.btcprivate/btcprivate.conf 29 | ``` 30 | 31 | **Run the daemon** 32 | ``` 33 | cd ~/BitcoinPrivate 34 | ./src/btcpd 35 | ``` 36 | -------------------------------------------------------------------------------- /libzcashconsensus.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: BTCPrivate consensus library 7 | Description: Library for the BTCPrivate consensus protocol. 8 | Version: @PACKAGE_VERSION@ 9 | Libs: -L${libdir} -lzcashconsensus 10 | Cflags: -I${includedir} 11 | Requires.private: libcrypto 12 | -------------------------------------------------------------------------------- /qa/pull-tester/run-bitcoin-cli: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs 4 | # from the output if present. It is necessary when using bitcoin-cli.exe on 5 | # Linux since shells will interpret the line-endings as part of the result. 6 | 7 | CURDIR=$(cd $(dirname "$0"); pwd) 8 | # Get BUILDDIR and REAL_BITCOIND 9 | 10 | # Grab the value of $REAL_BITCOINCLI which may be bitcoin-cli.exe. 11 | . "${CURDIR}/tests-config.sh" 12 | 13 | "${REAL_BITCOINCLI}" "$@" | sed 's/\r//' 14 | -------------------------------------------------------------------------------- /qa/pull-tester/tests-config.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2013-2014 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | BUILDDIR="@abs_top_builddir@" 7 | EXEEXT="@EXEEXT@" 8 | 9 | # These will turn into comments if they were disabled when configuring. 10 | @ENABLE_WALLET_TRUE@ENABLE_WALLET=1 11 | @BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1 12 | @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1 13 | @ENABLE_ZMQ_TRUE@ENABLE_ZMQ=1 14 | @ENABLE_PROTON_TRUE@ENABLE_PROTON=1 15 | 16 | REAL_BITCOIND="$BUILDDIR/src/btcpd${EXEEXT}" 17 | REAL_BITCOINCLI="$BUILDDIR/src/btcp-cli${EXEEXT}" 18 | 19 | -------------------------------------------------------------------------------- /qa/rpc-tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | cache 3 | -------------------------------------------------------------------------------- /qa/rpc-tests/disablewallet.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # Copyright (c) 2014 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | # 7 | # Exercise API with -disablewallet. 8 | # 9 | 10 | from test_framework.test_framework import BitcoinTestFramework 11 | from test_framework.util import * 12 | 13 | class DisableWalletTest (BitcoinTestFramework): 14 | 15 | def setup_chain(self): 16 | print("Initializing test directory "+self.options.tmpdir) 17 | initialize_chain_clean(self.options.tmpdir, 1) 18 | 19 | def setup_network(self, split=False): 20 | self.nodes = start_nodes(1, self.options.tmpdir, [['-disablewallet']]) 21 | self.is_network_split = False 22 | self.sync_all() 23 | 24 | def run_test (self): 25 | # Check regression: https://github.com/bitcoin/bitcoin/issues/6963#issuecomment-154548880 26 | x = self.nodes[0].validateaddress('t3b1jtLvxCstdo1pJs9Tjzc5dmWyvGQSZj8') 27 | assert(x['isvalid'] == False) 28 | x = self.nodes[0].validateaddress('tmGqwWtL7RsbxikDSN26gsbicxVr2xJNe86') 29 | assert(x['isvalid'] == True) 30 | 31 | if __name__ == '__main__': 32 | DisableWalletTest ().main () 33 | -------------------------------------------------------------------------------- /qa/rpc-tests/reindex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # Copyright (c) 2014 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | # 7 | # Test -reindex with CheckBlockIndex 8 | # 9 | from test_framework.test_framework import BitcoinTestFramework 10 | from test_framework.util import * 11 | import os.path 12 | 13 | class ReindexTest(BitcoinTestFramework): 14 | 15 | def setup_chain(self): 16 | print("Initializing test directory "+self.options.tmpdir) 17 | initialize_chain_clean(self.options.tmpdir, 1) 18 | 19 | def setup_network(self): 20 | self.nodes = [] 21 | self.is_network_split = False 22 | self.nodes.append(start_node(0, self.options.tmpdir)) 23 | 24 | def run_test(self): 25 | self.nodes[0].generate(3) 26 | stop_node(self.nodes[0], 0) 27 | wait_bitcoinds() 28 | self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug", "-reindex", "-checkblockindex=1"]) 29 | assert_equal(self.nodes[0].getblockcount(), 3) 30 | print "Success" 31 | 32 | if __name__ == '__main__': 33 | ReindexTest().main() 34 | -------------------------------------------------------------------------------- /qa/rpc-tests/test_framework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/qa/rpc-tests/test_framework/__init__.py -------------------------------------------------------------------------------- /qa/zcash/ensure-no-dot-so-in-depends.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python2 2 | 3 | import sys 4 | import os 5 | 6 | def main(): 7 | this_script = os.path.abspath(sys.argv[0]) 8 | basedir = os.path.dirname(this_script) 9 | arch_dir = os.path.join( 10 | basedir, 11 | '..', 12 | '..', 13 | 'depends', 14 | 'x86_64-unknown-linux-gnu', 15 | ) 16 | 17 | exit_code = 0 18 | 19 | if os.path.isdir(arch_dir): 20 | lib_dir = os.path.join(arch_dir, 'lib') 21 | libraries = os.listdir(lib_dir) 22 | 23 | for lib in libraries: 24 | if lib.find(".so") != -1: 25 | print lib 26 | exit_code = 1 27 | else: 28 | exit_code = 2 29 | print "arch-specific build dir not present: {}".format(arch_dir) 30 | print "Did you build the ./depends tree?" 31 | print "Are you on a currently unsupported architecture?" 32 | 33 | if exit_code == 0: 34 | print "PASS." 35 | else: 36 | print "FAIL." 37 | 38 | sys.exit(exit_code) 39 | 40 | if __name__ == '__main__': 41 | main() 42 | -------------------------------------------------------------------------------- /qa/zcash/full-test-suite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Execute all of the automated tests related to Zcash. 4 | # 5 | 6 | set -eu 7 | 8 | SUITE_EXIT_STATUS=0 9 | REPOROOT="$(readlink -f "$(dirname "$0")"/../../)" 10 | 11 | function run_test_phase 12 | { 13 | echo "===== BEGIN: $*" 14 | set +e 15 | eval "$@" 16 | if [ $? -eq 0 ] 17 | then 18 | echo "===== PASSED: $*" 19 | else 20 | echo "===== FAILED: $*" 21 | SUITE_EXIT_STATUS=1 22 | fi 23 | set -e 24 | } 25 | 26 | cd "${REPOROOT}" 27 | 28 | # Test phases: 29 | run_test_phase "${REPOROOT}/qa/zcash/check-security-hardening.sh" 30 | run_test_phase "${REPOROOT}/qa/zcash/ensure-no-dot-so-in-depends.py" 31 | 32 | # If make check fails, show test-suite.log as part of our run_test_phase 33 | # output (and fail the phase with false): 34 | run_test_phase make check '||' \ 35 | '{' \ 36 | echo '=== ./src/test-suite.log ===' ';' \ 37 | cat './src/test-suite.log' ';' \ 38 | false ';' \ 39 | '}' 40 | 41 | exit $SUITE_EXIT_STATUS 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /share/pixmaps/addressbook16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/addressbook16.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/addressbook16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/addressbook20.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/addressbook20mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/bitcoin-bc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin-bc.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin128.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin16.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin256.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin32.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/bitcoin64.png -------------------------------------------------------------------------------- /share/pixmaps/check.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/check.ico -------------------------------------------------------------------------------- /share/pixmaps/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/favicon.ico -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/send16.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/send16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16masknoshadow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/send16masknoshadow.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/send20.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/share/pixmaps/send20mask.bmp -------------------------------------------------------------------------------- /share/ui.rc: -------------------------------------------------------------------------------- 1 | bitcoin ICON "pixmaps/bitcoin.ico" 2 | 3 | #include "wx/msw/wx.rc" 4 | 5 | check ICON "pixmaps/check.ico" 6 | send16 BITMAP "pixmaps/send16.bmp" 7 | send16mask BITMAP "pixmaps/send16mask.bmp" 8 | send16masknoshadow BITMAP "pixmaps/send16masknoshadow.bmp" 9 | send20 BITMAP "pixmaps/send20.bmp" 10 | send20mask BITMAP "pixmaps/send20mask.bmp" 11 | addressbook16 BITMAP "pixmaps/addressbook16.bmp" 12 | addressbook16mask BITMAP "pixmaps/addressbook16mask.bmp" 13 | addressbook20 BITMAP "pixmaps/addressbook20.bmp" 14 | addressbook20mask BITMAP "pixmaps/addressbook20mask.bmp" 15 | favicon ICON "pixmaps/favicon.ico" 16 | -------------------------------------------------------------------------------- /src/Makefile.zcash.include: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS += \ 2 | zcash/GenerateParams \ 3 | zcash/CreateJoinSplit 4 | 5 | # tool for generating our public parameters 6 | zcash_GenerateParams_SOURCES = zcash/GenerateParams.cpp 7 | zcash_GenerateParams_LDADD = \ 8 | $(BOOST_LIBS) \ 9 | $(LIBZCASH) \ 10 | $(LIBBITCOIN_UTIL) \ 11 | $(LIBBITCOIN_CRYPTO) \ 12 | $(LIBZCASH_LIBS) 13 | 14 | # tool for profiling the creation of joinsplits 15 | zcash_CreateJoinSplit_SOURCES = zcash/CreateJoinSplit.cpp 16 | zcash_CreateJoinSplit_LDADD = \ 17 | $(LIBBITCOIN_COMMON) \ 18 | $(LIBZCASH) \ 19 | $(LIBBITCOIN_UTIL) \ 20 | $(LIBBITCOIN_CRYPTO) \ 21 | $(BOOST_LIBS) \ 22 | $(LIBZCASH_LIBS) 23 | -------------------------------------------------------------------------------- /src/alertkeys.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_ALERTKEYS_H 2 | #define BITCOIN_ALERTKEYS_H 3 | 4 | // REMINDER: DO NOT COMMIT YOUR PRIVATE KEYS TO THE GIT REPOSITORY! 5 | 6 | const char* pszPrivKey = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; 7 | const char* pszTestNetPrivKey = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /src/amount.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "amount.h" 7 | 8 | #include "tinyformat.h" 9 | 10 | CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) 11 | { 12 | if (nSize > 0) 13 | nSatoshisPerK = nFeePaid*1000/nSize; 14 | else 15 | nSatoshisPerK = 0; 16 | } 17 | 18 | CAmount CFeeRate::GetFee(size_t nSize) const 19 | { 20 | CAmount nFee = nSatoshisPerK*nSize / 1000; 21 | 22 | if (nFee == 0 && nSatoshisPerK > 0) 23 | nFee = nSatoshisPerK; 24 | 25 | return nFee; 26 | } 27 | 28 | std::string CFeeRate::ToString() const 29 | { 30 | return strprintf("%d.%08d BTCP/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN); 31 | } 32 | -------------------------------------------------------------------------------- /src/amqp/amqpabstractnotifier.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "amqpabstractnotifier.h" 6 | #include "util.h" 7 | 8 | 9 | AMQPAbstractNotifier::~AMQPAbstractNotifier() 10 | { 11 | } 12 | 13 | bool AMQPAbstractNotifier::NotifyBlock(const CBlockIndex * /*CBlockIndex*/) 14 | { 15 | return true; 16 | } 17 | 18 | bool AMQPAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/) 19 | { 20 | return true; 21 | } 22 | -------------------------------------------------------------------------------- /src/amqp/amqpabstractnotifier.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef ZCASH_AMQP_AMQPABSTRACTNOTIFIER_H 6 | #define ZCASH_AMQP_AMQPABSTRACTNOTIFIER_H 7 | 8 | #include "amqpconfig.h" 9 | 10 | class CBlockIndex; 11 | class AMQPAbstractNotifier; 12 | 13 | typedef AMQPAbstractNotifier* (*AMQPNotifierFactory)(); 14 | 15 | class AMQPAbstractNotifier 16 | { 17 | public: 18 | AMQPAbstractNotifier() { } 19 | virtual ~AMQPAbstractNotifier(); 20 | 21 | template 22 | static AMQPAbstractNotifier* Create() 23 | { 24 | return new T(); 25 | } 26 | 27 | std::string GetType() const { return type; } 28 | void SetType(const std::string &t) { type = t; } 29 | std::string GetAddress() const { return address; } 30 | void SetAddress(const std::string &a) { address = a; } 31 | 32 | virtual bool Initialize() = 0; 33 | virtual void Shutdown() = 0; 34 | 35 | virtual bool NotifyBlock(const CBlockIndex *pindex); 36 | virtual bool NotifyTransaction(const CTransaction &transaction); 37 | 38 | protected: 39 | std::string type; 40 | std::string address; 41 | }; 42 | 43 | #endif // ZCASH_AMQP_AMQPABSTRACTNOTIFIER_H 44 | -------------------------------------------------------------------------------- /src/amqp/amqpconfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef ZCASH_AMQP_AMQPCONFIG_H 6 | #define ZCASH_AMQP_AMQPCONFIG_H 7 | 8 | #if defined(HAVE_CONFIG_H) 9 | #include "config/bitcoin-config.h" 10 | #endif 11 | 12 | #include 13 | #include 14 | 15 | #if ENABLE_PROTON 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #endif 29 | 30 | #include "primitives/block.h" 31 | #include "primitives/transaction.h" 32 | 33 | #endif // ZCASH_AMQP_AMQPCONFIG_H 34 | -------------------------------------------------------------------------------- /src/amqp/amqpnotificationinterface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef ZCASH_AMQP_AMQPNOTIFICATIONINTERFACE_H 6 | #define ZCASH_AMQP_AMQPNOTIFICATIONINTERFACE_H 7 | 8 | #include "validationinterface.h" 9 | #include 10 | #include 11 | 12 | class CBlockIndex; 13 | class AMQPAbstractNotifier; 14 | 15 | class AMQPNotificationInterface : public CValidationInterface 16 | { 17 | public: 18 | virtual ~AMQPNotificationInterface(); 19 | 20 | static AMQPNotificationInterface* CreateWithArguments(const std::map &args); 21 | 22 | protected: 23 | bool Initialize(); 24 | void Shutdown(); 25 | 26 | // CValidationInterface 27 | void SyncTransaction(const CTransaction &tx, const CBlock *pblock); 28 | void UpdatedBlockTip(const CBlockIndex *pindex); 29 | 30 | private: 31 | AMQPNotificationInterface(); 32 | 33 | std::list notifiers; 34 | }; 35 | 36 | #endif // ZCASH_AMQP_AMQPNOTIFICATIONINTERFACE_H 37 | -------------------------------------------------------------------------------- /src/chainparamsseeds.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_CHAINPARAMSSEEDS_H 2 | #define BITCOIN_CHAINPARAMSSEEDS_H 3 | /** 4 | * List of fixed seed nodes for the bitcoin network 5 | * AUTOGENERATED by contrib/seeds/generate-seeds.py 6 | * 7 | * Each line contains a 16-byte IPv6 address and a port. 8 | * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. 9 | */ 10 | static SeedSpec6 pnSeed6_main[] = { 11 | }; 12 | 13 | static SeedSpec6 pnSeed6_test[] = { 14 | }; 15 | #endif // BITCOIN_CHAINPARAMSSEEDS_H 16 | -------------------------------------------------------------------------------- /src/checkpoints.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CHECKPOINTS_H 6 | #define BITCOIN_CHECKPOINTS_H 7 | 8 | #include "uint256.h" 9 | 10 | #include 11 | 12 | class CBlockIndex; 13 | 14 | /** 15 | * Block-chain checkpoints are compiled-in sanity checks. 16 | * They are updated every release or three. 17 | */ 18 | namespace Checkpoints 19 | { 20 | typedef std::map MapCheckpoints; 21 | 22 | struct CCheckpointData { 23 | MapCheckpoints mapCheckpoints; 24 | int64_t nTimeLastCheckpoint; 25 | int64_t nTransactionsLastCheckpoint; 26 | double fTransactionsPerDay; 27 | }; 28 | 29 | //! Return conservative estimate of total number of blocks, 0 if unknown 30 | int GetTotalBlocksEstimate(const CCheckpointData& data); 31 | 32 | //! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint 33 | CBlockIndex* GetLastCheckpoint(const CCheckpointData& data); 34 | 35 | double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true); 36 | 37 | } //namespace Checkpoints 38 | 39 | #endif // BITCOIN_CHECKPOINTS_H 40 | -------------------------------------------------------------------------------- /src/compat/glibc_compat.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #if defined(HAVE_CONFIG_H) 6 | #include "config/bitcoin-config.h" 7 | #endif 8 | 9 | #include 10 | 11 | #if defined(HAVE_SYS_SELECT_H) 12 | #include 13 | #endif 14 | 15 | // Prior to GLIBC_2.14, memcpy was aliased to memmove. 16 | extern "C" void* memmove(void* a, const void* b, size_t c); 17 | extern "C" void* memcpy(void* a, const void* b, size_t c) 18 | { 19 | return memmove(a, b, c); 20 | } 21 | 22 | extern "C" void __chk_fail(void) __attribute__((__noreturn__)); 23 | extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a) 24 | { 25 | if (a >= FD_SETSIZE) 26 | __chk_fail(); 27 | return a / __NFDBITS; 28 | } 29 | extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn"))); 30 | -------------------------------------------------------------------------------- /src/compat/sanity.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_COMPAT_SANITY_H 6 | #define BITCOIN_COMPAT_SANITY_H 7 | 8 | bool glibc_sanity_test(); 9 | bool glibcxx_sanity_test(); 10 | 11 | #endif // BITCOIN_COMPAT_SANITY_H 12 | -------------------------------------------------------------------------------- /src/compat/strnlen.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #if defined(HAVE_CONFIG_H) 6 | #include "config/bitcoin-config.h" 7 | #endif 8 | 9 | #include 10 | 11 | #if HAVE_DECL_STRNLEN == 0 12 | size_t strnlen( const char *start, size_t max_len) 13 | { 14 | const char *end = (const char *)memchr(start, '\0', max_len); 15 | 16 | return end ? (size_t)(end - start) : max_len; 17 | } 18 | #endif // HAVE_DECL_STRNLEN 19 | -------------------------------------------------------------------------------- /src/config/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/src/config/.empty -------------------------------------------------------------------------------- /src/core_io.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CORE_IO_H 6 | #define BITCOIN_CORE_IO_H 7 | 8 | #include 9 | #include 10 | 11 | class CBlock; 12 | class CScript; 13 | class CTransaction; 14 | class uint256; 15 | class UniValue; 16 | 17 | // core_read.cpp 18 | extern CScript ParseScript(const std::string& s); 19 | extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx); 20 | extern bool DecodeHexBlk(CBlock&, const std::string& strHexBlk); 21 | extern uint256 ParseHashUV(const UniValue& v, const std::string& strName); 22 | extern uint256 ParseHashStr(const std::string&, const std::string& strName); 23 | extern std::vector ParseHexUV(const UniValue& v, const std::string& strName); 24 | 25 | // core_write.cpp 26 | extern std::string FormatScript(const CScript& script); 27 | extern std::string EncodeHexTx(const CTransaction& tx); 28 | extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, 29 | UniValue& out, bool fIncludeHex); 30 | extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry); 31 | 32 | #endif // BITCOIN_CORE_IO_H 33 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha256.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "crypto/hmac_sha256.h" 6 | 7 | #include 8 | 9 | CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen) 10 | { 11 | unsigned char rkey[64]; 12 | if (keylen <= 64) { 13 | memcpy(rkey, key, keylen); 14 | memset(rkey + keylen, 0, 64 - keylen); 15 | } else { 16 | CSHA256().Write(key, keylen).Finalize(rkey); 17 | memset(rkey + 32, 0, 32); 18 | } 19 | 20 | for (int n = 0; n < 64; n++) 21 | rkey[n] ^= 0x5c; 22 | outer.Write(rkey, 64); 23 | 24 | for (int n = 0; n < 64; n++) 25 | rkey[n] ^= 0x5c ^ 0x36; 26 | inner.Write(rkey, 64); 27 | } 28 | 29 | void CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) 30 | { 31 | unsigned char temp[32]; 32 | inner.Finalize(temp); 33 | outer.Write(temp, 32).Finalize(hash); 34 | } 35 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha256.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_HMAC_SHA256_H 6 | #define BITCOIN_CRYPTO_HMAC_SHA256_H 7 | 8 | #include "crypto/sha256.h" 9 | 10 | #include 11 | #include 12 | 13 | /** A hasher class for HMAC-SHA-512. */ 14 | class CHMAC_SHA256 15 | { 16 | private: 17 | CSHA256 outer; 18 | CSHA256 inner; 19 | 20 | public: 21 | static const size_t OUTPUT_SIZE = 32; 22 | 23 | CHMAC_SHA256(const unsigned char* key, size_t keylen); 24 | CHMAC_SHA256& Write(const unsigned char* data, size_t len) 25 | { 26 | inner.Write(data, len); 27 | return *this; 28 | } 29 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_HMAC_SHA256_H 33 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha512.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "crypto/hmac_sha512.h" 6 | 7 | #include 8 | 9 | CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) 10 | { 11 | unsigned char rkey[128]; 12 | if (keylen <= 128) { 13 | memcpy(rkey, key, keylen); 14 | memset(rkey + keylen, 0, 128 - keylen); 15 | } else { 16 | CSHA512().Write(key, keylen).Finalize(rkey); 17 | memset(rkey + 64, 0, 64); 18 | } 19 | 20 | for (int n = 0; n < 128; n++) 21 | rkey[n] ^= 0x5c; 22 | outer.Write(rkey, 128); 23 | 24 | for (int n = 0; n < 128; n++) 25 | rkey[n] ^= 0x5c ^ 0x36; 26 | inner.Write(rkey, 128); 27 | } 28 | 29 | void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) 30 | { 31 | unsigned char temp[64]; 32 | inner.Finalize(temp); 33 | outer.Write(temp, 64).Finalize(hash); 34 | } 35 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_HMAC_SHA512_H 6 | #define BITCOIN_CRYPTO_HMAC_SHA512_H 7 | 8 | #include "crypto/sha512.h" 9 | 10 | #include 11 | #include 12 | 13 | /** A hasher class for HMAC-SHA-512. */ 14 | class CHMAC_SHA512 15 | { 16 | private: 17 | CSHA512 outer; 18 | CSHA512 inner; 19 | 20 | public: 21 | static const size_t OUTPUT_SIZE = 64; 22 | 23 | CHMAC_SHA512(const unsigned char* key, size_t keylen); 24 | CHMAC_SHA512& Write(const unsigned char* data, size_t len) 25 | { 26 | inner.Write(data, len); 27 | return *this; 28 | } 29 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_HMAC_SHA512_H 33 | -------------------------------------------------------------------------------- /src/crypto/ripemd160.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_RIPEMD160_H 6 | #define BITCOIN_CRYPTO_RIPEMD160_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for RIPEMD-160. */ 12 | class CRIPEMD160 13 | { 14 | private: 15 | uint32_t s[5]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 20; 21 | 22 | CRIPEMD160(); 23 | CRIPEMD160& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CRIPEMD160& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_RIPEMD160_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha1.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_SHA1_H 6 | #define BITCOIN_CRYPTO_SHA1_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA1. */ 12 | class CSHA1 13 | { 14 | private: 15 | uint32_t s[5]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 20; 21 | 22 | CSHA1(); 23 | CSHA1& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA1& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA1_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha256.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_SHA256_H 6 | #define BITCOIN_CRYPTO_SHA256_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA-256. */ 12 | class CSHA256 13 | { 14 | public: 15 | static const size_t OUTPUT_SIZE = 32; 16 | 17 | CSHA256(); 18 | CSHA256& Write(const unsigned char* data, size_t len); 19 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 20 | void FinalizeNoPadding(unsigned char hash[OUTPUT_SIZE]) { 21 | FinalizeNoPadding(hash, true); 22 | }; 23 | CSHA256& Reset(); 24 | 25 | private: 26 | uint32_t s[8]; 27 | unsigned char buf[64]; 28 | size_t bytes; 29 | void FinalizeNoPadding(unsigned char hash[OUTPUT_SIZE], bool enforce_compression); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_SHA256_H 33 | -------------------------------------------------------------------------------- /src/crypto/sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_SHA512_H 6 | #define BITCOIN_CRYPTO_SHA512_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA-512. */ 12 | class CSHA512 13 | { 14 | private: 15 | uint64_t s[8]; 16 | unsigned char buf[128]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 64; 21 | 22 | CSHA512(); 23 | CSHA512& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA512& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA512_H 29 | -------------------------------------------------------------------------------- /src/deprecation.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef ZCASH_DEPRECATION_H 6 | #define ZCASH_DEPRECATION_H 7 | 8 | // Deprecation block is now 800,000. 9 | static const int APPROX_RELEASE_HEIGHT = 800000; 10 | static const int WEEKS_UNTIL_DEPRECATION = 18; 11 | static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 24 * 24); 12 | 13 | // Number of blocks before deprecation to warn users 14 | static const int DEPRECATION_WARN_LIMIT = 14 * 24 * 24; // 2 weeks 15 | 16 | /** 17 | * Checks whether the node is deprecated based on the current block height, and 18 | * shuts down the node with an error if so (and deprecation is not disabled for 19 | * the current client version). 20 | */ 21 | void EnforceNodeDeprecation(int nHeight, bool forceLogging=false); 22 | 23 | #endif // ZCASH_DEPRECATION_H 24 | -------------------------------------------------------------------------------- /src/gtest/json_test_vectors.cpp: -------------------------------------------------------------------------------- 1 | #include "json_test_vectors.h" 2 | 3 | UniValue 4 | read_json(const std::string& jsondata) 5 | { 6 | UniValue v; 7 | 8 | if (!(v.read(jsondata) && v.isArray())) 9 | { 10 | ADD_FAILURE(); 11 | return UniValue(UniValue::VARR); 12 | } 13 | return v.get_array(); 14 | } 15 | -------------------------------------------------------------------------------- /src/gtest/json_test_vectors.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "utilstrencodings.h" 4 | #include "version.h" 5 | #include "serialize.h" 6 | #include "streams.h" 7 | 8 | #include 9 | 10 | UniValue 11 | read_json(const std::string& jsondata); 12 | 13 | // #define PRINT_JSON 1 14 | 15 | template 16 | void expect_deser_same(const T& expected) 17 | { 18 | CDataStream ss1(SER_NETWORK, PROTOCOL_VERSION); 19 | ss1 << expected; 20 | 21 | auto serialized_size = ss1.size(); 22 | 23 | T object; 24 | ss1 >> object; 25 | 26 | CDataStream ss2(SER_NETWORK, PROTOCOL_VERSION); 27 | ss2 << object; 28 | 29 | ASSERT_TRUE(serialized_size == ss2.size()); 30 | ASSERT_TRUE(memcmp(&*ss1.begin(), &*ss2.begin(), serialized_size) == 0); 31 | } 32 | 33 | template 34 | void expect_test_vector(T& v, const U& expected) 35 | { 36 | expect_deser_same(expected); 37 | 38 | CDataStream ss1(SER_NETWORK, PROTOCOL_VERSION); 39 | ss1 << expected; 40 | 41 | #ifdef PRINT_JSON 42 | std::cout << "\t\"" ; 43 | std::cout << HexStr(ss1.begin(), ss1.end()) << "\",\n"; 44 | #else 45 | std::string raw = v.get_str(); 46 | CDataStream ss2(ParseHex(raw), SER_NETWORK, PROTOCOL_VERSION); 47 | 48 | ASSERT_TRUE(ss1.size() == ss2.size()); 49 | ASSERT_TRUE(memcmp(&*ss1.begin(), &*ss2.begin(), ss1.size()) == 0); 50 | #endif 51 | } 52 | -------------------------------------------------------------------------------- /src/gtest/main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "crypto/common.h" 3 | #include "pubkey.h" 4 | 5 | #include "libsnark/common/default_types/r1cs_ppzksnark_pp.hpp" 6 | #include "libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp" 7 | 8 | struct ECCryptoClosure 9 | { 10 | ECCVerifyHandle handle; 11 | }; 12 | 13 | ECCryptoClosure instance_of_eccryptoclosure; 14 | 15 | int main(int argc, char **argv) { 16 | assert(init_and_check_sodium() != -1); 17 | libsnark::default_r1cs_ppzksnark_pp::init_public_params(); 18 | libsnark::inhibit_profiling_info = true; 19 | libsnark::inhibit_profiling_counters = true; 20 | 21 | testing::InitGoogleTest(&argc, argv); 22 | return RUN_ALL_TESTS(); 23 | } 24 | -------------------------------------------------------------------------------- /src/gtest/test_block.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "primitives/block.h" 4 | 5 | 6 | TEST(block_tests, header_size_is_expected) { 7 | // Dummy header with an empty Equihash solution. 8 | CBlockHeader header; 9 | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); 10 | ss << header; 11 | 12 | ASSERT_EQ(ss.size(), CBlockHeader::HEADER_SIZE); 13 | } 14 | -------------------------------------------------------------------------------- /src/gtest/test_libzcash_utils.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "zcash/util.h" 3 | 4 | TEST(libzcash_utils, convertBytesVectorToVector) 5 | { 6 | std::vector bytes = {0x00, 0x01, 0x03, 0x12, 0xFF}; 7 | std::vector expected_bits = { 8 | // 0x00 9 | 0, 0, 0, 0, 0, 0, 0, 0, 10 | // 0x01 11 | 0, 0, 0, 0, 0, 0, 0, 1, 12 | // 0x03 13 | 0, 0, 0, 0, 0, 0, 1, 1, 14 | // 0x12 15 | 0, 0, 0, 1, 0, 0, 1, 0, 16 | // 0xFF 17 | 1, 1, 1, 1, 1, 1, 1, 1 18 | }; 19 | ASSERT_TRUE(convertBytesVectorToVector(bytes) == expected_bits); 20 | } 21 | 22 | TEST(libzcash_utils, convertVectorToInt) 23 | { 24 | ASSERT_TRUE(convertVectorToInt({0}) == 0); 25 | ASSERT_TRUE(convertVectorToInt({1}) == 1); 26 | ASSERT_TRUE(convertVectorToInt({0,1}) == 1); 27 | ASSERT_TRUE(convertVectorToInt({1,0}) == 2); 28 | ASSERT_TRUE(convertVectorToInt({1,1}) == 3); 29 | ASSERT_TRUE(convertVectorToInt({1,0,0}) == 4); 30 | ASSERT_TRUE(convertVectorToInt({1,0,1}) == 5); 31 | ASSERT_TRUE(convertVectorToInt({1,1,0}) == 6); 32 | 33 | ASSERT_THROW(convertVectorToInt(std::vector(100)), std::length_error); 34 | 35 | { 36 | std::vector v(63, 1); 37 | ASSERT_TRUE(convertVectorToInt(v) == 0x7fffffffffffffff); 38 | } 39 | 40 | { 41 | std::vector v(64, 1); 42 | ASSERT_TRUE(convertVectorToInt(v) == 0xffffffffffffffff); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/gtest/test_random.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "random.h" 4 | 5 | extern int GenZero(int n); 6 | extern int GenMax(int n); 7 | 8 | TEST(Random, MappedShuffle) { 9 | std::vector a {8, 4, 6, 3, 5}; 10 | std::vector m {0, 1, 2, 3, 4}; 11 | 12 | auto a1 = a; 13 | auto m1 = m; 14 | MappedShuffle(a1.begin(), m1.begin(), a1.size(), GenZero); 15 | std::vector ea1 {4, 6, 3, 5, 8}; 16 | std::vector em1 {1, 2, 3, 4, 0}; 17 | EXPECT_EQ(ea1, a1); 18 | EXPECT_EQ(em1, m1); 19 | 20 | auto a2 = a; 21 | auto m2 = m; 22 | MappedShuffle(a2.begin(), m2.begin(), a2.size(), GenMax); 23 | std::vector ea2 {8, 4, 6, 3, 5}; 24 | std::vector em2 {0, 1, 2, 3, 4}; 25 | EXPECT_EQ(ea2, a2); 26 | EXPECT_EQ(em2, m2); 27 | 28 | auto a3 = a; 29 | auto m3 = m; 30 | MappedShuffle(a3.begin(), m3.begin(), a3.size(), GenIdentity); 31 | std::vector ea3 {8, 4, 6, 3, 5}; 32 | std::vector em3 {0, 1, 2, 3, 4}; 33 | EXPECT_EQ(ea3, a3); 34 | EXPECT_EQ(em3, m3); 35 | } 36 | -------------------------------------------------------------------------------- /src/gtest/test_tautology.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST(tautologies, seven_eq_seven) { 4 | ASSERT_EQ(7, 7); 5 | } 6 | 7 | TEST(tautologies, DISABLED_ObviousFailure) 8 | { 9 | FAIL() << "This is expected"; 10 | } 11 | -------------------------------------------------------------------------------- /src/gtest/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "zcash/JoinSplit.hpp" 2 | 3 | ZCJoinSplit* params = ZCJoinSplit::Unopened(); 4 | 5 | int GenZero(int n) 6 | { 7 | return 0; 8 | } 9 | 10 | int GenMax(int n) 11 | { 12 | return n-1; 13 | } 14 | -------------------------------------------------------------------------------- /src/httprpc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_HTTPRPC_H 6 | #define BITCOIN_HTTPRPC_H 7 | 8 | #include 9 | #include 10 | 11 | class HTTPRequest; 12 | 13 | /** Start HTTP RPC subsystem. 14 | * Precondition; HTTP and RPC has been started. 15 | */ 16 | bool StartHTTPRPC(); 17 | /** Interrupt HTTP RPC subsystem. 18 | */ 19 | void InterruptHTTPRPC(); 20 | /** Stop HTTP RPC subsystem. 21 | * Precondition; HTTP and RPC has been stopped. 22 | */ 23 | void StopHTTPRPC(); 24 | 25 | /** Start HTTP REST subsystem. 26 | * Precondition; HTTP and RPC has been started. 27 | */ 28 | bool StartREST(); 29 | /** Interrupt RPC REST subsystem. 30 | */ 31 | void InterruptREST(); 32 | /** Stop HTTP REST subsystem. 33 | * Precondition; HTTP and RPC has been stopped. 34 | */ 35 | void StopREST(); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_INIT_H 7 | #define BITCOIN_INIT_H 8 | 9 | #include 10 | 11 | #include "zcash/JoinSplit.hpp" 12 | 13 | class CScheduler; 14 | class CWallet; 15 | 16 | namespace boost 17 | { 18 | class thread_group; 19 | } // namespace boost 20 | 21 | extern CWallet* pwalletMain; 22 | extern ZCJoinSplit* pzcashParams; 23 | 24 | void StartShutdown(); 25 | bool ShutdownRequested(); 26 | /** Interrupt threads */ 27 | void Interrupt(boost::thread_group& threadGroup); 28 | void Shutdown(); 29 | bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler); 30 | 31 | /** The help message mode determines what help message to show */ 32 | enum HelpMessageMode { 33 | HMM_BITCOIND 34 | }; 35 | 36 | /** Help for options shared between UI and daemon (for -help) */ 37 | std::string HelpMessage(HelpMessageMode mode); 38 | 39 | #endif // BITCOIN_INIT_H 40 | -------------------------------------------------------------------------------- /src/leveldb/.gitignore: -------------------------------------------------------------------------------- 1 | build_config.mk 2 | *.a 3 | *.o 4 | *.dylib* 5 | *.so 6 | *.so.* 7 | *_test 8 | db_bench 9 | leveldbutil 10 | Release 11 | Debug 12 | Benchmark 13 | vs2010.* 14 | -------------------------------------------------------------------------------- /src/leveldb/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | 6 | # Initial version authors: 7 | Jeffrey Dean 8 | Sanjay Ghemawat 9 | 10 | # Partial list of contributors: 11 | Kevin Regan 12 | Johan Bilien 13 | -------------------------------------------------------------------------------- /src/leveldb/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /src/leveldb/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /src/leveldb/WINDOWS.md: -------------------------------------------------------------------------------- 1 | # Building LevelDB On Windows 2 | 3 | ## Prereqs 4 | 5 | Install the [Windows Software Development Kit version 7.1](http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b). 6 | 7 | Download and extract the [Snappy source distribution](http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz) 8 | 9 | 1. Open the "Windows SDK 7.1 Command Prompt" : 10 | Start Menu -> "Microsoft Windows SDK v7.1" > "Windows SDK 7.1 Command Prompt" 11 | 2. Change the directory to the leveldb project 12 | 13 | ## Building the Static lib 14 | 15 | * 32 bit Version 16 | 17 | setenv /x86 18 | msbuild.exe /p:Configuration=Release /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 19 | 20 | * 64 bit Version 21 | 22 | setenv /x64 23 | msbuild.exe /p:Configuration=Release /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 24 | 25 | 26 | ## Building and Running the Benchmark app 27 | 28 | * 32 bit Version 29 | 30 | setenv /x86 31 | msbuild.exe /p:Configuration=Benchmark /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 32 | Benchmark\leveldb.exe 33 | 34 | * 64 bit Version 35 | 36 | setenv /x64 37 | msbuild.exe /p:Configuration=Benchmark /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 38 | x64\Benchmark\leveldb.exe 39 | 40 | -------------------------------------------------------------------------------- /src/leveldb/db/builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_BUILDER_H_ 6 | #define STORAGE_LEVELDB_DB_BUILDER_H_ 7 | 8 | #include "leveldb/status.h" 9 | 10 | namespace leveldb { 11 | 12 | struct Options; 13 | struct FileMetaData; 14 | 15 | class Env; 16 | class Iterator; 17 | class TableCache; 18 | class VersionEdit; 19 | 20 | // Build a Table file from the contents of *iter. The generated file 21 | // will be named according to meta->number. On success, the rest of 22 | // *meta will be filled with metadata about the generated table. 23 | // If no data is present in *iter, meta->file_size will be set to 24 | // zero, and no Table file will be produced. 25 | extern Status BuildTable(const std::string& dbname, 26 | Env* env, 27 | const Options& options, 28 | TableCache* table_cache, 29 | Iterator* iter, 30 | FileMetaData* meta); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 35 | -------------------------------------------------------------------------------- /src/leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | class DBImpl; 15 | 16 | // Return a new iterator that converts internal keys (yielded by 17 | // "*internal_iter") that were live at the specified "sequence" number 18 | // into appropriate user keys. 19 | extern Iterator* NewDBIterator( 20 | DBImpl* db, 21 | const Comparator* user_key_comparator, 22 | Iterator* internal_iter, 23 | SequenceNumber sequence, 24 | uint32_t seed); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 29 | -------------------------------------------------------------------------------- /src/leveldb/db/log_format.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Log format information shared by reader and writer. 6 | // See ../doc/log_format.txt for more detail. 7 | 8 | #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 9 | #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 10 | 11 | namespace leveldb { 12 | namespace log { 13 | 14 | enum RecordType { 15 | // Zero is reserved for preallocated files 16 | kZeroType = 0, 17 | 18 | kFullType = 1, 19 | 20 | // For fragments 21 | kFirstType = 2, 22 | kMiddleType = 3, 23 | kLastType = 4 24 | }; 25 | static const int kMaxRecordType = kLastType; 26 | 27 | static const int kBlockSize = 32768; 28 | 29 | // Header is checksum (4 bytes), length (2 bytes), type (1 byte). 30 | static const int kHeaderSize = 4 + 2 + 1; 31 | 32 | } // namespace log 33 | } // namespace leveldb 34 | 35 | #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 36 | -------------------------------------------------------------------------------- /src/leveldb/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Env; 11 | 12 | // Returns a new environment that stores its data in memory and delegates 13 | // all non-file-storage tasks to base_env. The caller must delete the result 14 | // when it is no longer needed. 15 | // *base_env must remain live while the result is in use. 16 | Env* NewMemEnv(Env* base_env); 17 | 18 | } // namespace leveldb 19 | 20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 21 | -------------------------------------------------------------------------------- /src/leveldb/include/leveldb/dumpfile.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 6 | #define STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 7 | 8 | #include 9 | #include "leveldb/env.h" 10 | #include "leveldb/status.h" 11 | 12 | namespace leveldb { 13 | 14 | // Dump the contents of the file named by fname in text format to 15 | // *dst. Makes a sequence of dst->Append() calls; each call is passed 16 | // the newline-terminated text corresponding to a single item found 17 | // in the file. 18 | // 19 | // Returns a non-OK result if fname does not name a leveldb storage 20 | // file, or if the file cannot be read. 21 | Status DumpFile(Env* env, const std::string& fname, WritableFile* dst); 22 | 23 | } // namespace leveldb 24 | 25 | #endif // STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 26 | -------------------------------------------------------------------------------- /src/leveldb/port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /src/leveldb/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) 14 | # include "port/port_posix.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | # include "port/port_chromium.h" 17 | #elif defined(LEVELDB_PLATFORM_WINDOWS) 18 | # include "port/port_win.h" 19 | #endif 20 | 21 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 22 | -------------------------------------------------------------------------------- /src/leveldb/port/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /src/leveldb/table/block.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_H_ 7 | 8 | #include 9 | #include 10 | #include "leveldb/iterator.h" 11 | 12 | namespace leveldb { 13 | 14 | struct BlockContents; 15 | class Comparator; 16 | 17 | class Block { 18 | public: 19 | // Initialize the block with the specified contents. 20 | explicit Block(const BlockContents& contents); 21 | 22 | ~Block(); 23 | 24 | size_t size() const { return size_; } 25 | Iterator* NewIterator(const Comparator* comparator); 26 | 27 | private: 28 | uint32_t NumRestarts() const; 29 | 30 | const char* data_; 31 | size_t size_; 32 | uint32_t restart_offset_; // Offset in data_ of restart array 33 | bool owned_; // Block owns data_[] 34 | 35 | // No copying allowed 36 | Block(const Block&); 37 | void operator=(const Block&); 38 | 39 | class Iter; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_ 45 | -------------------------------------------------------------------------------- /src/leveldb/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | extern Iterator* NewMergingIterator( 22 | const Comparator* comparator, Iterator** children, int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /src/leveldb/table/two_level_iterator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 6 | #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 7 | 8 | #include "leveldb/iterator.h" 9 | 10 | namespace leveldb { 11 | 12 | struct ReadOptions; 13 | 14 | // Return a new two level iterator. A two-level iterator contains an 15 | // index iterator whose values point to a sequence of blocks where 16 | // each block is itself a sequence of key,value pairs. The returned 17 | // two-level iterator yields the concatenation of all key/value pairs 18 | // in the sequence of blocks. Takes ownership of "index_iter" and 19 | // will delete it when no longer needed. 20 | // 21 | // Uses a supplied function to convert an index_iter value into 22 | // an iterator over the contents of the corresponding block. 23 | extern Iterator* NewTwoLevelIterator( 24 | Iterator* index_iter, 25 | Iterator* (*block_function)( 26 | void* arg, 27 | const ReadOptions& options, 28 | const Slice& index_value), 29 | void* arg, 30 | const ReadOptions& options); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 35 | -------------------------------------------------------------------------------- /src/leveldb/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() { } 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /src/leveldb/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /src/leveldb/util/histogram.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 6 | #define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 7 | 8 | #include 9 | 10 | namespace leveldb { 11 | 12 | class Histogram { 13 | public: 14 | Histogram() { } 15 | ~Histogram() { } 16 | 17 | void Clear(); 18 | void Add(double value); 19 | void Merge(const Histogram& other); 20 | 21 | std::string ToString() const; 22 | 23 | private: 24 | double min_; 25 | double max_; 26 | double num_; 27 | double sum_; 28 | double sum_squares_; 29 | 30 | enum { kNumBuckets = 154 }; 31 | static const double kBucketLimit[kNumBuckets]; 32 | double buckets_[kNumBuckets]; 33 | 34 | double Median() const; 35 | double Percentile(double p) const; 36 | double Average() const; 37 | double StandardDeviation() const; 38 | }; 39 | 40 | } // namespace leveldb 41 | 42 | #endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 43 | -------------------------------------------------------------------------------- /src/leveldb/util/mutexlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 6 | #define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 7 | 8 | #include "port/port.h" 9 | #include "port/thread_annotations.h" 10 | 11 | namespace leveldb { 12 | 13 | // Helper class that locks a mutex on construction and unlocks the mutex when 14 | // the destructor of the MutexLock object is invoked. 15 | // 16 | // Typical usage: 17 | // 18 | // void MyClass::MyMethod() { 19 | // MutexLock l(&mu_); // mu_ is an instance variable 20 | // ... some complex code, possibly with multiple return paths ... 21 | // } 22 | 23 | class SCOPED_LOCKABLE MutexLock { 24 | public: 25 | explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) 26 | : mu_(mu) { 27 | this->mu_->Lock(); 28 | } 29 | ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); } 30 | 31 | private: 32 | port::Mutex *const mu_; 33 | // No copying allowed 34 | MutexLock(const MutexLock&); 35 | void operator=(const MutexLock&); 36 | }; 37 | 38 | } // namespace leveldb 39 | 40 | 41 | #endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 42 | -------------------------------------------------------------------------------- /src/leveldb/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() 13 | : comparator(BytewiseComparator()), 14 | create_if_missing(false), 15 | error_if_exists(false), 16 | paranoid_checks(false), 17 | env(Env::Default()), 18 | info_log(NULL), 19 | write_buffer_size(4<<20), 20 | max_open_files(1000), 21 | block_cache(NULL), 22 | block_size(4096), 23 | block_restart_interval(16), 24 | compression(kSnappyCompression), 25 | filter_policy(NULL) { 26 | } 27 | 28 | 29 | } // namespace leveldb 30 | -------------------------------------------------------------------------------- /src/noui.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_NOUI_H 6 | #define BITCOIN_NOUI_H 7 | 8 | extern void noui_connect(); 9 | 10 | #endif // BITCOIN_NOUI_H 11 | -------------------------------------------------------------------------------- /src/obj-test/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/obj/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/reverselock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_REVERSELOCK_H 6 | #define BITCOIN_REVERSELOCK_H 7 | 8 | /** 9 | * An RAII-style reverse lock. Unlocks on construction and locks on destruction. 10 | */ 11 | template 12 | class reverse_lock 13 | { 14 | public: 15 | 16 | explicit reverse_lock(Lock& lock) : lock(lock) { 17 | lock.unlock(); 18 | } 19 | 20 | ~reverse_lock() noexcept(false) { 21 | lock.lock(); 22 | } 23 | 24 | private: 25 | reverse_lock(reverse_lock const&); 26 | reverse_lock& operator=(reverse_lock const&); 27 | 28 | Lock& lock; 29 | }; 30 | 31 | #endif // BITCOIN_REVERSELOCK_H 32 | -------------------------------------------------------------------------------- /src/rpcclient.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_RPCCLIENT_H 7 | #define BITCOIN_RPCCLIENT_H 8 | 9 | #include 10 | 11 | UniValue RPCConvertValues(const std::string& strMethod, const std::vector& strParams); 12 | /** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) 13 | * as well as objects and arrays. 14 | */ 15 | UniValue ParseNonRFCJSONValue(const std::string& strVal); 16 | 17 | #endif // BITCOIN_RPCCLIENT_H 18 | -------------------------------------------------------------------------------- /src/script/sigcache.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_SCRIPT_SIGCACHE_H 7 | #define BITCOIN_SCRIPT_SIGCACHE_H 8 | 9 | #include "script/interpreter.h" 10 | 11 | #include 12 | 13 | class CPubKey; 14 | 15 | class CachingTransactionSignatureChecker : public TransactionSignatureChecker 16 | { 17 | private: 18 | bool store; 19 | 20 | public: 21 | CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, bool storeIn=true) : TransactionSignatureChecker(txToIn, nInIn), store(storeIn) {} 22 | 23 | bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; 24 | }; 25 | 26 | #endif // BITCOIN_SCRIPT_SIGCACHE_H 27 | -------------------------------------------------------------------------------- /src/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | bench_inv 2 | bench_ecdh 3 | bench_sign 4 | bench_verify 5 | bench_schnorr_verify 6 | bench_recover 7 | bench_internal 8 | tests 9 | exhaustive_tests 10 | gen_context 11 | *.exe 12 | *.so 13 | *.a 14 | !.gitignore 15 | 16 | Makefile 17 | configure 18 | .libs/ 19 | Makefile.in 20 | aclocal.m4 21 | autom4te.cache/ 22 | config.log 23 | config.status 24 | *.tar.gz 25 | *.la 26 | libtool 27 | .deps/ 28 | .dirstamp 29 | *.lo 30 | *.o 31 | *~ 32 | src/libsecp256k1-config.h 33 | src/libsecp256k1-config.h.in 34 | src/ecmult_static_context.h 35 | build-aux/config.guess 36 | build-aux/config.sub 37 | build-aux/depcomp 38 | build-aux/install-sh 39 | build-aux/ltmain.sh 40 | build-aux/m4/libtool.m4 41 | build-aux/m4/lt~obsolete.m4 42 | build-aux/m4/ltoptions.m4 43 | build-aux/m4/ltsugar.m4 44 | build-aux/m4/ltversion.m4 45 | build-aux/missing 46 | build-aux/compile 47 | build-aux/test-driver 48 | src/stamp-h1 49 | libsecp256k1.pc 50 | -------------------------------------------------------------------------------- /src/secp256k1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/secp256k1/TODO: -------------------------------------------------------------------------------- 1 | * Unit tests for fieldelem/groupelem, including ones intended to 2 | trigger fieldelem's boundary cases. 3 | * Complete constant-time operations for signing/keygen 4 | -------------------------------------------------------------------------------- /src/secp256k1/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /src/secp256k1/include/secp256k1_ecdh.h: -------------------------------------------------------------------------------- 1 | #ifndef _SECP256K1_ECDH_ 2 | # define _SECP256K1_ECDH_ 3 | 4 | # include "secp256k1.h" 5 | 6 | # ifdef __cplusplus 7 | extern "C" { 8 | # endif 9 | 10 | /** Compute an EC Diffie-Hellman secret in constant time 11 | * Returns: 1: exponentiation was successful 12 | * 0: scalar was invalid (zero or overflow) 13 | * Args: ctx: pointer to a context object (cannot be NULL) 14 | * Out: result: a 32-byte array which will be populated by an ECDH 15 | * secret computed from the point and scalar 16 | * In: pubkey: a pointer to a secp256k1_pubkey containing an 17 | * initialized public key 18 | * privkey: a 32-byte scalar with which to multiply the point 19 | */ 20 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh( 21 | const secp256k1_context* ctx, 22 | unsigned char *result, 23 | const secp256k1_pubkey *pubkey, 24 | const unsigned char *privkey 25 | ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4); 26 | 27 | # ifdef __cplusplus 28 | } 29 | # endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/secp256k1/libsecp256k1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsecp256k1 7 | Description: Optimized C library for EC operations on curve secp256k1 8 | URL: https://github.com/bitcoin-core/secp256k1 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs.private: @SECP_LIBS@ 12 | Libs: -L${libdir} -lsecp256k1 13 | 14 | -------------------------------------------------------------------------------- /src/secp256k1/obj/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/src/secp256k1/obj/.gitignore -------------------------------------------------------------------------------- /src/secp256k1/src/basic-config.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_BASIC_CONFIG_ 8 | #define _SECP256K1_BASIC_CONFIG_ 9 | 10 | #ifdef USE_BASIC_CONFIG 11 | 12 | #undef USE_ASM_X86_64 13 | #undef USE_ENDOMORPHISM 14 | #undef USE_FIELD_10X26 15 | #undef USE_FIELD_5X52 16 | #undef USE_FIELD_INV_BUILTIN 17 | #undef USE_FIELD_INV_NUM 18 | #undef USE_NUM_GMP 19 | #undef USE_NUM_NONE 20 | #undef USE_SCALAR_4X64 21 | #undef USE_SCALAR_8X32 22 | #undef USE_SCALAR_INV_BUILTIN 23 | #undef USE_SCALAR_INV_NUM 24 | 25 | #define USE_NUM_NONE 1 26 | #define USE_FIELD_INV_BUILTIN 1 27 | #define USE_SCALAR_INV_BUILTIN 1 28 | #define USE_FIELD_10X26 1 29 | #define USE_SCALAR_8X32 1 30 | 31 | #endif // USE_BASIC_CONFIG 32 | #endif // _SECP256K1_BASIC_CONFIG_ 33 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecdsa.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECDSA_ 8 | #define _SECP256K1_ECDSA_ 9 | 10 | #include 11 | 12 | #include "scalar.h" 13 | #include "group.h" 14 | #include "ecmult.h" 15 | 16 | static int secp256k1_ecdsa_sig_parse(secp256k1_scalar *r, secp256k1_scalar *s, const unsigned char *sig, size_t size); 17 | static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar *r, const secp256k1_scalar *s); 18 | static int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar* r, const secp256k1_scalar* s, const secp256k1_ge *pubkey, const secp256k1_scalar *message); 19 | static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/secp256k1/src/eckey.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECKEY_ 8 | #define _SECP256K1_ECKEY_ 9 | 10 | #include 11 | 12 | #include "group.h" 13 | #include "scalar.h" 14 | #include "ecmult.h" 15 | #include "ecmult_gen.h" 16 | 17 | static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size); 18 | static int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *pub, size_t *size, int compressed); 19 | 20 | static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak); 21 | static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak); 22 | static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak); 23 | static int secp256k1_eckey_pubkey_tweak_mul(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecmult_const.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECMULT_CONST_ 8 | #define _SECP256K1_ECMULT_CONST_ 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "org_bitcoin_Secp256k1Context.h" 4 | #include "include/secp256k1.h" 5 | 6 | SECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context 7 | (JNIEnv* env, jclass classObject) 8 | { 9 | secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); 10 | 11 | (void)classObject;(void)env; 12 | 13 | return (uintptr_t)ctx; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | #include "include/secp256k1.h" 4 | /* Header for class org_bitcoin_Secp256k1Context */ 5 | 6 | #ifndef _Included_org_bitcoin_Secp256k1Context 7 | #define _Included_org_bitcoin_Secp256k1Context 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | /* 12 | * Class: org_bitcoin_Secp256k1Context 13 | * Method: secp256k1_init_context 14 | * Signature: ()J 15 | */ 16 | SECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context 17 | (JNIEnv *, jclass); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif 23 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/ecdh/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_ecdh.h 2 | noinst_HEADERS += src/modules/ecdh/main_impl.h 3 | noinst_HEADERS += src/modules/ecdh/tests_impl.h 4 | if USE_BENCHMARK 5 | noinst_PROGRAMS += bench_ecdh 6 | bench_ecdh_SOURCES = src/bench_ecdh.c 7 | bench_ecdh_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB) 8 | endif 9 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/recovery/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_recovery.h 2 | noinst_HEADERS += src/modules/recovery/main_impl.h 3 | noinst_HEADERS += src/modules/recovery/tests_impl.h 4 | if USE_BENCHMARK 5 | noinst_PROGRAMS += bench_recover 6 | bench_recover_SOURCES = src/bench_recover.c 7 | bench_recover_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB) 8 | endif 9 | -------------------------------------------------------------------------------- /src/secp256k1/src/num_gmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_REPR_ 8 | #define _SECP256K1_NUM_REPR_ 9 | 10 | #include 11 | 12 | #define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) 13 | 14 | typedef struct { 15 | mp_limb_t data[2*NUM_LIMBS]; 16 | int neg; 17 | int limbs; 18 | } secp256k1_num; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/secp256k1/src/num_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_IMPL_H_ 8 | #define _SECP256K1_NUM_IMPL_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | #include "num.h" 15 | 16 | #if defined(USE_NUM_GMP) 17 | #include "num_gmp_impl.h" 18 | #elif defined(USE_NUM_NONE) 19 | /* Nothing. */ 20 | #else 21 | #error "Please select num implementation" 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_low.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef uint32_t secp256k1_scalar; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/support/cleanse.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "cleanse.h" 7 | 8 | #include 9 | 10 | void memory_cleanse(void *ptr, size_t len) 11 | { 12 | OPENSSL_cleanse(ptr, len); 13 | } 14 | -------------------------------------------------------------------------------- /src/support/cleanse.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_SUPPORT_CLEANSE_H 7 | #define BITCOIN_SUPPORT_CLEANSE_H 8 | 9 | #include 10 | 11 | void memory_cleanse(void *ptr, size_t len); 12 | 13 | #endif // BITCOIN_SUPPORT_CLEANSE_H 14 | -------------------------------------------------------------------------------- /src/test/Checkpoints_tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | // 6 | // Unit tests for block-chain checkpoints 7 | // 8 | 9 | #include "checkpoints.h" 10 | 11 | #include "uint256.h" 12 | #include "test/test_bitcoin.h" 13 | #include "chainparams.h" 14 | 15 | #include 16 | 17 | using namespace std; 18 | 19 | BOOST_FIXTURE_TEST_SUITE(Checkpoints_tests, BasicTestingSetup) 20 | 21 | // TODO: checkpoints have been removed for now. 22 | /* 23 | BOOST_AUTO_TEST_CASE(sanity) 24 | { 25 | const Checkpoints::CCheckpointData& checkpoints = Params(CBaseChainParams::MAIN).Checkpoints(); 26 | BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate(checkpoints) >= 134444); 27 | } 28 | */ 29 | BOOST_AUTO_TEST_SUITE_END() 30 | -------------------------------------------------------------------------------- /src/test/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | $(MAKE) -C .. bitcoin_test 3 | clean: 4 | $(MAKE) -C .. bitcoin_test_clean 5 | check: 6 | $(MAKE) -C .. bitcoin_test_check 7 | -------------------------------------------------------------------------------- /src/test/README.md: -------------------------------------------------------------------------------- 1 | # Notes 2 | The sources in this directory are unit test cases. Boost includes a 3 | unit testing framework, and since bitcoin already uses boost, it makes 4 | sense to simply use this framework rather than require developers to 5 | configure some other framework (we want as few impediments to creating 6 | unit tests as possible). 7 | 8 | The build system is setup to compile an executable called "test_bitcoin" 9 | that runs all of the unit tests. The main source file is called 10 | test_bitcoin.cpp, which simply includes other files that contain the 11 | actual unit tests (outside of a couple required preprocessor 12 | directives). The pattern is to create one test file for each class or 13 | source file for which you want to create unit tests. The file naming 14 | convention is "_tests.cpp" and such files should wrap 15 | their tests in a test suite called "_tests". For an 16 | examples of this pattern, examine uint160_tests.cpp and 17 | uint256_tests.cpp. 18 | 19 | Add the source files to /src/Makefile.test.include to add them to the build. 20 | 21 | For further reading, I found the following website to be helpful in 22 | explaining how the boost unit test framework works: 23 | [http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/). -------------------------------------------------------------------------------- /src/test/base32_tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "utilstrencodings.h" 6 | #include "test/test_bitcoin.h" 7 | 8 | #include 9 | 10 | BOOST_FIXTURE_TEST_SUITE(base32_tests, BasicTestingSetup) 11 | 12 | BOOST_AUTO_TEST_CASE(base32_testvectors) 13 | { 14 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 15 | static const std::string vstrOut[] = {"","my======","mzxq====","mzxw6===","mzxw6yq=","mzxw6ytb","mzxw6ytboi======"}; 16 | for (unsigned int i=0; i 9 | 10 | BOOST_FIXTURE_TEST_SUITE(base64_tests, BasicTestingSetup) 11 | 12 | BOOST_AUTO_TEST_CASE(base64_testvectors) 13 | { 14 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 15 | static const std::string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"}; 16 | for (unsigned int i=0; i 10 | 11 | BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup) 12 | 13 | BOOST_AUTO_TEST_CASE(basic_sanity) 14 | { 15 | BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test"); 16 | BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test"); 17 | BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test"); 18 | } 19 | 20 | BOOST_AUTO_TEST_SUITE_END() 21 | -------------------------------------------------------------------------------- /src/test/test_bitcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_TEST_TEST_BITCOIN_H 2 | #define BITCOIN_TEST_TEST_BITCOIN_H 3 | 4 | #include "pubkey.h" 5 | #include "txdb.h" 6 | 7 | #include 8 | #include 9 | 10 | /** Basic testing setup. 11 | * This just configures logging and chain parameters. 12 | */ 13 | struct BasicTestingSetup { 14 | ECCVerifyHandle globalVerifyHandle; 15 | 16 | BasicTestingSetup(); 17 | ~BasicTestingSetup(); 18 | }; 19 | 20 | /** Testing setup that configures a complete environment. 21 | * Included are data directory, coins database, script check threads 22 | * and wallet (if enabled) setup. 23 | */ 24 | struct TestingSetup: public BasicTestingSetup { 25 | CCoinsViewDB *pcoinsdbview; 26 | boost::filesystem::path pathTemp; 27 | boost::thread_group threadGroup; 28 | 29 | TestingSetup(); 30 | ~TestingSetup(); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/test/timedata_tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | // 5 | #include "timedata.h" 6 | #include "test/test_bitcoin.h" 7 | 8 | #include 9 | 10 | using namespace std; 11 | 12 | BOOST_FIXTURE_TEST_SUITE(timedata_tests, BasicTestingSetup) 13 | 14 | BOOST_AUTO_TEST_CASE(util_MedianFilter) 15 | { 16 | CMedianFilter filter(5, 15); 17 | 18 | BOOST_CHECK_EQUAL(filter.median(), 15); 19 | 20 | filter.input(20); // [15 20] 21 | BOOST_CHECK_EQUAL(filter.median(), 17); 22 | 23 | filter.input(30); // [15 20 30] 24 | BOOST_CHECK_EQUAL(filter.median(), 20); 25 | 26 | filter.input(3); // [3 15 20 30] 27 | BOOST_CHECK_EQUAL(filter.median(), 17); 28 | 29 | filter.input(7); // [3 7 15 20 30] 30 | BOOST_CHECK_EQUAL(filter.median(), 15); 31 | 32 | filter.input(18); // [3 7 18 20 30] 33 | BOOST_CHECK_EQUAL(filter.median(), 18); 34 | 35 | filter.input(0); // [0 3 7 18 30] 36 | BOOST_CHECK_EQUAL(filter.median(), 7); 37 | } 38 | 39 | BOOST_AUTO_TEST_SUITE_END() 40 | -------------------------------------------------------------------------------- /src/torcontrol.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | /** 6 | * Functionality for communicating with Tor. 7 | */ 8 | #ifndef BITCOIN_TORCONTROL_H 9 | #define BITCOIN_TORCONTROL_H 10 | 11 | #include "scheduler.h" 12 | 13 | extern const std::string DEFAULT_TOR_CONTROL; 14 | static const bool DEFAULT_LISTEN_ONION = true; 15 | 16 | void StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler); 17 | void InterruptTorControl(); 18 | void StopTorControl(); 19 | 20 | #endif /* BITCOIN_TORCONTROL_H */ 21 | -------------------------------------------------------------------------------- /src/uint252.h: -------------------------------------------------------------------------------- 1 | #ifndef UINT252_H 2 | #define UINT252_H 3 | 4 | #include 5 | #include "uint256.h" 6 | #include "serialize.h" 7 | 8 | // Wrapper of uint256 with guarantee that first 9 | // four bits are zero. 10 | class uint252 { 11 | private: 12 | uint256 contents; 13 | 14 | public: 15 | ADD_SERIALIZE_METHODS; 16 | 17 | template 18 | inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { 19 | READWRITE(contents); 20 | 21 | if ((*contents.begin()) & 0xF0) { 22 | throw std::ios_base::failure("spending key has invalid leading bits"); 23 | } 24 | } 25 | 26 | const unsigned char* begin() const 27 | { 28 | return contents.begin(); 29 | } 30 | 31 | const unsigned char* end() const 32 | { 33 | return contents.end(); 34 | } 35 | 36 | uint252() : contents() {}; 37 | explicit uint252(const uint256& in) : contents(in) { 38 | if (*contents.begin() & 0xF0) { 39 | throw std::domain_error("leading bits are set in argument given to uint252 constructor"); 40 | } 41 | } 42 | 43 | uint256 inner() const { 44 | return contents; 45 | } 46 | 47 | friend inline bool operator==(const uint252& a, const uint252& b) { return a.contents == b.contents; } 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/univalue/.gitignore: -------------------------------------------------------------------------------- 1 | .deps/ 2 | INSTALL 3 | Makefile 4 | Makefile.in 5 | aclocal.m4 6 | autom4te.cache/ 7 | compile 8 | config.log 9 | config.status 10 | config.guess 11 | config.sub 12 | configure 13 | depcomp 14 | install-sh 15 | missing 16 | stamp-h1 17 | univalue-config.h* 18 | test-driver 19 | libtool 20 | ltmain.sh 21 | test-suite.log 22 | 23 | *.a 24 | *.la 25 | *.lo 26 | *.logs 27 | *.o 28 | *.pc 29 | *.trs 30 | 31 | .dirstamp 32 | .libs 33 | -------------------------------------------------------------------------------- /src/univalue/COPYING: -------------------------------------------------------------------------------- 1 | 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /src/univalue/README: -------------------------------------------------------------------------------- 1 | 2 | UniValue 3 | 4 | A universal value object, with JSON encoding (output) and decoding (input). 5 | 6 | Built as a single dynamic RAII C++ object class, and no templates. 7 | 8 | -------------------------------------------------------------------------------- /src/univalue/TODO: -------------------------------------------------------------------------------- 1 | 2 | Rearrange tree for easier 'git subtree' style use 3 | 4 | Move towards C++11 etc. 5 | 6 | Namespace support - must come up with useful shorthand, avoiding 7 | long Univalue::Univalue::Univalue usages forced upon library users. 8 | 9 | Improve test suite 10 | 11 | -------------------------------------------------------------------------------- /src/univalue/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | srcdir="$(dirname $0)" 4 | cd "$srcdir" 5 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then 6 | LIBTOOLIZE="${GLIBTOOLIZE}" 7 | export LIBTOOLIZE 8 | fi 9 | autoreconf --install --force 10 | -------------------------------------------------------------------------------- /src/univalue/build-aux/m4/.gitignore: -------------------------------------------------------------------------------- 1 | /*.m4 2 | -------------------------------------------------------------------------------- /src/univalue/lib/.gitignore: -------------------------------------------------------------------------------- 1 | gen 2 | .libs 3 | -------------------------------------------------------------------------------- /src/univalue/pc/libunivalue-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunivalue 7 | Description: libunivalue, C++ universal value object and JSON library 8 | Version: @VERSION@ 9 | Libs: ${pc_top_builddir}/${pcfiledir}/libunivalue.la 10 | -------------------------------------------------------------------------------- /src/univalue/pc/libunivalue.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunivalue 7 | Description: libunivalue, C++ universal value object and JSON library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lunivalue 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /src/univalue/test/.gitignore: -------------------------------------------------------------------------------- 1 | unitester 2 | test_json 3 | no_nul 4 | 5 | *.trs 6 | *.log 7 | -------------------------------------------------------------------------------- /src/univalue/test/fail1.json: -------------------------------------------------------------------------------- 1 | "This is a string that never ends, yes it goes on and on, my friends. 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail10.json: -------------------------------------------------------------------------------- 1 | {"Extra value after close": true} "misplaced quoted value" -------------------------------------------------------------------------------- /src/univalue/test/fail11.json: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /src/univalue/test/fail12.json: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /src/univalue/test/fail13.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /src/univalue/test/fail14.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /src/univalue/test/fail15.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /src/univalue/test/fail16.json: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /src/univalue/test/fail17.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /src/univalue/test/fail18.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/univalue/test/fail19.json: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /src/univalue/test/fail2.json: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /src/univalue/test/fail20.json: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /src/univalue/test/fail21.json: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /src/univalue/test/fail22.json: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /src/univalue/test/fail23.json: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /src/univalue/test/fail24.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /src/univalue/test/fail25.json: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /src/univalue/test/fail26.json: -------------------------------------------------------------------------------- 1 | ["tab\ character\ in\ string\ "] -------------------------------------------------------------------------------- /src/univalue/test/fail27.json: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /src/univalue/test/fail28.json: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /src/univalue/test/fail29.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /src/univalue/test/fail3.json: -------------------------------------------------------------------------------- 1 | {unquoted_key: "keys must be quoted"} -------------------------------------------------------------------------------- /src/univalue/test/fail30.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /src/univalue/test/fail31.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /src/univalue/test/fail32.json: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /src/univalue/test/fail33.json: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /src/univalue/test/fail34.json: -------------------------------------------------------------------------------- 1 | {} garbage -------------------------------------------------------------------------------- /src/univalue/test/fail35.json: -------------------------------------------------------------------------------- 1 | [ true true true [] [] [] ] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail36.json: -------------------------------------------------------------------------------- 1 | {"a":} 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail37.json: -------------------------------------------------------------------------------- 1 | {"a":1 "b":2} 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail38.json: -------------------------------------------------------------------------------- 1 | ["\ud834"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail39.json: -------------------------------------------------------------------------------- 1 | ["\udd61"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail4.json: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /src/univalue/test/fail40.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/src/univalue/test/fail40.json -------------------------------------------------------------------------------- /src/univalue/test/fail41.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BTCPrivate/BitcoinPrivate-legacy/70282894fcd3b1560adf9b36c9b4b74baaf5996e/src/univalue/test/fail41.json -------------------------------------------------------------------------------- /src/univalue/test/fail42.json: -------------------------------------------------------------------------------- 1 | ["before nul byte"]"after nul byte" 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail5.json: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /src/univalue/test/fail6.json: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /src/univalue/test/fail7.json: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /src/univalue/test/fail8.json: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /src/univalue/test/fail9.json: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /src/univalue/test/no_nul.cpp: -------------------------------------------------------------------------------- 1 | #include "univalue.h" 2 | 3 | int main (int argc, char *argv[]) 4 | { 5 | char buf[] = "___[1,2,3]___"; 6 | UniValue val; 7 | return val.read(buf + 3, 7) ? 0 : 1; 8 | } 9 | -------------------------------------------------------------------------------- /src/univalue/test/pass2.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/univalue/test/pass3.json: -------------------------------------------------------------------------------- 1 | { 2 | "JSON Test Pattern pass3": { 3 | "The outermost value": "must be an object or array.", 4 | "In this test": "It is an object." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/univalue/test/round1.json: -------------------------------------------------------------------------------- 1 | ["\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/round2.json: -------------------------------------------------------------------------------- 1 | ["a§■𐎒𝅘𝅥𝅯"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/round3.json: -------------------------------------------------------------------------------- 1 | "abcdefghijklmnopqrstuvwxyz" 2 | -------------------------------------------------------------------------------- /src/univalue/test/round4.json: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /src/univalue/test/round5.json: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /src/univalue/test/round6.json: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /src/univalue/test/round7.json: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /src/univalue/test/test_json.cpp: -------------------------------------------------------------------------------- 1 | // Test program that can be called by the JSON test suite at 2 | // https://github.com/nst/JSONTestSuite. 3 | // 4 | // It reads JSON input from stdin and exits with code 0 if it can be parsed 5 | // successfully. It also pretty prints the parsed JSON value to stdout. 6 | 7 | #include 8 | #include 9 | #include "univalue.h" 10 | 11 | using namespace std; 12 | 13 | int main (int argc, char *argv[]) 14 | { 15 | UniValue val; 16 | if (val.read(string(istreambuf_iterator(cin), 17 | istreambuf_iterator()))) { 18 | cout << val.write(1 /* prettyIndent */, 4 /* indentLevel */) << endl; 19 | return 0; 20 | } else { 21 | cerr << "JSON Parse Error." << endl; 22 | return 1; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/utilmoneystr.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | /** 7 | * Money parsing/formatting utilities. 8 | */ 9 | #ifndef BITCOIN_UTILMONEYSTR_H 10 | #define BITCOIN_UTILMONEYSTR_H 11 | 12 | #include 13 | #include 14 | 15 | #include "amount.h" 16 | 17 | std::string FormatMoney(const CAmount& n); 18 | bool ParseMoney(const std::string& str, CAmount& nRet); 19 | bool ParseMoney(const char* pszIn, CAmount& nRet); 20 | 21 | #endif // BITCOIN_UTILMONEYSTR_H 22 | -------------------------------------------------------------------------------- /src/utiltest.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "wallet/wallet.h" 6 | #include "zcash/JoinSplit.hpp" 7 | #include "zcash/Note.hpp" 8 | #include "zcash/NoteEncryption.hpp" 9 | 10 | CWalletTx GetValidReceive(ZCJoinSplit& params, 11 | const libzcash::SpendingKey& sk, CAmount value, 12 | bool randomInputs); 13 | libzcash::Note GetNote(ZCJoinSplit& params, 14 | const libzcash::SpendingKey& sk, 15 | const CTransaction& tx, size_t js, size_t n); 16 | CWalletTx GetValidSpend(ZCJoinSplit& params, 17 | const libzcash::SpendingKey& sk, 18 | const libzcash::Note& note, CAmount value); 19 | -------------------------------------------------------------------------------- /src/utiltime.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_UTILTIME_H 7 | #define BITCOIN_UTILTIME_H 8 | 9 | #include 10 | #include 11 | 12 | int64_t GetTime(); 13 | int64_t GetTimeMillis(); 14 | int64_t GetTimeMicros(); 15 | void SetMockTime(int64_t nMockTimeIn); 16 | void MilliSleep(int64_t n); 17 | 18 | std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); 19 | 20 | #endif // BITCOIN_UTILTIME_H 21 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_VERSION_H 6 | #define BITCOIN_VERSION_H 7 | 8 | /** 9 | * network protocol versioning 10 | */ 11 | 12 | static const int PROTOCOL_VERSION = 180006; 13 | 14 | //! initial proto version, to be increased after version/verack negotiation 15 | static const int INIT_PROTO_VERSION = 209; 16 | 17 | //! In this version, 'getheaders' was introduced. 18 | static const int GETHEADERS_VERSION = 31800; 19 | 20 | //! disconnect from peers older than this proto version 21 | static const int MIN_PEER_PROTO_VERSION = 180005; 22 | 23 | //! nTime field added to CAddress, starting with this version; 24 | //! if possible, avoid requesting addresses nodes older than this 25 | static const int CADDR_TIME_VERSION = 31402; 26 | 27 | //! only request blocks from nodes outside this range of versions 28 | static const int NOBLKS_VERSION_START = 32000; 29 | static const int NOBLKS_VERSION_END = 32400; 30 | 31 | //! BIP 0031, pong message, is enabled for all versions AFTER this one 32 | static const int BIP0031_VERSION = 60000; 33 | 34 | //! "mempool" command, enhanced "getdata" behavior starts with this version 35 | static const int MEMPOOL_GD_VERSION = 60002; 36 | 37 | #endif // BITCOIN_VERSION_H 38 | -------------------------------------------------------------------------------- /src/wallet/wallet_ismine.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_WALLET_WALLET_ISMINE_H 7 | #define BITCOIN_WALLET_WALLET_ISMINE_H 8 | 9 | #include "key.h" 10 | #include "script/standard.h" 11 | 12 | class CKeyStore; 13 | class CScript; 14 | 15 | /** IsMine() return codes */ 16 | enum isminetype 17 | { 18 | ISMINE_NO = 0, 19 | ISMINE_WATCH_ONLY = 1, 20 | ISMINE_SPENDABLE = 2, 21 | ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE 22 | }; 23 | /** used for bitflags of isminetype */ 24 | typedef uint8_t isminefilter; 25 | 26 | isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); 27 | isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); 28 | 29 | #endif // BITCOIN_WALLET_WALLET_ISMINE_H 30 | -------------------------------------------------------------------------------- /src/zcash/Address.cpp: -------------------------------------------------------------------------------- 1 | #include "Address.hpp" 2 | #include "NoteEncryption.hpp" 3 | #include "hash.h" 4 | #include "prf.h" 5 | #include "streams.h" 6 | 7 | namespace libzcash { 8 | 9 | uint256 PaymentAddress::GetHash() const { 10 | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); 11 | ss << *this; 12 | return Hash(ss.begin(), ss.end()); 13 | } 14 | 15 | uint256 ViewingKey::pk_enc() { 16 | return ZCNoteEncryption::generate_pubkey(*this); 17 | } 18 | 19 | ViewingKey SpendingKey::viewing_key() const { 20 | return ViewingKey(ZCNoteEncryption::generate_privkey(*this)); 21 | } 22 | 23 | SpendingKey SpendingKey::random() { 24 | return SpendingKey(random_uint252()); 25 | } 26 | 27 | PaymentAddress SpendingKey::address() const { 28 | return PaymentAddress(PRF_addr_a_pk(*this), viewing_key().pk_enc()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/zcash/CreateJoinSplit.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "../util.h" 6 | #include "primitives/transaction.h" 7 | #include "zcash/JoinSplit.hpp" 8 | #include "libsnark/common/profiling.hpp" 9 | 10 | using namespace libzcash; 11 | 12 | int main(int argc, char **argv) 13 | { 14 | libsnark::start_profiling(); 15 | 16 | auto p = ZCJoinSplit::Unopened(); 17 | p->loadVerifyingKey((ZC_GetParamsDir() / "sprout-verifying.key").string()); 18 | p->setProvingKeyPath((ZC_GetParamsDir() / "sprout-proving.key").string()); 19 | p->loadProvingKey(); 20 | 21 | // construct a proof. 22 | 23 | for (int i = 0; i < 5; i++) { 24 | uint256 anchor = ZCIncrementalMerkleTree().root(); 25 | uint256 pubKeyHash; 26 | 27 | JSDescription jsdesc(*p, 28 | pubKeyHash, 29 | anchor, 30 | {JSInput(), JSInput()}, 31 | {JSOutput(), JSOutput()}, 32 | 0, 33 | 0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/zcash/GenerateParams.cpp: -------------------------------------------------------------------------------- 1 | #include "zcash/JoinSplit.hpp" 2 | 3 | #include 4 | #include "crypto/common.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | if (init_and_check_sodium() == -1) { 9 | return 1; 10 | } 11 | 12 | if(argc != 4) { 13 | std::cerr << "Usage: " << argv[0] << " provingKeyFileName verificationKeyFileName r1csFileName" << std::endl; 14 | return 1; 15 | } 16 | 17 | std::string pkFile = argv[1]; 18 | std::string vkFile = argv[2]; 19 | std::string r1csFile = argv[3]; 20 | 21 | auto p = ZCJoinSplit::Generate(); 22 | 23 | p->saveProvingKey(pkFile); 24 | p->saveVerifyingKey(vkFile); 25 | p->saveR1CS(r1csFile); 26 | 27 | delete p; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/zcash/Zcash.h: -------------------------------------------------------------------------------- 1 | #ifndef _ZCCONSTANTS_H_ 2 | #define _ZCCONSTANTS_H_ 3 | 4 | #define ZC_NUM_JS_INPUTS 2 5 | #define ZC_NUM_JS_OUTPUTS 2 6 | #define INCREMENTAL_MERKLE_TREE_DEPTH 29 7 | #define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4 8 | 9 | #define ZC_NOTEPLAINTEXT_LEADING 1 10 | #define ZC_V_SIZE 8 11 | #define ZC_RHO_SIZE 32 12 | #define ZC_R_SIZE 32 13 | #define ZC_MEMO_SIZE 512 14 | 15 | #define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE) 16 | 17 | #endif // _ZCCONSTANTS_H_ 18 | -------------------------------------------------------------------------------- /src/zcash/prf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Zcash uses SHA256Compress as a PRF for various components 3 | within the zkSNARK circuit. 4 | */ 5 | 6 | #ifndef _PRF_H_ 7 | #define _PRF_H_ 8 | 9 | #include "uint256.h" 10 | #include "uint252.h" 11 | 12 | uint256 PRF_addr_a_pk(const uint252& a_sk); 13 | uint256 PRF_addr_sk_enc(const uint252& a_sk); 14 | uint256 PRF_nf(const uint252& a_sk, const uint256& rho); 15 | uint256 PRF_pk(const uint252& a_sk, size_t i0, const uint256& h_sig); 16 | uint256 PRF_rho(const uint252& phi, size_t i0, const uint256& h_sig); 17 | 18 | #endif // _PRF_H_ 19 | -------------------------------------------------------------------------------- /src/zcash/util.cpp: -------------------------------------------------------------------------------- 1 | #include "zcash/util.h" 2 | #include 3 | #include 4 | 5 | std::vector convertIntToVectorLE(const uint64_t val_int) { 6 | std::vector bytes; 7 | 8 | for(size_t i = 0; i < 8; i++) { 9 | bytes.push_back(val_int >> (i * 8)); 10 | } 11 | 12 | return bytes; 13 | } 14 | 15 | // Convert bytes into boolean vector. (MSB to LSB) 16 | std::vector convertBytesVectorToVector(const std::vector& bytes) { 17 | std::vector ret; 18 | ret.resize(bytes.size() * 8); 19 | 20 | unsigned char c; 21 | for (size_t i = 0; i < bytes.size(); i++) { 22 | c = bytes.at(i); 23 | for (size_t j = 0; j < 8; j++) { 24 | ret.at((i*8)+j) = (c >> (7-j)) & 1; 25 | } 26 | } 27 | 28 | return ret; 29 | } 30 | 31 | // Convert boolean vector (big endian) to integer 32 | uint64_t convertVectorToInt(const std::vector& v) { 33 | if (v.size() > 64) { 34 | throw std::length_error ("boolean vector can't be larger than 64 bits"); 35 | } 36 | 37 | uint64_t result = 0; 38 | for (size_t i=0; i 5 | #include 6 | 7 | std::vector convertIntToVectorLE(const uint64_t val_int); 8 | std::vector convertBytesVectorToVector(const std::vector& bytes); 9 | uint64_t convertVectorToInt(const std::vector& v); 10 | 11 | #endif // __ZCASH_UTIL_H 12 | -------------------------------------------------------------------------------- /src/zcbenchmarks.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARKS_H 2 | #define BENCHMARKS_H 3 | 4 | #include 5 | #include 6 | 7 | extern double benchmark_sleep(); 8 | extern double benchmark_parameter_loading(); 9 | extern double benchmark_create_joinsplit(); 10 | extern std::vector benchmark_create_joinsplit_threaded(int nThreads); 11 | extern double benchmark_solve_equihash(); 12 | extern std::vector benchmark_solve_equihash_threaded(int nThreads); 13 | extern double benchmark_verify_joinsplit(const JSDescription &joinsplit); 14 | extern double benchmark_verify_equihash(); 15 | extern double benchmark_large_tx(); 16 | extern double benchmark_try_decrypt_notes(size_t nAddrs); 17 | extern double benchmark_increment_note_witnesses(size_t nTxs); 18 | extern double benchmark_connectblock_slow(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/zmq/zmqabstractnotifier.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "zmqabstractnotifier.h" 6 | #include "util.h" 7 | 8 | 9 | CZMQAbstractNotifier::~CZMQAbstractNotifier() 10 | { 11 | assert(!psocket); 12 | } 13 | 14 | bool CZMQAbstractNotifier::NotifyBlock(const CBlockIndex * /*CBlockIndex*/) 15 | { 16 | return true; 17 | } 18 | 19 | bool CZMQAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/) 20 | { 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /src/zmq/zmqabstractnotifier.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H 6 | #define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H 7 | 8 | #include "zmqconfig.h" 9 | 10 | class CBlockIndex; 11 | class CZMQAbstractNotifier; 12 | 13 | typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)(); 14 | 15 | class CZMQAbstractNotifier 16 | { 17 | public: 18 | CZMQAbstractNotifier() : psocket(0) { } 19 | virtual ~CZMQAbstractNotifier(); 20 | 21 | template 22 | static CZMQAbstractNotifier* Create() 23 | { 24 | return new T(); 25 | } 26 | 27 | std::string GetType() const { return type; } 28 | void SetType(const std::string &t) { type = t; } 29 | std::string GetAddress() const { return address; } 30 | void SetAddress(const std::string &a) { address = a; } 31 | 32 | virtual bool Initialize(void *pcontext) = 0; 33 | virtual void Shutdown() = 0; 34 | 35 | virtual bool NotifyBlock(const CBlockIndex *pindex); 36 | virtual bool NotifyTransaction(const CTransaction &transaction); 37 | 38 | protected: 39 | void *psocket; 40 | std::string type; 41 | std::string address; 42 | }; 43 | 44 | #endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H 45 | -------------------------------------------------------------------------------- /src/zmq/zmqconfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ZMQ_ZMQCONFIG_H 6 | #define BITCOIN_ZMQ_ZMQCONFIG_H 7 | 8 | #if defined(HAVE_CONFIG_H) 9 | #include "config/bitcoin-config.h" 10 | #endif 11 | 12 | #include 13 | #include 14 | 15 | #if ENABLE_ZMQ 16 | #include 17 | #endif 18 | 19 | #include "primitives/block.h" 20 | #include "primitives/transaction.h" 21 | 22 | void zmqError(const char *str); 23 | 24 | #endif // BITCOIN_ZMQ_ZMQCONFIG_H 25 | -------------------------------------------------------------------------------- /src/zmq/zmqnotificationinterface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H 6 | #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H 7 | 8 | #include "validationinterface.h" 9 | #include 10 | #include 11 | 12 | class CBlockIndex; 13 | class CZMQAbstractNotifier; 14 | 15 | class CZMQNotificationInterface : public CValidationInterface 16 | { 17 | public: 18 | virtual ~CZMQNotificationInterface(); 19 | 20 | static CZMQNotificationInterface* CreateWithArguments(const std::map &args); 21 | 22 | protected: 23 | bool Initialize(); 24 | void Shutdown(); 25 | 26 | // CValidationInterface 27 | void SyncTransaction(const CTransaction &tx, const CBlock *pblock); 28 | void UpdatedBlockTip(const CBlockIndex *pindex); 29 | 30 | private: 31 | CZMQNotificationInterface(); 32 | 33 | void *pcontext; 34 | std::list notifiers; 35 | }; 36 | 37 | #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H 38 | --------------------------------------------------------------------------------