├── .cargo └── config.offline ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ └── ux-report.md ├── pull_request_template.md └── workflows │ └── book.yml ├── .gitignore ├── CONTRIBUTING.md ├── COPYING ├── Cargo.lock ├── Cargo.toml ├── INSTALL ├── Makefile.am ├── README.md ├── SECURITY.md ├── autogen.sh ├── 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_cxx_compile_stdcxx.m4 │ ├── ax_gcc_func_attribute.m4 │ ├── ax_pthread.m4 │ ├── bitcoin_find_bdb.m4 │ ├── bitcoin_subdir_to_include.m4 │ └── l_atomic.m4 ├── code_of_conduct.md ├── configure.ac ├── contrib ├── README.md ├── bitrpc │ ├── README.md │ └── bitrpc.py ├── ci-builders │ ├── buildbot │ │ ├── Dockerfile-bbworker.apt │ │ ├── Dockerfile-bbworker.arch │ │ ├── Dockerfile-bbworker.centos8 │ │ ├── Dockerfile-build-python.apt │ │ ├── Dockerfile-build.apt │ │ ├── Dockerfile-build.arch │ │ ├── Dockerfile-build.centos8 │ │ ├── Dockerfile-gitian.apt │ │ ├── README.md │ │ ├── apt-package-list.txt │ │ ├── bbworker-buildbot.tac │ │ ├── bbworker-requirements.txt │ │ └── docker-build.sh │ └── tekton │ │ ├── Dockerfile-build.apt │ │ ├── Dockerfile-build.arch │ │ ├── Dockerfile-build.centos8 │ │ ├── Dockerfile-tekton-worker │ │ ├── README.md │ │ ├── apt-package-tekton-list.txt │ │ ├── docker-build.sh │ │ └── requirements.txt ├── ci-workers │ ├── README.md │ ├── ansible.cfg │ ├── files │ │ └── bashrc │ ├── grind.yml │ ├── tasks │ │ ├── install-brew.yml │ │ └── install-pip.yml │ ├── templates │ │ ├── buildbot-worker.plist.j2 │ │ ├── buildbot-worker.service.j2 │ │ ├── host.ec2.j2 │ │ └── host.j2 │ ├── unix.yml │ └── vars │ │ ├── Archlinux.yml │ │ ├── CentOS.yml │ │ ├── Debian.yml │ │ ├── Fedora.yml │ │ ├── FreeBSD.yml │ │ ├── MacOSX.yml │ │ ├── Ubuntu.yml │ │ ├── buildbot.yml │ │ └── default.yml ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── examples │ │ └── ycash.conf │ ├── postinst │ ├── postrm │ ├── preinst │ ├── prerm │ ├── rules │ ├── zcash.examples │ ├── zcash.install │ └── zcash.manpages ├── devtools │ ├── README.md │ ├── fix-copyright-headers.py │ ├── gen-manpages.sh │ ├── github-merge.sh │ ├── optimize-pngs.py │ ├── security-check.py │ ├── split-debug.sh │ ├── symbol-check.py │ └── test-security-check.py ├── docker │ ├── .dockerignore │ ├── .env.example │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── docker-compose.yml │ └── entrypoint.sh ├── 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 ├── linearize │ ├── README.md │ ├── example-linearize.cfg │ ├── linearize-data.py │ └── linearize-hashes.py ├── macdeploy │ ├── README.md │ └── gen-sdk ├── metrics │ └── prometheus.yaml ├── qos │ ├── README.md │ └── tc.sh ├── seeds │ ├── README.md │ ├── generate-seeds.py │ └── makeseeds.py ├── simulations │ └── worstcase.py ├── testgen │ ├── README.md │ ├── base58.py │ └── gen_base58_test_vectors.py ├── tidy_datadir.sh ├── zcash-cli.bash-completion ├── zcash-tx.bash-completion ├── zcashd.bash-completion └── zmq │ └── zmq_sub.py ├── depends ├── .gitignore ├── Makefile ├── README.md ├── builders │ ├── darwin.mk │ ├── default.mk │ ├── freebsd.mk │ └── linux.mk ├── config.guess ├── config.site.in ├── config.sub ├── description.md ├── funcs.mk ├── hosts │ ├── darwin.mk │ ├── default.mk │ ├── freebsd.mk │ ├── linux.mk │ └── mingw32.mk ├── packages.md ├── packages │ ├── bdb.mk │ ├── boost.mk │ ├── googletest.mk │ ├── libcxx.mk │ ├── libevent.mk │ ├── libsodium.mk │ ├── native_b2.mk │ ├── native_ccache.mk │ ├── native_cctools.mk │ ├── native_clang.mk │ ├── native_libtinfo5.mk │ ├── native_rust.mk │ ├── packages.mk │ ├── utfcpp.mk │ └── zeromq.mk └── patches │ ├── bdb │ └── winioctl-and-atomic_init_db.patch │ ├── boost │ └── 6753-signals2-function-fix.patch │ ├── libevent │ └── 0001-fix-windows-getaddrinfo.patch │ ├── libsodium │ ├── 1.0.15-pubkey-validation.diff │ └── 1.0.15-signature-validation.diff │ ├── native_cctools │ └── ignore-otool.diff │ └── zeromq │ └── stats_proxy-missing-braces.diff ├── doc ├── Doxyfile ├── authors.md ├── bips.md ├── book │ ├── .gitignore │ ├── book.toml │ └── src │ │ ├── README.md │ │ ├── SUMMARY.md │ │ ├── design.md │ │ ├── design │ │ ├── chain-state.md │ │ └── coins-view.md │ │ ├── doc │ │ └── imgs │ │ │ ├── logo.png │ │ │ └── zcashd_screen.gif │ │ ├── user.md │ │ └── user │ │ └── metrics.md ├── developer-notes.md ├── dnsseed-policy.md ├── files.md ├── hotfix-process.md ├── imgs │ ├── logo.png │ ├── zcashd_screen.gif │ └── zcashd_screenshot.png ├── man │ ├── Makefile.am │ ├── zcash-cli.1 │ ├── zcash-fetch-params.1 │ ├── zcash-tx.1 │ └── zcashd.1 ├── payment-api.md ├── payment-disclosure.md ├── reduce-traffic.md ├── reducing-memory-usage.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.11-rc1.md │ ├── release-notes-1.0.11.md │ ├── release-notes-1.0.12-rc1.md │ ├── release-notes-1.0.12.md │ ├── release-notes-1.0.13-rc1.md │ ├── release-notes-1.0.13-rc2.md │ ├── release-notes-1.0.13.md │ ├── release-notes-1.0.14-rc1.md │ ├── release-notes-1.0.14.md │ ├── release-notes-1.0.15-rc1.md │ ├── release-notes-1.0.15.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-notes-1.1.0-rc1.md │ ├── release-notes-1.1.0.md │ ├── release-notes-1.1.1-rc1.md │ ├── release-notes-1.1.1-rc2.md │ ├── release-notes-1.1.1.md │ ├── release-notes-1.1.2-rc1.md │ ├── release-notes-1.1.2.md │ ├── release-notes-2.0.0-rc1.md │ ├── release-notes-2.0.0.md │ ├── release-notes-2.0.1-rc1.md │ ├── release-notes-2.0.1.md │ ├── release-notes-2.0.2-rc1.md │ ├── release-notes-2.0.2.md │ ├── release-notes-2.0.3-rc1.md │ ├── release-notes-2.0.3.md │ ├── release-notes-2.0.4-rc1.md │ ├── release-notes-2.0.4.md │ ├── release-notes-2.0.5-1.md │ ├── release-notes-2.0.5-2.md │ ├── release-notes-2.0.5-rc1.md │ ├── release-notes-2.0.5.md │ ├── release-notes-2.0.6-rc1.md │ ├── release-notes-2.0.6.md │ ├── release-notes-2.0.7-1.md │ ├── release-notes-2.0.7-2.md │ ├── release-notes-2.0.7-3.md │ ├── release-notes-2.0.7-rc1.md │ ├── release-notes-2.0.7.md │ ├── release-notes-2.1.0-1.md │ ├── release-notes-2.1.0-rc1.md │ ├── release-notes-2.1.0.md │ ├── release-notes-2.1.1-1.md │ ├── release-notes-2.1.1-rc1.md │ ├── release-notes-2.1.1-rc2.md │ ├── release-notes-2.1.1.md │ ├── release-notes-2.1.2-1.md │ ├── release-notes-2.1.2-2.md │ ├── release-notes-2.1.2-3.md │ ├── release-notes-2.1.2-rc1.md │ ├── release-notes-2.1.2.md │ ├── release-notes-3.0.0-rc1.md │ ├── release-notes-3.0.0.md │ ├── release-notes-3.1.0-rc1.md │ ├── release-notes-3.1.0-rc2.md │ ├── release-notes-3.1.0.md │ ├── release-notes-4.0.0-rc1.md │ ├── release-notes-4.0.0.md │ ├── release-notes-4.1.0-rc1.md │ ├── release-notes-4.1.0.md │ ├── release-notes-4.1.1.md │ ├── release-notes-4.2.0-rc1.md │ ├── release-notes-4.2.0.md │ ├── release-notes-4.3.0-rc1.md │ ├── release-notes-4.3.0.md │ ├── release-notes-4.4.0-rc1.md │ ├── release-notes-4.4.0.md │ ├── release-notes-4.4.1-rc1.md │ └── release-notes-4.4.1.md ├── release-process.md ├── security-warnings.md ├── shield-coinbase.md ├── tor.md ├── translation_strings_policy.md ├── unit-tests.md ├── wallet-backup.md └── zmq.md ├── docker └── Dockerfile ├── libzcash_script.pc.in ├── mkreleaselinux.sh ├── mkwinrelease.sh ├── qa ├── README.md ├── pull-tester │ ├── rpc-tests.py │ └── tests_config.ini.in ├── rpc-tests │ ├── .gitignore │ ├── README.md │ ├── addressindex.py │ ├── bip65-cltv-p2p.py │ ├── bipdersig-p2p.py │ ├── blockchain.py │ ├── coinbase_funding_streams.py │ ├── create_cache.py │ ├── decodescript.py │ ├── disablewallet.py │ ├── feature_logging.py │ ├── feature_walletfile.py │ ├── feature_zip221.py │ ├── finalsaplingroot.py │ ├── forknotify.py │ ├── framework.py │ ├── fundrawtransaction.py │ ├── getblocktemplate.py │ ├── getblocktemplate_longpoll.py │ ├── getblocktemplate_proposals.py │ ├── getchaintips.py │ ├── getrawtransaction_insight.py │ ├── golden │ │ ├── blossom.tar.gz │ │ └── heartwood.tar.gz │ ├── hardforkdetection.py │ ├── httpbasics.py │ ├── invalidateblock.py │ ├── invalidblockrequest.py │ ├── ivk_import_export.py │ ├── key_import_export.py │ ├── keypool.py │ ├── listtransactions.py │ ├── maxblocksinflight.py │ ├── maxuploadtarget.py │ ├── mempool_limit.py │ ├── mempool_nu_activation.py │ ├── mempool_reorg.py │ ├── mempool_resurrect_test.py │ ├── mempool_spendcoinbase.py │ ├── mempool_tx_expiry.py │ ├── mergetoaddress_helper.py │ ├── mergetoaddress_mixednotes.py │ ├── mergetoaddress_sapling.py │ ├── mergetoaddress_sprout.py │ ├── merkle_blocks.py │ ├── mining_shielded_coinbase.py │ ├── multi_rpc.py │ ├── nodehandling.py │ ├── p2p-acceptblock.py │ ├── p2p-fullblocktest.py │ ├── p2p_node_bloom.py │ ├── p2p_nu_peer_management.py │ ├── p2p_txexpiringsoon.py │ ├── p2p_txexpiry_dos.py │ ├── paymentdisclosure.py │ ├── post_heartwood_rollback.py │ ├── prioritisetransaction.py │ ├── proxy_test.py │ ├── pruning.py │ ├── rawtransactions.py │ ├── receivedby.py │ ├── regtest_signrawtransaction.py │ ├── reindex.py │ ├── remove_sprout_shielding.py │ ├── reorg_limit.py │ ├── rest.py │ ├── rewind_index.py │ ├── rpcbind_test.py │ ├── sapling_rewind_check.py │ ├── shorter_block_times.py │ ├── signrawtransaction_offline.py │ ├── signrawtransactions.py │ ├── smartfees.py │ ├── spentindex.py │ ├── sprout_sapling_migration.py │ ├── test_framework │ │ ├── __init__.py │ │ ├── authproxy.py │ │ ├── bignum.py │ │ ├── blockstore.py │ │ ├── blocktools.py │ │ ├── comptool.py │ │ ├── coverage.py │ │ ├── equihash.py │ │ ├── flyclient.py │ │ ├── key.py │ │ ├── mininode.py │ │ ├── netutil.py │ │ ├── script.py │ │ ├── socks5.py │ │ ├── test_framework.py │ │ └── util.py │ ├── timestampindex.py │ ├── turnstile.py │ ├── tx_expiry_helper.py │ ├── txn_doublespend.py │ ├── upgrade_golden.py │ ├── wallet.py │ ├── wallet_1941.py │ ├── wallet_addresses.py │ ├── wallet_anchorfork.py │ ├── wallet_broadcast.py │ ├── wallet_changeaddresses.py │ ├── wallet_changeindicator.py │ ├── wallet_db_flush.py │ ├── wallet_diversified_addresses.py │ ├── wallet_import_export.py │ ├── wallet_listnotes.py │ ├── wallet_listreceived.py │ ├── wallet_nullifiers.py │ ├── wallet_overwintertx.py │ ├── wallet_parsing_amounts.py │ ├── wallet_persistence.py │ ├── wallet_sapling.py │ ├── wallet_sendmany_any_taddr.py │ ├── wallet_shieldcoinbase.py │ ├── wallet_shieldcoinbase_sapling.py │ ├── wallet_shieldcoinbase_sprout.py │ ├── wallet_shieldingcoinbase.py │ ├── wallet_treestate.py │ ├── wallet_z_sendmany.py │ ├── wallet_zero_value.py │ ├── walletbackup.py │ ├── zapwallettxes.py │ ├── zcjoinsplit.py │ ├── zcjoinsplitdoublespend.py │ ├── zkey_import_export.py │ └── zmq_test.py └── zcash │ ├── checksec.sh │ ├── create_benchmark_archive.py │ ├── create_wallet_200k_utxos.py │ ├── full_test_suite.py │ ├── performance-measurements.sh │ ├── postponed-updates.txt │ ├── smoke_tests.py │ ├── test-depends-sources-mirror.py │ └── updatecheck.py ├── rust-toolchain ├── share ├── genbuild.sh └── rpcuser │ ├── README.md │ └── rpcuser.py ├── src ├── .clang-format ├── Makefile.am ├── Makefile.bench.include ├── Makefile.crc32c.include ├── Makefile.gtest.include ├── Makefile.leveldb.include ├── Makefile.test.include ├── addrdb.cpp ├── addrdb.h ├── addressindex.h ├── addrman.cpp ├── addrman.h ├── alert.cpp ├── alert.h ├── alertkeys.h ├── amount.cpp ├── amount.h ├── arith_uint256.cpp ├── arith_uint256.h ├── asyncrpcoperation.cpp ├── asyncrpcoperation.h ├── asyncrpcqueue.cpp ├── asyncrpcqueue.h ├── base58.cpp ├── base58.h ├── bech32.cpp ├── bech32.h ├── bench │ ├── .gitignore │ ├── Examples.cpp │ ├── base58.cpp │ ├── bench.cpp │ ├── bench.h │ ├── bench_bitcoin.cpp │ ├── checkqueue.cpp │ ├── crypto_hash.cpp │ ├── lockedpool.cpp │ ├── perf.cpp │ ├── perf.h │ ├── prevector_destructor.cpp │ ├── rollingbloom.cpp │ └── verification.cpp ├── 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 │ ├── funding.cpp │ ├── funding.h │ ├── params.cpp │ ├── params.h │ ├── upgrades.cpp │ ├── upgrades.h │ └── validation.h ├── core_io.h ├── core_memusage.h ├── core_read.cpp ├── core_write.cpp ├── crc32c │ ├── .appveyor.yml │ ├── .clang-format │ ├── .clang_complete │ ├── .gitignore │ ├── .gitmodules │ ├── .travis.yml │ ├── .ycm_extra_conf.py │ ├── AUTHORS │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── Crc32cConfig.cmake │ ├── LICENSE │ ├── README.md │ ├── include │ │ └── crc32c │ │ │ └── crc32c.h │ └── src │ │ ├── crc32c.cc │ │ ├── crc32c_arm64.cc │ │ ├── crc32c_arm64.h │ │ ├── crc32c_arm64_linux_check.h │ │ ├── crc32c_arm64_unittest.cc │ │ ├── crc32c_benchmark.cc │ │ ├── crc32c_capi_unittest.c │ │ ├── crc32c_config.h.in │ │ ├── crc32c_extend_unittests.h │ │ ├── crc32c_internal.h │ │ ├── crc32c_portable.cc │ │ ├── crc32c_portable_unittest.cc │ │ ├── crc32c_prefetch.h │ │ ├── crc32c_prefetch_unittest.cc │ │ ├── crc32c_read_le.h │ │ ├── crc32c_read_le_unittest.cc │ │ ├── crc32c_round_up.h │ │ ├── crc32c_round_up_unittest.cc │ │ ├── crc32c_sse42.cc │ │ ├── crc32c_sse42.h │ │ ├── crc32c_sse42_check.h │ │ ├── crc32c_sse42_unittest.cc │ │ ├── crc32c_test_main.cc │ │ └── crc32c_unittest.cc ├── crypto │ ├── aes.cpp │ ├── aes.h │ ├── chacha20.cpp │ ├── chacha20.h │ ├── common.h │ ├── ctaes │ │ ├── COPYING │ │ ├── README.md │ │ ├── bench.c │ │ ├── ctaes.c │ │ ├── ctaes.h │ │ └── test.c │ ├── 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 │ ├── sha256_avx2.cpp │ ├── sha256_shani.cpp │ ├── sha256_sse4.cpp │ ├── sha256_sse41.cpp │ ├── sha512.cpp │ └── sha512.h ├── dbwrapper.cpp ├── dbwrapper.h ├── deprecation.cpp ├── deprecation.h ├── experimental_features.cpp ├── experimental_features.h ├── fs.cpp ├── fs.h ├── fuzzing │ ├── CheckBlock │ │ ├── fuzz.cpp │ │ └── input │ │ │ ├── 0.bin │ │ │ ├── 476431.bin │ │ │ └── 620000.bin │ ├── DecodeHexTx │ │ ├── fuzz.cpp │ │ └── input │ │ │ ├── coinbase.txt │ │ │ ├── manyoutputs.txt │ │ │ ├── sapling.txt │ │ │ └── sprout.txt │ ├── DeserializeAddrMan │ │ ├── fuzz.cpp │ │ └── input │ │ │ └── peers.dat-minus-4-byte-header │ ├── DeserializeTx │ │ ├── fuzz.cpp │ │ └── input │ │ │ ├── coinbase.bin │ │ │ ├── manyoutputs.bin │ │ │ ├── sapling.bin │ │ │ └── sprout.bin │ ├── ReadFeeEstimates │ │ ├── fuzz.cpp │ │ └── input │ │ │ └── fee_estimates.dat │ └── UniValue__Read │ │ ├── dict │ │ ├── fuzz.cpp │ │ └── input │ │ ├── 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 │ │ ├── pass1.json │ │ ├── pass2.json │ │ ├── pass3.json │ │ ├── round1.json │ │ ├── round2.json │ │ ├── round3.json │ │ ├── round4.json │ │ ├── round5.json │ │ ├── round6.json │ │ └── round7.json ├── gtest │ ├── json_test_vectors.cpp │ ├── json_test_vectors.h │ ├── main.cpp │ ├── test_allocator.cpp │ ├── test_block.cpp │ ├── test_checkblock.cpp │ ├── test_checktransaction.cpp │ ├── test_consensus.cpp │ ├── test_deprecation.cpp │ ├── test_dynamicusage.cpp │ ├── test_equihash.cpp │ ├── test_feature_flagging.cpp │ ├── test_foundersreward.cpp │ ├── test_history.cpp │ ├── test_httprpc.cpp │ ├── test_joinsplit.cpp │ ├── test_keys.cpp │ ├── test_keystore.cpp │ ├── test_libzcash_utils.cpp │ ├── test_mempool.cpp │ ├── test_mempoollimit.cpp │ ├── test_merkletree.cpp │ ├── test_metrics.cpp │ ├── test_miner.cpp │ ├── test_noteencryption.cpp │ ├── test_pedersen_hash.cpp │ ├── test_pow.cpp │ ├── test_random.cpp │ ├── test_rpc.cpp │ ├── test_sapling_note.cpp │ ├── test_tautology.cpp │ ├── test_timedata.cpp │ ├── test_transaction.cpp │ ├── test_transaction_builder.cpp │ ├── test_txid.cpp │ ├── test_upgrades.cpp │ ├── test_validation.cpp │ ├── test_zip32.cpp │ ├── utils.cpp │ └── utils.h ├── hash.cpp ├── hash.h ├── httprpc.cpp ├── httprpc.h ├── httpserver.cpp ├── httpserver.h ├── init.cpp ├── init.h ├── key.cpp ├── key.h ├── key_constants.h ├── key_io.cpp ├── key_io.h ├── keystore.cpp ├── keystore.h ├── leveldb │ ├── .appveyor.yml │ ├── .clang-format │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── NEWS │ ├── README.md │ ├── TODO │ ├── benchmarks │ │ ├── db_bench.cc │ │ ├── db_bench_sqlite3.cc │ │ └── db_bench_tree_db.cc │ ├── cmake │ │ └── leveldbConfig.cmake │ ├── db │ │ ├── autocompact_test.cc │ │ ├── builder.cc │ │ ├── builder.h │ │ ├── c.cc │ │ ├── c_test.c │ │ ├── corruption_test.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 │ │ ├── fault_injection_test.cc │ │ ├── filename.cc │ │ ├── filename.h │ │ ├── filename_test.cc │ │ ├── leveldbutil.cc │ │ ├── log_format.h │ │ ├── log_reader.cc │ │ ├── log_reader.h │ │ ├── log_test.cc │ │ ├── log_writer.cc │ │ ├── log_writer.h │ │ ├── memtable.cc │ │ ├── memtable.h │ │ ├── recovery_test.cc │ │ ├── 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 │ │ ├── benchmark.html │ │ ├── impl.md │ │ ├── index.md │ │ ├── log_format.md │ │ └── table_format.md │ ├── helpers │ │ └── memenv │ │ │ ├── memenv.cc │ │ │ ├── memenv.h │ │ │ └── memenv_test.cc │ ├── include │ │ └── leveldb │ │ │ ├── c.h │ │ │ ├── cache.h │ │ │ ├── comparator.h │ │ │ ├── db.h │ │ │ ├── dumpfile.h │ │ │ ├── env.h │ │ │ ├── export.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 │ │ └── issue320_test.cc │ ├── port │ │ ├── README.md │ │ ├── port.h │ │ ├── port_config.h.in │ │ ├── port_example.h │ │ ├── port_stdcxx.h │ │ └── thread_annotations.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_posix_test.cc │ │ ├── env_posix_test_helper.h │ │ ├── env_test.cc │ │ ├── env_windows.cc │ │ ├── env_windows_test.cc │ │ ├── env_windows_test_helper.h │ │ ├── filter_policy.cc │ │ ├── hash.cc │ │ ├── hash.h │ │ ├── hash_test.cc │ │ ├── histogram.cc │ │ ├── histogram.h │ │ ├── logging.cc │ │ ├── logging.h │ │ ├── logging_test.cc │ │ ├── mutexlock.h │ │ ├── no_destructor.h │ │ ├── no_destructor_test.cc │ │ ├── options.cc │ │ ├── posix_logger.h │ │ ├── random.h │ │ ├── status.cc │ │ ├── status_test.cc │ │ ├── testharness.cc │ │ ├── testharness.h │ │ ├── testutil.cc │ │ ├── testutil.h │ │ └── windows_logger.h ├── limitedmap.h ├── logging.cpp ├── logging.h ├── main.cpp ├── main.h ├── mempool_limit.cpp ├── mempool_limit.h ├── memusage.h ├── merkleblock.cpp ├── merkleblock.h ├── metrics.cpp ├── metrics.h ├── miner.cpp ├── miner.h ├── net.cpp ├── net.h ├── netbase.cpp ├── netbase.h ├── noui.cpp ├── noui.h ├── obj │ └── .gitignore ├── policy │ ├── fees.cpp │ ├── fees.h │ ├── policy.cpp │ └── policy.h ├── pow.cpp ├── pow.h ├── pow │ └── tromp │ │ ├── equi.h │ │ ├── equi_miner.h │ │ └── osx_barrier.h ├── prevector.h ├── primitives │ ├── block.cpp │ ├── block.h │ ├── transaction.cpp │ └── transaction.h ├── proof_verifier.cpp ├── proof_verifier.h ├── protocol.cpp ├── protocol.h ├── pubkey.cpp ├── pubkey.h ├── random.cpp ├── random.h ├── rest.cpp ├── reverse_iterator.h ├── reverselock.h ├── rpc │ ├── blockchain.cpp │ ├── client.cpp │ ├── client.h │ ├── mining.cpp │ ├── misc.cpp │ ├── net.cpp │ ├── protocol.cpp │ ├── protocol.h │ ├── rawtransaction.cpp │ ├── register.h │ ├── server.cpp │ └── server.h ├── rust │ ├── README.md │ ├── include │ │ ├── librustzcash.h │ │ ├── rust │ │ │ ├── VA_OPT.hpp │ │ │ ├── blake2b.h │ │ │ ├── ed25519.h │ │ │ ├── ed25519 │ │ │ │ └── types.h │ │ │ ├── helpers.h │ │ │ ├── map.h │ │ │ ├── metrics.h │ │ │ └── types.h │ │ └── tracing.h │ └── src │ │ ├── blake2b.rs │ │ ├── ed25519.rs │ │ ├── metrics_ffi.rs │ │ ├── metrics_ffi │ │ └── prometheus.rs │ │ ├── rustzcash.rs │ │ ├── tests │ │ ├── key_agreement.rs │ │ ├── key_components.rs │ │ ├── mmr.rs │ │ ├── mod.rs │ │ ├── notes.rs │ │ ├── res │ │ │ ├── tree1023.dat │ │ │ └── tree16.dat │ │ └── signatures.rs │ │ └── tracing_ffi.rs ├── scheduler.cpp ├── scheduler.h ├── script │ ├── interpreter.cpp │ ├── interpreter.h │ ├── ismine.cpp │ ├── ismine.h │ ├── script.cpp │ ├── script.h │ ├── script_error.cpp │ ├── script_error.h │ ├── sigcache.cpp │ ├── sigcache.h │ ├── sign.cpp │ ├── sign.h │ ├── standard.cpp │ ├── standard.h │ ├── zcash_script.cpp │ └── zcash_script.h ├── secp256k1 │ ├── .cirrus.yml │ ├── .gitattributes │ ├── .gitignore │ ├── CHANGELOG.md │ ├── COPYING │ ├── Makefile.am │ ├── README.md │ ├── SECURITY.md │ ├── autogen.sh │ ├── build-aux │ │ └── m4 │ │ │ └── bitcoin_secp.m4 │ ├── ci │ │ ├── cirrus.sh │ │ └── linux-debian.Dockerfile │ ├── configure.ac │ ├── contrib │ │ ├── lax_der_parsing.c │ │ ├── lax_der_parsing.h │ │ ├── lax_der_privatekey_parsing.c │ │ └── lax_der_privatekey_parsing.h │ ├── doc │ │ ├── release-process.md │ │ └── safegcd_implementation.md │ ├── examples │ │ ├── EXAMPLES_COPYING │ │ ├── ecdh.c │ │ ├── ecdsa.c │ │ ├── random.h │ │ └── schnorr.c │ ├── include │ │ ├── secp256k1.h │ │ ├── secp256k1_ecdh.h │ │ ├── secp256k1_extrakeys.h │ │ ├── secp256k1_preallocated.h │ │ ├── secp256k1_recovery.h │ │ └── secp256k1_schnorrsig.h │ ├── libsecp256k1.pc.in │ ├── sage │ │ ├── gen_exhaustive_groups.sage │ │ ├── gen_split_lambda_constants.sage │ │ ├── group_prover.sage │ │ ├── prove_group_implementations.sage │ │ ├── secp256k1_params.sage │ │ └── weierstrass_prover.sage │ └── src │ │ ├── asm │ │ └── field_10x26_arm.s │ │ ├── assumptions.h │ │ ├── bench.c │ │ ├── bench.h │ │ ├── bench_ecmult.c │ │ ├── bench_internal.c │ │ ├── ecdsa.h │ │ ├── ecdsa_impl.h │ │ ├── eckey.h │ │ ├── eckey_impl.h │ │ ├── ecmult.h │ │ ├── ecmult_compute_table.h │ │ ├── ecmult_compute_table_impl.h │ │ ├── ecmult_const.h │ │ ├── ecmult_const_impl.h │ │ ├── ecmult_gen.h │ │ ├── ecmult_gen_compute_table.h │ │ ├── ecmult_gen_compute_table_impl.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 │ │ ├── group.h │ │ ├── group_impl.h │ │ ├── hash.h │ │ ├── hash_impl.h │ │ ├── int128.h │ │ ├── int128_impl.h │ │ ├── int128_native.h │ │ ├── int128_native_impl.h │ │ ├── int128_struct.h │ │ ├── int128_struct_impl.h │ │ ├── modinv32.h │ │ ├── modinv32_impl.h │ │ ├── modinv64.h │ │ ├── modinv64_impl.h │ │ ├── modules │ │ ├── ecdh │ │ │ ├── Makefile.am.include │ │ │ ├── bench_impl.h │ │ │ ├── main_impl.h │ │ │ └── tests_impl.h │ │ ├── extrakeys │ │ │ ├── Makefile.am.include │ │ │ ├── main_impl.h │ │ │ ├── tests_exhaustive_impl.h │ │ │ └── tests_impl.h │ │ ├── recovery │ │ │ ├── Makefile.am.include │ │ │ ├── bench_impl.h │ │ │ ├── main_impl.h │ │ │ ├── tests_exhaustive_impl.h │ │ │ └── tests_impl.h │ │ └── schnorrsig │ │ │ ├── Makefile.am.include │ │ │ ├── bench_impl.h │ │ │ ├── main_impl.h │ │ │ ├── tests_exhaustive_impl.h │ │ │ └── tests_impl.h │ │ ├── precompute_ecmult.c │ │ ├── precompute_ecmult_gen.c │ │ ├── precomputed_ecmult.c │ │ ├── precomputed_ecmult.h │ │ ├── precomputed_ecmult_gen.c │ │ ├── precomputed_ecmult_gen.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 │ │ ├── scratch.h │ │ ├── scratch_impl.h │ │ ├── secp256k1.c │ │ ├── selftest.h │ │ ├── testrand.h │ │ ├── testrand_impl.h │ │ ├── tests.c │ │ ├── tests_exhaustive.c │ │ ├── util.h │ │ └── valgrind_ctime_test.c ├── sendalert.cpp ├── serialize.h ├── spentindex.h ├── streams.h ├── support │ ├── allocators │ │ ├── secure.h │ │ └── zeroafterfree.h │ ├── cleanse.cpp │ ├── cleanse.h │ ├── events.h │ ├── lockedpool.cpp │ └── lockedpool.h ├── sync.cpp ├── sync.h ├── test │ ├── Checkpoints_tests.cpp │ ├── DoS_tests.cpp │ ├── Makefile │ ├── README.md │ ├── addrman_tests.cpp │ ├── alert_tests.cpp │ ├── allocator_tests.cpp │ ├── arith_uint256_tests.cpp │ ├── base32_tests.cpp │ ├── base58_tests.cpp │ ├── base64_tests.cpp │ ├── bctest.py │ ├── bech32_tests.cpp │ ├── bip32_tests.cpp │ ├── bitcoin-util-test.py │ ├── bloom_tests.cpp │ ├── buildenv.py.in │ ├── checkblock_tests.cpp │ ├── checkqueue_tests.cpp │ ├── coins_tests.cpp │ ├── compress_tests.cpp │ ├── convertbits_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 │ │ ├── blanktx.json │ │ ├── merkle_commitments.json │ │ ├── merkle_commitments_sapling.json │ │ ├── merkle_path.json │ │ ├── merkle_path_sapling.json │ │ ├── merkle_roots.json │ │ ├── merkle_roots_sapling.json │ │ ├── merkle_serialization.json │ │ ├── merkle_serialization_sapling.json │ │ ├── merkle_witness_serialization.json │ │ ├── merkle_witness_serialization_sapling.json │ │ ├── sapling_key_components.json │ │ ├── script_invalid.json │ │ ├── script_valid.json │ │ ├── sighash.json │ │ ├── tt-delin1-out.hex │ │ ├── tt-delin1-out.json │ │ ├── tt-delout1-out.hex │ │ ├── tt-delout1-out.json │ │ ├── tt-locktime317000-out.hex │ │ ├── tt-locktime317000-out.json │ │ ├── tx394b54bb.hex │ │ ├── tx_invalid.json │ │ ├── tx_valid.json │ │ ├── txcreate1.hex │ │ ├── txcreate1.json │ │ ├── txcreate2.hex │ │ ├── txcreate2.json │ │ ├── txcreatedata_seq0.hex │ │ ├── txcreatedata_seq0.json │ │ ├── txcreatedata_seq1.hex │ │ ├── txcreatedata_seq1.json │ │ ├── txcreatesign.hex │ │ └── txcreatesign.json │ ├── dbwrapper_tests.cpp │ ├── equihash_tests.cpp │ ├── getarg_tests.cpp │ ├── hash_tests.cpp │ ├── key_tests.cpp │ ├── limitedmap_tests.cpp │ ├── main_tests.cpp │ ├── mempool_tests.cpp │ ├── miner_tests.cpp │ ├── multisig_tests.cpp │ ├── net_tests.cpp │ ├── netbase_tests.cpp │ ├── pmt_tests.cpp │ ├── policyestimator_tests.cpp │ ├── pow_tests.cpp │ ├── prevector_tests.cpp │ ├── raii_event_tests.cpp │ ├── random_tests.cpp │ ├── reverselock_tests.cpp │ ├── rpc_tests.cpp │ ├── sanity_tests.cpp │ ├── scheduler_tests.cpp │ ├── script_P2PKH_tests.cpp │ ├── script_P2SH_tests.cpp │ ├── script_standard_tests.cpp │ ├── script_tests.cpp │ ├── scriptnum10.h │ ├── scriptnum_tests.cpp │ ├── serialize_tests.cpp │ ├── sha256compress_tests.cpp │ ├── sighash_tests.cpp │ ├── sigopcount_tests.cpp │ ├── skiplist_tests.cpp │ ├── streams_tests.cpp │ ├── test_bitcoin.cpp │ ├── test_bitcoin.h │ ├── test_random.h │ ├── test_util.cpp │ ├── test_util.h │ ├── torcontrol_tests.cpp │ ├── transaction_tests.cpp │ ├── txvalidationcache_tests.cpp │ ├── uint256_tests.cpp │ ├── univalue_tests.cpp │ └── util_tests.cpp ├── threadsafety.h ├── timedata.cpp ├── timedata.h ├── timestampindex.h ├── tinyformat.h ├── torcontrol.cpp ├── torcontrol.h ├── transaction_builder.cpp ├── transaction_builder.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.md │ ├── TODO │ ├── autogen.sh │ ├── build-aux │ │ └── m4 │ │ │ └── .gitignore │ ├── configure.ac │ ├── gen │ │ └── gen.cpp │ ├── include │ │ └── univalue.h │ ├── lib │ │ ├── .gitignore │ │ ├── univalue.cpp │ │ ├── univalue_escapes.h │ │ ├── univalue_get.cpp │ │ ├── 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 │ │ ├── fail44.json │ │ ├── fail45.json │ │ ├── fail5.json │ │ ├── fail6.json │ │ ├── fail7.json │ │ ├── fail8.json │ │ ├── fail9.json │ │ ├── no_nul.cpp │ │ ├── object.cpp │ │ ├── pass1.json │ │ ├── pass2.json │ │ ├── pass3.json │ │ ├── pass4.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 ├── wallet │ ├── asyncrpcoperation_common.cpp │ ├── asyncrpcoperation_common.h │ ├── asyncrpcoperation_mergetoaddress.cpp │ ├── asyncrpcoperation_mergetoaddress.h │ ├── asyncrpcoperation_saplingconsolidation.cpp │ ├── asyncrpcoperation_saplingconsolidation.h │ ├── asyncrpcoperation_saplingmigration.cpp │ ├── asyncrpcoperation_saplingmigration.h │ ├── asyncrpcoperation_sendmany.cpp │ ├── asyncrpcoperation_sendmany.h │ ├── asyncrpcoperation_shieldcoinbase.cpp │ ├── asyncrpcoperation_shieldcoinbase.h │ ├── crypter.cpp │ ├── crypter.h │ ├── db.cpp │ ├── db.h │ ├── gtest │ │ ├── test_paymentdisclosure.cpp │ │ ├── test_wallet.cpp │ │ └── test_wallet_zkeys.cpp │ ├── paymentdisclosure.cpp │ ├── paymentdisclosure.h │ ├── paymentdisclosuredb.cpp │ ├── paymentdisclosuredb.h │ ├── rpcdisclosure.cpp │ ├── rpcdump.cpp │ ├── rpcwallet.cpp │ ├── rpcwallet.h │ ├── test │ │ ├── accounting_tests.cpp │ │ ├── crypto_tests.cpp │ │ ├── rpc_wallet_tests.cpp │ │ ├── wallet_test_fixture.cpp │ │ ├── wallet_test_fixture.h │ │ └── wallet_tests.cpp │ ├── wallet.cpp │ ├── wallet.h │ ├── walletdb.cpp │ └── walletdb.h ├── warnings.cpp ├── warnings.h ├── zcash │ ├── Address.cpp │ ├── Address.hpp │ ├── History.cpp │ ├── History.hpp │ ├── IncrementalMerkleTree.cpp │ ├── IncrementalMerkleTree.hpp │ ├── JoinSplit.cpp │ ├── JoinSplit.hpp │ ├── Note.cpp │ ├── Note.hpp │ ├── NoteEncryption.cpp │ ├── NoteEncryption.hpp │ ├── Proof.hpp │ ├── Zcash.h │ ├── address │ │ ├── sapling.cpp │ │ ├── sapling.hpp │ │ ├── sprout.cpp │ │ ├── sprout.hpp │ │ ├── zip32.cpp │ │ └── zip32.h │ ├── 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 ├── test └── lint │ ├── README.md │ ├── commit-script-check.sh │ ├── git-subtree-check.sh │ ├── lint-all.sh │ ├── lint-include-guards.sh │ ├── lint-includes.sh │ ├── lint-locale-dependence.sh │ ├── lint-python-utf8-encoding.sh │ ├── lint-shebang.sh │ ├── lint-shell-locale.sh │ ├── lint-shell.sh │ └── lint-whitespace.sh └── zcutil ├── afl ├── afl-build.sh ├── afl-get.sh ├── afl-getbuildrun.sh ├── afl-run.sh ├── zcash-wrapper ├── zcash-wrapper-clang ├── zcash-wrapper-clang++ ├── zcash-wrapper-g++ └── zcash-wrapper-gcc ├── build-debian-package.sh ├── build.sh ├── clean.sh ├── cleanup-tags.sh ├── distclean.sh ├── fetch-params.sh ├── libfuzzer ├── libfuzzer-build.sh ├── zcash-wrapper ├── zcash-wrapper-clang └── zcash-wrapper-clang++ ├── make-release.py └── release-notes.py /.cargo/config.offline: -------------------------------------------------------------------------------- 1 | [source.crates-io] 2 | replace-with = "vendored-sources" 3 | 4 | [source."https://github.com/ycashfoundation/librustzcash.git"] 5 | git = "https://github.com/ycashfoundation/librustzcash.git" 6 | rev = "cc26e791eb5cf2fb140b4cc0335b1f0d94206c2c" 7 | replace-with = "vendored-sources" 8 | 9 | [source.vendored-sources] 10 | # The directory for this source is set to RUST_VENDORED_SOURCES by src/Makefile.am 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | src/clientversion.cpp export-subst 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for zcashd. 4 | title: '' 5 | labels: 'use case' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Is your feature request related to a problem? Please describe. 11 | A clear and concise description of what the problem is. Example: I'm always 12 | frustrated when [...] 13 | 14 | ## Describe the solution you'd like 15 | A clear and concise description of what you want to happen. 16 | 17 | ## Alternatives you've considered 18 | A clear and concise description of any alternative solutions or features you've 19 | considered. 20 | 21 | ## Additional context 22 | Add any other context or screenshots about the feature request here. 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ux-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: UX report 3 | about: Was zcashd hard to use? It's not you, it's us. We want to hear about it. 4 | title: 'UX: ' 5 | labels: 'usability' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 14 | 15 | ## What were you trying to do 16 | 17 | ## What happened 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/.github/pull_request_template.md -------------------------------------------------------------------------------- /.github/workflows/book.yml: -------------------------------------------------------------------------------- 1 | name: zcashd book 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Setup mdBook 15 | uses: peaceiris/actions-mdbook@v1 16 | with: 17 | mdbook-version: '0.4.7' 18 | 19 | - name: Install mdbook-katex 20 | uses: actions-rs/cargo@v1 21 | with: 22 | command: install 23 | args: mdbook-katex 24 | 25 | - name: Build zcashd book 26 | run: mdbook build doc/book/ 27 | 28 | - name: Deploy to GitHub Pages 29 | uses: peaceiris/actions-gh-pages@v3 30 | with: 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | publish_dir: ./book/book 33 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please read [our Development Guidelines](https://zcash.readthedocs.io/en/latest/rtd_pages/development_guidelines.html). 2 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building Zcash 2 | 3 | See the Zcash documentation wiki (https://zcash.readthedocs.io/en/latest/rtd_pages/user_guide.html) for instructions on building zcashd, 4 | the intended-for-services, no-graphical-interface, reference 5 | implementation of Zcash. 6 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2016-2019 The Zcash developers 3 | # Copyright (c) 2013-2019 The Bitcoin Core developers 4 | # Copyright (c) 2013-2019 Bitcoin Developers 5 | # Distributed under the MIT software license, see the accompanying 6 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 7 | 8 | export LC_ALL=C 9 | set -e 10 | srcdir="$(dirname $0)" 11 | cd "$srcdir" 12 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="$(command -v glibtoolize)"; then 13 | LIBTOOLIZE="${GLIBTOOLIZE}" 14 | export LIBTOOLIZE 15 | fi 16 | autoreconf --install --force --warnings=all 17 | -------------------------------------------------------------------------------- /build-aux/m4/bitcoin_subdir_to_include.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (c) 2016-2019 The Zcash developers 2 | dnl Copyright (c) 2013-2019 The Bitcoin Core developers 3 | dnl Copyright (c) 2013-2019 Bitcoin Developers 4 | dnl Distributed under the MIT software license, see the accompanying 5 | dnl file COPYING or https://www.opensource.org/licenses/mit-license.php . 6 | 7 | dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE]) 8 | dnl SUBDIRECTORY-NAME must end with a path separator 9 | AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ 10 | if test "x$2" = "x"; then 11 | AC_MSG_RESULT([default]) 12 | else 13 | echo "#include <$2$3.h>" >conftest.cpp 14 | 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`] 15 | AC_MSG_RESULT([${newinclpath}]) 16 | if test "x${newinclpath}" != "x"; then 17 | eval "$1=\"\$$1\"' -I${newinclpath}'" 18 | fi 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /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/ci-builders/buildbot/Dockerfile-build-python.apt: -------------------------------------------------------------------------------- 1 | ARG FROMBASEOS 2 | ARG FROMBASEOS_BUILD_TAG 3 | FROM $FROMBASEOS:$FROMBASEOS_BUILD_TAG 4 | ARG DEBIAN_FRONTEND=noninteractive 5 | 6 | ADD apt-package-list.txt /tmp/apt-package-list.txt 7 | RUN apt-get update \ 8 | && apt-get install -y $(tr "\n" " " < /tmp/apt-package-list.txt) \ 9 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 10 | 11 | ARG PYTHONVERSION=3.7.5 12 | RUN apt-get install -y \ 13 | build-essential \ 14 | zlib1g-dev \ 15 | libncurses5-dev \ 16 | libgdbm-dev \ 17 | libnss3-dev \ 18 | libssl-dev \ 19 | libreadline-dev \ 20 | libffi-dev \ 21 | curl 22 | WORKDIR /tmp 23 | RUN curl https://www.python.org/ftp/python/$PYTHONVERSION/Python-$PYTHONVERSION.tar.xz -o python.tar.xz \ 24 | && tar -xf python.tar.xz \ 25 | && cd Python-$PYTHONVERSION \ 26 | && ./configure --enable-optimizations \ 27 | && make -j 8 \ 28 | && make altinstall \ 29 | && update-alternatives --install /usr/bin/python python /usr/local/bin/python3.7 1 30 | RUN update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.7 1 -------------------------------------------------------------------------------- /contrib/ci-builders/buildbot/Dockerfile-build.apt: -------------------------------------------------------------------------------- 1 | ARG FROMBASEOS 2 | ARG FROMBASEOS_BUILD_TAG 3 | FROM $FROMBASEOS:$FROMBASEOS_BUILD_TAG 4 | ARG DEBIAN_FRONTEND=noninteractive 5 | 6 | ADD apt-package-list.txt /tmp/apt-package-list.txt 7 | RUN apt-get update \ 8 | && apt-get install -y $(tr "\n" " " < /tmp/apt-package-list.txt) \ 9 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 10 | -------------------------------------------------------------------------------- /contrib/ci-builders/buildbot/Dockerfile-build.arch: -------------------------------------------------------------------------------- 1 | ARG ARCHLINUX_TAG 2 | FROM archlinux:$ARCHLINUX_TAG 3 | 4 | RUN pacman -Syyu --noconfirm \ 5 | && pacman -S --noconfirm \ 6 | base-devel \ 7 | git \ 8 | python3 \ 9 | python-pip \ 10 | wget 11 | 12 | RUN wget -O /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 13 | RUN chmod +x /usr/bin/dumb-init 14 | RUN python -m pip install virtualenv 15 | # AUR for libtinfo5 Source: https://dev.to/cloudx/testing-our-package-build-in-the-docker-world-34p0 16 | RUN useradd builduser -m \ 17 | && passwd -d builduser \ 18 | && cd /home/builduser \ 19 | && git clone "https://aur.archlinux.org/ncurses5-compat-libs.git" ncurses5-compat-libs \ 20 | && chown builduser -R ncurses5-compat-libs \ 21 | && (printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers) \ 22 | && sudo -u builduser bash -c 'gpg --keyserver pool.sks-keyservers.net --recv-keys 702353E0F7E48EDB' \ 23 | && sudo -u builduser bash -c 'cd ~/ncurses5-compat-libs && makepkg -si --noconfirm' -------------------------------------------------------------------------------- /contrib/ci-builders/buildbot/Dockerfile-build.centos8: -------------------------------------------------------------------------------- 1 | FROM centos:8 2 | 3 | RUN yum update -y \ 4 | && dnf group install -y "Development Tools" \ 5 | && yum install -y \ 6 | ncurses-compat-libs \ 7 | python3 \ 8 | python3-devel \ 9 | wget 10 | 11 | RUN wget -O /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 12 | RUN chmod +x /usr/bin/dumb-init 13 | RUN alternatives --set python /usr/bin/python3 \ 14 | && python3 -m pip install virtualenv 15 | -------------------------------------------------------------------------------- /contrib/ci-builders/buildbot/Dockerfile-gitian.apt: -------------------------------------------------------------------------------- 1 | ARG FROMBASEOS 2 | ARG FROMBASEOS_BUILD_TAG=latest 3 | FROM electriccoinco/zcashd-build-$FROMBASEOS$FROMBASEOS_BUILD_TAG 4 | 5 | RUN useradd -ms /bin/bash -U debian 6 | USER debian:debian 7 | WORKDIR /home/debian 8 | CMD ["sleep", "infinity"] -------------------------------------------------------------------------------- /contrib/ci-builders/buildbot/apt-package-list.txt: -------------------------------------------------------------------------------- 1 | autoconf 2 | bsdmainutils 3 | build-essential 4 | cmake 5 | curl 6 | g++-aarch64-linux-gnu 7 | git 8 | lcov 9 | libcap-dev 10 | libffi-dev 11 | libtinfo5 12 | libtool 13 | libssl-dev 14 | libz-dev 15 | libbz2-dev 16 | mingw-w64 17 | pkg-config 18 | python3 19 | python3-dev 20 | python3-venv 21 | valgrind 22 | wget 23 | zstd 24 | -------------------------------------------------------------------------------- /contrib/ci-builders/buildbot/bbworker-requirements.txt: -------------------------------------------------------------------------------- 1 | buildbot-worker 2 | pyblake2 3 | pyflakes 4 | pyutil 5 | pyzmq 6 | requests 7 | simplejson 8 | twisted[tls] 9 | wheel 10 | -------------------------------------------------------------------------------- /contrib/ci-builders/tekton/Dockerfile-build.apt: -------------------------------------------------------------------------------- 1 | ARG FROMBASEOS 2 | ARG FROMBASEOS_BUILD_TAG 3 | FROM $FROMBASEOS:$FROMBASEOS_BUILD_TAG 4 | ARG DEBIAN_FRONTEND=noninteractive 5 | 6 | ADD apt-package-list.txt /tmp/apt-package-list.txt 7 | RUN apt-get update \ 8 | && apt-get install -y $(tr "\n" " " < /tmp/apt-package-list.txt) \ 9 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 10 | -------------------------------------------------------------------------------- /contrib/ci-builders/tekton/Dockerfile-build.arch: -------------------------------------------------------------------------------- 1 | ARG FROMBASEOS 2 | ARG FROMBASEOS_BUILD_TAG 3 | FROM $FROMBASEOS:$FROMBASEOS_BUILD_TAG 4 | 5 | RUN pacman -Syyu --noconfirm \ 6 | && pacman -S --noconfirm \ 7 | base-devel \ 8 | git \ 9 | python3 \ 10 | python-pip \ 11 | ncurses \ 12 | wget 13 | 14 | RUN sudo link /lib/libtinfo.so.6 /lib/libtinfo.so.5 15 | -------------------------------------------------------------------------------- /contrib/ci-builders/tekton/Dockerfile-build.centos8: -------------------------------------------------------------------------------- 1 | FROM centos:8 2 | 3 | RUN yum update -y \ 4 | && dnf group install -y "Development Tools" \ 5 | && yum install -y \ 6 | ncurses-compat-libs \ 7 | python3 \ 8 | python3-devel \ 9 | wget 10 | 11 | RUN wget -O /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 12 | RUN chmod +x /usr/bin/dumb-init 13 | RUN alternatives --set python /usr/bin/python3 \ 14 | && python3 -m pip install virtualenv 15 | -------------------------------------------------------------------------------- /contrib/ci-builders/tekton/Dockerfile-tekton-worker: -------------------------------------------------------------------------------- 1 | ARG FROMBASEOS 2 | ARG FROMBASEOS_BUILD_TAG 3 | FROM electriccoinco/zcashd-build-$FROMBASEOS$FROMBASEOS_BUILD_TAG 4 | 5 | ADD requirements.txt requirements.txt 6 | RUN python -m venv venv \ 7 | && . venv/bin/activate \ 8 | && pip install --upgrade pip \ 9 | && python -m pip install -r requirements.txt 10 | 11 | ADD ./zcash-params /home/.zcash-params 12 | -------------------------------------------------------------------------------- /contrib/ci-builders/tekton/apt-package-tekton-list.txt: -------------------------------------------------------------------------------- 1 | autoconf 2 | bsdmainutils 3 | build-essential 4 | cmake 5 | curl 6 | g++-aarch64-linux-gnu 7 | git 8 | lcov 9 | libcap-dev 10 | libffi-dev 11 | libtinfo5 12 | libtool 13 | libssl-dev 14 | libz-dev 15 | libbz2-dev 16 | mingw-w64 17 | pkg-config 18 | python3 19 | python3-pip 20 | python3-dev 21 | python3-venv 22 | valgrind 23 | wget 24 | zstd 25 | -------------------------------------------------------------------------------- /contrib/ci-builders/tekton/requirements.txt: -------------------------------------------------------------------------------- 1 | wheel 2 | pyblake2 3 | pyflakes 4 | pyutil 5 | pyzmq 6 | requests 7 | simplejson 8 | twisted[tls] 9 | -------------------------------------------------------------------------------- /contrib/ci-workers/ansible.cfg: -------------------------------------------------------------------------------- 1 | [ssh_connection] 2 | pipelining = True 3 | -------------------------------------------------------------------------------- /contrib/ci-workers/files/bashrc: -------------------------------------------------------------------------------- 1 | export PATH=$HOME/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 2 | export EDITOR=vim 3 | -------------------------------------------------------------------------------- /contrib/ci-workers/grind.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configure a Buildbot worker 3 | - include: unix.yml 4 | 5 | - name: Install grind-specific worker dependencies 6 | hosts: zcash-ci-worker-unix 7 | become: true 8 | 9 | vars_files: 10 | - vars/default.yml 11 | 12 | tasks: 13 | - name: Get dependencies for distribution 14 | include_vars: "{{ item }}" 15 | with_first_found: 16 | - files: 17 | - "vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml" 18 | - "vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version | int }}.yml" 19 | - "vars/{{ ansible_distribution }}.yml" 20 | - "vars/{{ ansible_os_family }}.yml" 21 | skip: true 22 | 23 | - name: Install required packages 24 | package: 25 | name: "{{ item }}" 26 | state: present 27 | with_items: "{{ grind_deps }}" 28 | -------------------------------------------------------------------------------- /contrib/ci-workers/tasks/install-brew.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if brew is installed 3 | stat: 4 | path: /usr/local/bin/brew 5 | register: brew_check 6 | 7 | - name: Fail if brew is unavailable 8 | fail: 9 | msg: 'brew is not installed! Please install Homebrew: https://docs.brew.sh/Installation.html' 10 | when: not brew_check.stat.exists 11 | -------------------------------------------------------------------------------- /contrib/ci-workers/tasks/install-pip.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Fetch pip installer 3 | get_url: 4 | url: https://bootstrap.pypa.io/get-pip.py 5 | dest: /tmp/get-pip.py 6 | 7 | - name: Install pip 8 | command: "{{ ansible_python.executable }} /tmp/get-pip.py" 9 | -------------------------------------------------------------------------------- /contrib/ci-workers/templates/buildbot-worker.plist.j2: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | net.buildbot.worker 7 | ProgramArguments 8 | 9 | {{ buildbot_worker_dir }}/venv/bin/buildbot-worker 10 | start 11 | {{ buildbot_worker_name }} 12 | 13 | WorkingDirectory 14 | {{ buildbot_worker_dir }} 15 | UserName 16 | {{ buildbot_worker_user }} 17 | KeepAlive 18 | 19 | NetworkState 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /contrib/ci-workers/templates/buildbot-worker.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Buildbot worker 3 | Wants=network.target 4 | After=network.target 5 | 6 | [Service] 7 | Type=forking 8 | PIDFile={{ buildbot_worker_dir }}/{{ buildbot_worker_name }}/twistd.pid 9 | WorkingDirectory={{ buildbot_worker_dir }} 10 | ExecStart={{ buildbot_worker_dir }}/venv/bin/buildbot-worker start {{ buildbot_worker_name }} 11 | ExecReload={{ buildbot_worker_dir }}/venv/bin/buildbot-worker restart {{ buildbot_worker_name }} 12 | ExecStop={{ buildbot_worker_dir }}/venv/bin/buildbot-worker stop {{ buildbot_worker_name }} 13 | Restart=always 14 | User={{ buildbot_worker_user }} 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /contrib/ci-workers/templates/host.ec2.j2: -------------------------------------------------------------------------------- 1 | OS: {{ ansible_distribution }} {{ ansible_distribution_version }} 2 | -------------------------------------------------------------------------------- /contrib/ci-workers/templates/host.j2: -------------------------------------------------------------------------------- 1 | OS: {{ ansible_distribution }} {{ ansible_distribution_version }} 2 | Memory: {{ ansible_memtotal_mb }} MB 3 | CPU: {{ ansible_processor if ansible_processor is string else ansible_processor[1] }} ({{ ansible_processor_cores }} cores) 4 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/Archlinux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | buildbot_deps: 3 | - python2-pip 4 | build_deps: 5 | - cmake 6 | - multilib/gcc 7 | - make 8 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | buildbot_deps: [] # Empty to remove python-pip 3 | build_deps: 4 | - bzip2 5 | - cmake 6 | - gcc 7 | - gcc-c++ 8 | - make 9 | - patch 10 | dist_deps: 11 | - pkgconfig # Required until b556beda264308e040f8d88aca4f2f386a0183d9 is pulled in 12 | - python-devel 13 | - redhat-rpm-config 14 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/Debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | build_deps: 3 | - build-essential # Depends on g++, libc6-dev, make 4 | - cmake 5 | dist_deps: 6 | - python-dev 7 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/Fedora.yml: -------------------------------------------------------------------------------- 1 | --- 2 | build_deps: 3 | - cmake 4 | - gcc 5 | - gcc-c++ 6 | - make 7 | - patch 8 | dist_deps: 9 | - pkgconfig # Required until b556beda264308e040f8d88aca4f2f386a0183d9 is pulled in 10 | - python-devel 11 | - redhat-rpm-config 12 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/FreeBSD.yml: -------------------------------------------------------------------------------- 1 | --- 2 | buildbot_deps: 3 | - py27-pip 4 | build_deps: 5 | - cmake 6 | - gcc 7 | - gmake 8 | dist_deps: 9 | - bash 10 | - pkgconf # Required until b556beda264308e040f8d88aca4f2f386a0183d9 is pulled in 11 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/MacOSX.yml: -------------------------------------------------------------------------------- 1 | --- 2 | buildbot_deps: 3 | - coreutils # For gnproc etc. 4 | # Most are already installed 5 | build_deps: 6 | - cmake 7 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | build_deps: 3 | - build-essential # Depends on g++, libc6-dev, make 4 | - cmake 5 | -------------------------------------------------------------------------------- /contrib/ci-workers/vars/buildbot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | buildbot_worker_user: zcbbworker 3 | buildbot_master_host: dev-ci.z.cash 4 | buildbot_master_port: 9899 5 | buildbot_worker_host_template: templates/host.j2 6 | -------------------------------------------------------------------------------- /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /contrib/debian/control: -------------------------------------------------------------------------------- 1 | Source: zcash 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Electric Coin 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: zcash 14 | Architecture: amd64 15 | Depends: ${shlibs:Depends} 16 | Description: Zcash libraries and tools 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 | Think of it as HTTPS for money. 21 | This package provides the daemon, zcashd, and the CLI tool, 22 | zcash-cli, to interact with the daemon. 23 | -------------------------------------------------------------------------------- /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/ycash.conf 2 | -------------------------------------------------------------------------------- /contrib/debian/zcash.install: -------------------------------------------------------------------------------- 1 | usr/bin/zcashd 2 | usr/bin/zcash-cli 3 | usr/bin/zcash-fetch-params 4 | -------------------------------------------------------------------------------- /contrib/debian/zcash.manpages: -------------------------------------------------------------------------------- 1 | DEBIAN/manpages/zcash-cli.1 2 | DEBIAN/manpages/zcashd.1 3 | -------------------------------------------------------------------------------- /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/docker/.dockerignore: -------------------------------------------------------------------------------- 1 | ./zcash-data-dir/ 2 | ./zcash-params-dir/ 3 | -------------------------------------------------------------------------------- /contrib/docker/.env.example: -------------------------------------------------------------------------------- 1 | ZCASHD_NETWORK=testnet 2 | ZCASHD_LOGIPS=1 3 | ZCASHD_EXPERIMENTALFEATURES=1 4 | ZCASHD_GEN=0 5 | ZCASHD_RPCUSER=zcashrpc 6 | ZCASHD_RPCPASSWORD=notsecure 7 | ZCASHD_RPCBIND=0.0.0.0 8 | ZCASHD_ALLOWIP=0.0.0.0/0 9 | ZCASHD_TXINDEX=1 10 | ZCASHD_INSIGHTEXPLORER=1 11 | ZCASHD_ZMQPORT=9994 12 | ZCASHD_ZMQBIND=0.0.0.0 13 | -------------------------------------------------------------------------------- /contrib/docker/.gitignore: -------------------------------------------------------------------------------- 1 | ./zcash-data-dir/ 2 | ./zcash-params-dir/ 3 | .env 4 | -------------------------------------------------------------------------------- /contrib/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3' 3 | 4 | services: 5 | zcashd: 6 | build: . 7 | env_file: 8 | - .env 9 | volumes: 10 | - ./zcash-params-dir:/srv/zcashd/.zcash-params 11 | - ./zcash-data-dir:/srv/zcashd/.zcash 12 | -------------------------------------------------------------------------------- /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=8832 7 | #port=18832 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/metrics/prometheus.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'zcashd' 3 | scrape_interval: 500ms 4 | metrics_path: '/' 5 | static_configs: 6 | - targets: ['127.0.0.1:9969'] 7 | -------------------------------------------------------------------------------- /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 8833, 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)). -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /depends/.gitignore: -------------------------------------------------------------------------------- 1 | SDKs/ 2 | work/ 3 | built/ 4 | sources/ 5 | config.site 6 | x86_64* 7 | i686* 8 | mips* 9 | arm* 10 | aarch64* 11 | -------------------------------------------------------------------------------- /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/freebsd.mk: -------------------------------------------------------------------------------- 1 | build_freebsd_SHA256SUM = shasum -a 256 2 | build_freebsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o 3 | -------------------------------------------------------------------------------- /depends/builders/linux.mk: -------------------------------------------------------------------------------- 1 | build_linux_SHA256SUM = sha256sum 2 | build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o 3 | -------------------------------------------------------------------------------- /depends/hosts/freebsd.mk: -------------------------------------------------------------------------------- 1 | freebsd_CFLAGS=-pipe 2 | freebsd_CXXFLAGS=$(freebsd_CFLAGS) 3 | 4 | freebsd_release_CFLAGS=-O3 5 | freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS) 6 | 7 | freebsd_debug_CFLAGS=-O0 8 | freebsd_debug_CXXFLAGS=$(freebsd_debug_CFLAGS) 9 | 10 | freebsd_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 11 | 12 | # Changes below have not been tested. If you try to build on FreeBSD, 13 | # please let us know how it goes. 14 | 15 | ifneq ($(YCASH_TOOLCHAIN), GCC) 16 | freebsd_LDFLAGS?=-fuse-ld=lld 17 | endif 18 | 19 | i686_freebsd_CC=$(default_host_CC) -m32 20 | i686_freebsd_CXX=$(default_host_CXX) -m32 21 | x86_64_freebsd_CC=$(default_host_CC) -m64 22 | x86_64_freebsd_CXX=$(default_host_CXX) -m64 23 | -------------------------------------------------------------------------------- /depends/hosts/mingw32.mk: -------------------------------------------------------------------------------- 1 | mingw32_CFLAGS=-pipe 2 | mingw32_CXXFLAGS=$(mingw32_CFLAGS) 3 | 4 | ifneq ($(YCASH_TOOLCHAIN), GCC) 5 | mingw32_CXXFLAGS += -isystem $(host_prefix)/include/c++/v1 6 | mingw32_LDFLAGS?=-fuse-ld=lld 7 | else 8 | mingw32_CC = $(host_toolchain)gcc-posix 9 | mingw32_CXX = $(host_toolchain)g++-posix 10 | endif 11 | 12 | mingw32_release_CFLAGS=-O3 13 | mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) 14 | 15 | mingw32_debug_CFLAGS=-O0 16 | mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) 17 | 18 | mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 19 | -------------------------------------------------------------------------------- /depends/packages/libsodium.mk: -------------------------------------------------------------------------------- 1 | package=libsodium 2 | $(package)_version=1.0.18 3 | $(package)_download_path=https://download.libsodium.org/libsodium/releases/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1 6 | $(package)_dependencies= 7 | $(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff 8 | $(package)_config_opts= 9 | 10 | define $(package)_preprocess_cmds 11 | patch -p1 < $($(package)_patch_dir)/1.0.15-pubkey-validation.diff && \ 12 | patch -p1 < $($(package)_patch_dir)/1.0.15-signature-validation.diff && \ 13 | cd $($(package)_build_subdir); DO_NOT_UPDATE_CONFIG_SCRIPTS=1 ./autogen.sh 14 | endef 15 | 16 | define $(package)_config_cmds 17 | $($(package)_autoconf) --enable-static --disable-shared 18 | endef 19 | 20 | define $(package)_build_cmds 21 | $(MAKE) 22 | endef 23 | 24 | define $(package)_stage_cmds 25 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 26 | endef 27 | -------------------------------------------------------------------------------- /depends/packages/native_b2.mk: -------------------------------------------------------------------------------- 1 | package=native_b2 2 | $(package)_version=$(boost_version) 3 | $(package)_download_path=$(boost_download_path) 4 | $(package)_file_name=$(boost_file_name) 5 | $(package)_sha256_hash=$(boost_sha256_hash) 6 | $(package)_build_subdir=tools/build/src/engine 7 | 8 | ifneq ($(YCASH_TOOLCHAIN), GCC) 9 | ifneq ($(host_os),darwin) 10 | $(package)_dependencies=native_clang 11 | endif 12 | $(package)_toolset_$(host_os)=clang 13 | else 14 | $(package)_toolset_$(host_os)=gcc 15 | endif 16 | 17 | define $(package)_build_cmds 18 | CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" ./build.sh "$($(package)_toolset_$(host_os))" 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | mkdir -p "$($(package)_staging_prefix_dir)"/bin/ && \ 23 | cp b2 "$($(package)_staging_prefix_dir)"/bin/ 24 | endef 25 | -------------------------------------------------------------------------------- /depends/packages/native_ccache.mk: -------------------------------------------------------------------------------- 1 | package=native_ccache 2 | $(package)_version=3.7.12 3 | $(package)_download_path=https://github.com/ccache/ccache/releases/download/v$($(package)_version) 4 | $(package)_file_name=ccache-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=d2abe88d4c283ce960e233583061127b156ffb027c6da3cf10770fc0c7244194 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/native_libtinfo5.mk: -------------------------------------------------------------------------------- 1 | package=native_libtinfo5 2 | $(package)_version=6.2 3 | 4 | # We only enable this if build_os is linux. 5 | $(package)_download_path=http://ftp.debian.org/debian/pool/main/n/ncurses/ 6 | $(package)_download_file=libtinfo5_$($(package)_version)+20201114-2+deb11u2_amd64.deb 7 | $(package)_file_name=libtinfo5-$($(package)_version).deb 8 | $(package)_sha256_hash=69e131ce3f790a892ca1b0ae3bfad8659daa2051495397eee1b627d9783a6797 9 | 10 | define $(package)_extract_cmds 11 | mkdir -p $($(package)_extract_dir) && \ 12 | echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 13 | $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ 14 | mkdir -p libtinfo5 && \ 15 | cd libtinfo5 && \ 16 | ar x $($(package)_source_dir)/$($(package)_file_name) && \ 17 | tar xf data.tar.xz 18 | endef 19 | 20 | define $(package)_stage_cmds 21 | pwd && \ 22 | mkdir -p $($(package)_staging_prefix_dir)/lib && \ 23 | cp libtinfo5/lib/x86_64-linux-gnu/libtinfo.so.5.9 $($(package)_staging_prefix_dir)/lib/libtinfo.so.5 24 | endef 25 | -------------------------------------------------------------------------------- /depends/packages/packages.mk: -------------------------------------------------------------------------------- 1 | zcash_packages := libsodium utfcpp 2 | packages := boost libevent zeromq $(zcash_packages) googletest 3 | ifneq ($(YCASH_TOOLCHAIN), GCC) 4 | native_packages := native_clang native_ccache native_rust 5 | else 6 | native_packages := native_ccache native_rust 7 | endif 8 | 9 | ifeq ($(build_os),linux) 10 | native_packages += native_libtinfo5 11 | endif 12 | 13 | wallet_packages=bdb 14 | 15 | $(host_arch)_$(host_os)_native_packages += native_b2 16 | 17 | ifneq ($(build_os),darwin) 18 | darwin_native_packages=native_cctools 19 | endif 20 | 21 | ifneq ($(YCASH_TOOLCHAIN), GCC) 22 | # We use a complete SDK for Darwin, which includes libc++. 23 | ifneq ($(host_os),darwin) 24 | packages += libcxx 25 | endif 26 | endif 27 | -------------------------------------------------------------------------------- /depends/packages/utfcpp.mk: -------------------------------------------------------------------------------- 1 | package=utfcpp 2 | $(package)_version=3.2.1 3 | $(package)_download_path=https://github.com/nemtrif/$(package)/archive/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_download_file=v$($(package)_version).tar.gz 6 | $(package)_sha256_hash=8d6aa7d77ad0abb35bb6139cb9a33597ac4c5b33da6a004ae42429b8598c9605 7 | 8 | define $(package)_stage_cmds 9 | cp -a ./source $($(package)_staging_dir)$(host_prefix)/include 10 | endef 11 | -------------------------------------------------------------------------------- /depends/patches/libevent/0001-fix-windows-getaddrinfo.patch: -------------------------------------------------------------------------------- 1 | diff -ur libevent-2.1.8-stable.orig/configure.ac libevent-2.1.8-stable/configure.ac 2 | --- libevent-2.1.8-stable.orig/configure.ac 2017-01-29 17:51:00.000000000 +0000 3 | +++ libevent-2.1.8-stable/configure.ac 2020-03-07 01:11:16.311335005 +0000 4 | @@ -389,6 +389,10 @@ 5 | #ifdef HAVE_NETDB_H 6 | #include 7 | #endif 8 | +#ifdef _WIN32 9 | +#include 10 | +#include 11 | +#endif 12 | ]], 13 | [[ 14 | getaddrinfo; 15 | Only in libevent-2.1.8-stable: configure.ac~ 16 | -------------------------------------------------------------------------------- /depends/patches/libsodium/1.0.15-pubkey-validation.diff: -------------------------------------------------------------------------------- 1 | diff -ur libsodium-1.0.18-orig/src/libsodium/crypto_sign/ed25519/ref10/open.c libsodium-1.0.18/src/libsodium/crypto_sign/ed25519/ref10/open.c 2 | --- libsodium-1.0.18-orig/src/libsodium/crypto_sign/ed25519/ref10/open.c 2019-05-18 16:32:11.000000000 -0400 3 | +++ libsodium-1.0.18/src/libsodium/crypto_sign/ed25519/ref10/open.c 2020-01-21 18:55:22.474233831 -0500 4 | @@ -32,8 +32,11 @@ 5 | ge25519_has_small_order(sig) != 0) { 6 | return -1; 7 | } 8 | - if (ge25519_is_canonical(pk) == 0 || 9 | - ge25519_has_small_order(pk) != 0) { 10 | + unsigned char d = 0; 11 | + for (int i = 0; i < 32; ++i) { 12 | + d |= pk[i]; 13 | + } 14 | + if (d == 0) { 15 | return -1; 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /depends/patches/zeromq/stats_proxy-missing-braces.diff: -------------------------------------------------------------------------------- 1 | diff -ur zeromq-4.3.5-orig/src/proxy.cpp zeromq-4.3.5/src/proxy.cpp 2 | --- zeromq-4.3.5-orig/src/proxy.cpp 2023-10-09 09:37:00.000000000 +0000 3 | +++ zeromq-4.3.5/src/proxy.cpp 2023-12-18 21:24:25.551814814 +0000 4 | @@ -499,7 +499,7 @@ 5 | zmq_pollitem_t itemsout[] = {{frontend_, 0, ZMQ_POLLOUT, 0}, 6 | {backend_, 0, ZMQ_POLLOUT, 0}}; 7 | 8 | - stats_proxy stats = {0}; 9 | + stats_proxy stats = {{{0}}}; 10 | 11 | // Proxy can be in these three states 12 | proxy_state_t state = active; 13 | Only in zeromq-4.3.5/src: .proxy.cpp.swp 14 | -------------------------------------------------------------------------------- /doc/bips.md: -------------------------------------------------------------------------------- 1 | BIPs that are implemented by Zcash (up-to-date up to **v1.1.0**): 2 | 3 | * Numerous historic BIPs were present in **v1.0.0** at launch; see [the protocol spec](https://github.com/zcash/zips/blob/master/protocol/protocol.pdf) for details. 4 | * [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, but only enforced for peer versions `>=170004` as of **v1.1.0** ([PR #2814](https://github.com/zcash/zcash/pull/2814)). 5 | -------------------------------------------------------------------------------- /doc/book/.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | -------------------------------------------------------------------------------- /doc/book/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["Jack Grigg"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "The zcashd Book" 7 | -------------------------------------------------------------------------------- /doc/book/src/README.md: -------------------------------------------------------------------------------- 1 | {{#include ../../../README.md}} 2 | -------------------------------------------------------------------------------- /doc/book/src/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # The zcashd Book 2 | 3 | [zcashd](README.md) 4 | - [User Documentation](user.md) 5 | - [Metrics](user/metrics.md) 6 | - [Design](design.md) 7 | - [Chain state](design/chain-state.md) 8 | - ["Coins" view](design/coins-view.md) 9 | -------------------------------------------------------------------------------- /doc/book/src/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | Zcash was originally a fork of Bitcoin 0.11.2, and as such the `zcashd` node architecture 4 | is very similar to `bitcoind`. There are however several differences, most notably the 5 | addition of shielded pools to the consensus logic and full node state. 6 | 7 | In this section of the book, we describe the overall architecture that we inherit from 8 | `bitcoind`, the changes we have made to the inherited components, and the new components 9 | we have introduced. 10 | -------------------------------------------------------------------------------- /doc/book/src/design/chain-state.md: -------------------------------------------------------------------------------- 1 | # Chain state 2 | 3 | TBD 4 | -------------------------------------------------------------------------------- /doc/book/src/design/coins-view.md: -------------------------------------------------------------------------------- 1 | # "Coins" view 2 | 3 | TBD 4 | -------------------------------------------------------------------------------- /doc/book/src/doc/imgs/logo.png: -------------------------------------------------------------------------------- 1 | ../../../../imgs/logo.png -------------------------------------------------------------------------------- /doc/book/src/doc/imgs/zcashd_screen.gif: -------------------------------------------------------------------------------- 1 | ../../../../imgs/zcashd_screen.gif -------------------------------------------------------------------------------- /doc/book/src/user.md: -------------------------------------------------------------------------------- 1 | # User Documentation 2 | 3 | This section contains user documentation specific to `zcashd`. 4 | 5 | See [here](https://zcash.readthedocs.io/) for more general Zcash documentation, as well as 6 | installation instructions for `zcashd`. 7 | -------------------------------------------------------------------------------- /doc/dnsseed-policy.md: -------------------------------------------------------------------------------- 1 | Expectations for DNS Seed operators 2 | ==================================== 3 | 4 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/dnsseed_policy.html 5 | 6 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/dnsseed_policy.rst -------------------------------------------------------------------------------- /doc/files.md: -------------------------------------------------------------------------------- 1 | # Data Directory Files 2 | 3 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/files.html 4 | 5 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/files.rst 6 | -------------------------------------------------------------------------------- /doc/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/doc/imgs/logo.png -------------------------------------------------------------------------------- /doc/imgs/zcashd_screen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/doc/imgs/zcashd_screen.gif -------------------------------------------------------------------------------- /doc/imgs/zcashd_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/doc/imgs/zcashd_screenshot.png -------------------------------------------------------------------------------- /doc/man/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man1_MANS=zcashd.1 zcash-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/payment-api.md: -------------------------------------------------------------------------------- 1 | # Zcash Payment API 2 | 3 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/payment_api.html 4 | 5 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/payment_api.rst -------------------------------------------------------------------------------- /doc/reducing-memory-usage.md: -------------------------------------------------------------------------------- 1 | In-memory caches 2 | ---------------- 3 | 4 | The size of some in-memory caches can be reduced. As caches trade off memory usage for performance, usually reducing these have a negative effect on performance. 5 | 6 | - `-dbcache=` - the UTXO database cache size, this defaults to `450` (`100` before 1.0.15). The unit is MiB (where 1 GiB = 1024 MiB). 7 | - The minimum value for `-dbcache` is 4. 8 | - A lower dbcache make initial sync time much longer. After the initial sync, the effect is less pronounced for most use-cases, unless fast validation of blocks is important such as for mining. 9 | -------------------------------------------------------------------------------- /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/release-notes/release-notes-2.0.7-2.md: -------------------------------------------------------------------------------- 1 | Notable changes 2 | =============== 3 | 4 | 5 | Pre-Blossom EOS Halt 6 | -------------------- 7 | v2.0.7-2 contains a shortened EOS halt so that is in alignment with v2.0.7. 8 | 9 | 10 | Testnet Blossom Rewind 11 | ---------------------- 12 | Testnet users needed to upgrade to 2.0.7 before Blossom activated. The amount 13 | of notice given to these users was brief, so many were not able to upgrade in 14 | time. These users may now be on the wrong branch. v2.0.7-2 adds an "intended 15 | rewind" to prevent having to manually reindex when reconnecting to the correct 16 | chain. 17 | 18 | 19 | Insight Explorer Logging Fix 20 | ---------------------------- 21 | Fixed an issue where `ERROR: spent index not enabled` would be logged unnecessarily. 22 | 23 | Changelog 24 | ========= 25 | 26 | Eirik Ogilvie-Wigley (3): 27 | Notable changes for v2.0.7-2 28 | make-release.py: Versioning changes for 2.0.7-2. 29 | make-release.py: Updated manpages for 2.0.7-2. 30 | 31 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-2.1.0-1.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | Jack Grigg (2): 5 | make-release.py: Versioning changes for 2.1.0-1. 6 | make-release.py: Updated manpages for 2.1.0-1. 7 | 8 | Sean Bowe (1): 9 | Fix of CVE-2017-18350 10 | 11 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-2.1.2-1.md: -------------------------------------------------------------------------------- 1 | Notable changes 2 | =============== 3 | 4 | This release solves an issue where nodes that did not follow the Heartwood activation on testnet (by running a version prior to v2.1.2) but then upgraded to v2.1.2 or later would be incapable of rolling back and following the Heartwood activation without performing a reindex operation. 5 | 6 | Changelog 7 | ========= 8 | 9 | Jack Grigg (1): 10 | txdb/chain: Restrict Heartwood chain consistency check to block index objects that were created by Heartwood-unaware clients. 11 | 12 | Sean Bowe (4): 13 | Add the intended testnet activation block of Heartwood to our intended rewind logic. 14 | Don't throw exception in PopHistoryNode when popping from empty tree. 15 | make-release.py: Versioning changes for 2.1.2-1. 16 | make-release.py: Updated manpages for 2.1.2-1. 17 | 18 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-2.1.2-2.md: -------------------------------------------------------------------------------- 1 | Notable changes 2 | =============== 3 | 4 | This release fixes an issue that was identified by the Heartwood activation on testnet. v2.1.2 nodes that followed the Heartwood activation on testnet would crash on restart if, prior to shutdown, they had received a block from a miner that had not activated Heartwood, which is very likely. This release fixes that crash. 5 | 6 | Changelog 7 | ========= 8 | 9 | Daira Hopwood (1): 10 | txdb: log additional debug information. 11 | 12 | Jack Grigg (1): 13 | txdb: More complete fix for the Heartwood chain consistency check issue. 14 | 15 | Sean Bowe (2): 16 | make-release.py: Versioning changes for 2.1.2-2. 17 | make-release.py: Updated manpages for 2.1.2-2. 18 | 19 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-2.1.2-3.md: -------------------------------------------------------------------------------- 1 | Notable changes 2 | =============== 3 | 4 | This release sets the EOS halt date to roughly July 14th, which was our original intention. 5 | 6 | Changelog 7 | ========= 8 | 9 | Sean Bowe (2): 10 | make-release.py: Versioning changes for 2.1.2-3. 11 | make-release.py: Updated manpages for 2.1.2-3. 12 | 13 | -------------------------------------------------------------------------------- /doc/security-warnings.md: -------------------------------------------------------------------------------- 1 | Security Warnings 2 | ==================== 3 | 4 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/security_warnings.html 5 | 6 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/security_warnings.rst -------------------------------------------------------------------------------- /doc/shield-coinbase.md: -------------------------------------------------------------------------------- 1 | # Shielding Coinbase UTXOs 2 | 3 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/shield_coinbase.html 4 | 5 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/shield_coinbase.rst -------------------------------------------------------------------------------- /doc/tor.md: -------------------------------------------------------------------------------- 1 | TOR SUPPORT IN ZCASH 2 | ==================== 3 | 4 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/tor.html 5 | 6 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/tor.rst -------------------------------------------------------------------------------- /doc/unit-tests.md: -------------------------------------------------------------------------------- 1 | Compiling/running automated tests 2 | --------------------------------- 3 | 4 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/development_guidelines.html#testing 5 | 6 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/development_guidelines.rst 7 | -------------------------------------------------------------------------------- /doc/wallet-backup.md: -------------------------------------------------------------------------------- 1 | # Wallet Backup Instructions 2 | 3 | This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_backup.html 4 | 5 | The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/wallet_backup.rst -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL Description="Ycash Build Env" 3 | 4 | # Dependencies of the Qt offline installer 5 | RUN apt-get -y update && apt-get install -y \ 6 | g++ build-essential cmake wget git \ 7 | autoconf automake autopoint gperf libtool libtool-bin intltool unzip pkg-config bsdmainutils curl 8 | 9 | -------------------------------------------------------------------------------- /libzcash_script.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Zcash transparent script verification library 7 | Description: Library for verifying scripts against the Zcash consensus protocol. 8 | Version: @PACKAGE_VERSION@ 9 | Libs: -L${libdir} -lzcash_script 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /mkreleaselinux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Building Linux" 4 | make clean >/dev/null 5 | ./zcutil/build.sh --disable-tests -j8 >/dev/null 6 | strip src/ycashd 7 | strip src/ycash-cli 8 | cp src/ycashd ../ycash/artifacts/ 9 | cp src/ycash-cli ../ycash/artifacts/ 10 | 11 | -------------------------------------------------------------------------------- /mkwinrelease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Building Windows" 4 | make clean > /dev/null 5 | HOST=x86_64-w64-mingw32 ./zcutil/build.sh --disable-tests -j8 >/dev/null 6 | strip src/ycashd.exe 7 | strip src/ycash-cli.exe 8 | cp src/ycashd.exe ../ycash/artifacts/ 9 | cp src/ycash-cli.exe ../ycash/artifacts/ 10 | 11 | -------------------------------------------------------------------------------- /qa/pull-tester/tests_config.ini.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013-2016 The Bitcoin Core developers 2 | # Distributed under the MIT software license, see the accompanying 3 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | # These environment variables are set by the build process and read by 6 | # rpc-tests.py 7 | 8 | [environment] 9 | SRCDIR=@abs_top_srcdir@ 10 | BUILDDIR=@abs_top_builddir@ 11 | EXEEXT=@EXEEXT@ 12 | 13 | [components] 14 | # Which components are enabled. These are commented out by `configure` if they were disabled when running config. 15 | @ENABLE_WALLET_TRUE@ENABLE_WALLET=true 16 | @BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=true 17 | @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true 18 | @ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true 19 | -------------------------------------------------------------------------------- /qa/rpc-tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | cache 3 | -------------------------------------------------------------------------------- /qa/rpc-tests/create_cache.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) 2016 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 5 | 6 | # 7 | # Helper script to create the cache 8 | # (see BitcoinTestFramework.setup_chain) 9 | # 10 | 11 | from test_framework.test_framework import BitcoinTestFramework 12 | 13 | class CreateCache(BitcoinTestFramework): 14 | 15 | def __init__(self): 16 | super().__init__() 17 | 18 | # Test network and test nodes are not required: 19 | self.num_nodes = 0 20 | self.nodes = [] 21 | 22 | def setup_network(self): 23 | pass 24 | 25 | def run_test(self): 26 | pass 27 | 28 | if __name__ == '__main__': 29 | CreateCache().main() 30 | -------------------------------------------------------------------------------- /qa/rpc-tests/golden/blossom.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/qa/rpc-tests/golden/blossom.tar.gz -------------------------------------------------------------------------------- /qa/rpc-tests/golden/heartwood.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/qa/rpc-tests/golden/heartwood.tar.gz -------------------------------------------------------------------------------- /qa/rpc-tests/mergetoaddress_sapling.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) 2018 The Zcash developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 5 | 6 | from test_framework.test_framework import BitcoinTestFramework 7 | from mergetoaddress_helper import MergeToAddressHelper 8 | 9 | 10 | class MergeToAddressSapling (BitcoinTestFramework): 11 | # 13505 would be the maximum number of utxos based on the transaction size limits for Sapling 12 | # but testing this causes the test to take an indeterminately long time to run. 13 | helper = MergeToAddressHelper('sapling', 'ANY_SAPLING', 800, 800, 0) 14 | 15 | def setup_chain(self): 16 | self.helper.setup_chain(self) 17 | 18 | def setup_network(self, split=False): 19 | self.helper.setup_network(self) 20 | 21 | def run_test(self): 22 | self.helper.run_test(self) 23 | 24 | 25 | if __name__ == '__main__': 26 | MergeToAddressSapling().main() 27 | -------------------------------------------------------------------------------- /qa/rpc-tests/mergetoaddress_sprout.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) 2018 The Zcash developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 5 | 6 | from test_framework.test_framework import BitcoinTestFramework 7 | from mergetoaddress_helper import MergeToAddressHelper 8 | 9 | 10 | class MergeToAddressSprout (BitcoinTestFramework): 11 | # 13505 would be the maximum number of utxos based on the transaction size limits for Sapling 12 | # but testing this causes the test to take an indeterminately long time to run. 13 | helper = MergeToAddressHelper('sprout', 'ANY_SPROUT', 800, 800, 0) 14 | 15 | def setup_chain(self): 16 | self.helper.setup_chain(self) 17 | 18 | def setup_network(self, split=False): 19 | self.helper.setup_network(self) 20 | 21 | def run_test(self): 22 | self.helper.run_test(self) 23 | 24 | 25 | if __name__ == '__main__': 26 | MergeToAddressSprout().main() 27 | -------------------------------------------------------------------------------- /qa/rpc-tests/regtest_signrawtransaction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) 2018 The Zcash developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 5 | 6 | from test_framework.test_framework import BitcoinTestFramework 7 | from test_framework.util import wait_and_assert_operationid_status 8 | 9 | class RegtestSignrawtransactionTest (BitcoinTestFramework): 10 | 11 | def run_test(self): 12 | self.nodes[0].generate(1) 13 | self.sync_all() 14 | taddr = self.nodes[1].getnewaddress() 15 | zaddr1 = self.nodes[1].z_getnewaddress() 16 | 17 | self.nodes[0].sendtoaddress(taddr, 2.0) 18 | self.nodes[0].generate(1) 19 | self.sync_all() 20 | 21 | # Create and sign Sapling transaction. 22 | # If the incorrect consensus branch id is selected, there will be a signing error. 23 | opid = self.nodes[1].z_sendmany(taddr, 24 | [{'address': zaddr1, 'amount': 1}]) 25 | wait_and_assert_operationid_status(self.nodes[1], opid) 26 | 27 | if __name__ == '__main__': 28 | RegtestSignrawtransactionTest().main() 29 | -------------------------------------------------------------------------------- /qa/rpc-tests/test_framework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/qa/rpc-tests/test_framework/__init__.py -------------------------------------------------------------------------------- /qa/rpc-tests/wallet_shieldcoinbase_sapling.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from wallet_shieldcoinbase import WalletShieldCoinbaseTest 4 | 5 | class WalletShieldCoinbaseSapling(WalletShieldCoinbaseTest): 6 | def __init__(self): 7 | super(WalletShieldCoinbaseSapling, self).__init__('sapling') 8 | 9 | if __name__ == '__main__': 10 | WalletShieldCoinbaseSapling().main() 11 | -------------------------------------------------------------------------------- /qa/rpc-tests/wallet_shieldcoinbase_sprout.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from wallet_shieldcoinbase import WalletShieldCoinbaseTest 4 | 5 | class WalletShieldCoinbaseSprout(WalletShieldCoinbaseTest): 6 | def __init__(self): 7 | super(WalletShieldCoinbaseSprout, self).__init__('sprout') 8 | 9 | if __name__ == '__main__': 10 | WalletShieldCoinbaseSprout().main() 11 | -------------------------------------------------------------------------------- /rust-toolchain: -------------------------------------------------------------------------------- 1 | 1.51.0 2 | -------------------------------------------------------------------------------- /share/rpcuser/README.md: -------------------------------------------------------------------------------- 1 | RPC Tools 2 | --------------------- 3 | 4 | ### [RPCUser](/share/rpcuser) ### 5 | 6 | Create an RPC user login credential. 7 | 8 | Usage: 9 | 10 | ./rpcuser.py 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 https://www.opensource.org/licenses/mit-license.php . 5 | 6 | #include "amount.h" 7 | #include "policy/fees.h" 8 | 9 | #include "tinyformat.h" 10 | 11 | const std::string CURRENCY_UNIT = "YEC"; 12 | const std::string MINOR_CURRENCY_UNIT = "yoshis"; 13 | 14 | CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) 15 | { 16 | if (nSize > 0) 17 | nSatoshisPerK = nFeePaid*1000/nSize; 18 | else 19 | nSatoshisPerK = 0; 20 | } 21 | 22 | CAmount CFeeRate::GetFeeForRelay(size_t nSize) const 23 | { 24 | return std::min(GetFee(nSize), DEFAULT_FEE); 25 | } 26 | 27 | CAmount CFeeRate::GetFee(size_t nSize) const 28 | { 29 | CAmount nFee = nSatoshisPerK*nSize / 1000; 30 | 31 | if (nFee == 0 && nSatoshisPerK > 0) 32 | nFee = nSatoshisPerK; 33 | 34 | return nFee; 35 | } 36 | 37 | std::string CFeeRate::ToString() const 38 | { 39 | return strprintf("%d.%08d %s/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN, CURRENCY_UNIT); 40 | } 41 | -------------------------------------------------------------------------------- /src/bech32.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 Pieter Wuille 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | // Bech32 is a string encoding format used in newer address types. 6 | // The output consists of a human-readable part (alphanumeric), a 7 | // separator character (1), and a base32 data section, the last 8 | // 6 characters of which are a checksum. 9 | // 10 | // For more information, see BIP 173. 11 | 12 | #ifndef BITCOIN_BECH32_H 13 | #define BITCOIN_BECH32_H 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | namespace bech32 20 | { 21 | 22 | /** Encode a Bech32 string. Returns the empty string in case of failure. */ 23 | std::string Encode(const std::string& hrp, const std::vector& values); 24 | 25 | /** Decode a Bech32 string. Returns (hrp, data). Empty hrp means failure. */ 26 | std::pair> Decode(const std::string& str); 27 | 28 | } // namespace bech32 29 | 30 | #endif // BITCOIN_BECH32_H 31 | -------------------------------------------------------------------------------- /src/bench/.gitignore: -------------------------------------------------------------------------------- 1 | bench_bitcoin 2 | -------------------------------------------------------------------------------- /src/bench/Examples.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #include "bench.h" 6 | #include "main.h" 7 | #include "utiltime.h" 8 | 9 | // Sanity test: this should loop ten times, and 10 | // min/max/average should be close to 100ms. 11 | static void Sleep100ms(benchmark::State& state) 12 | { 13 | while (state.KeepRunning()) { 14 | MilliSleep(100); 15 | } 16 | } 17 | 18 | BENCHMARK(Sleep100ms); 19 | 20 | // Extremely fast-running benchmark: 21 | #include 22 | 23 | volatile double sum = 0.0; // volatile, global so not optimized away 24 | 25 | static void Trig(benchmark::State& state) 26 | { 27 | double d = 0.01; 28 | while (state.KeepRunning()) { 29 | sum += sin(d); 30 | d += 0.000001; 31 | } 32 | } 33 | 34 | BENCHMARK(Trig); 35 | -------------------------------------------------------------------------------- /src/bench/perf.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | /** Functions for measurement of CPU cycles */ 6 | #ifndef BITCOIN_BENCH_PERF_H 7 | #define BITCOIN_BENCH_PERF_H 8 | 9 | #include 10 | 11 | #if defined(__i386__) 12 | 13 | static inline uint64_t perf_cpucycles(void) 14 | { 15 | uint64_t x; 16 | __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); 17 | return x; 18 | } 19 | 20 | #elif defined(__x86_64__) 21 | 22 | static inline uint64_t perf_cpucycles(void) 23 | { 24 | uint32_t hi, lo; 25 | __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 26 | return ((uint64_t)lo)|(((uint64_t)hi)<<32); 27 | } 28 | #else 29 | 30 | uint64_t perf_cpucycles(void); 31 | 32 | #endif 33 | 34 | void perf_init(void); 35 | void perf_fini(void); 36 | 37 | #endif // BITCOIN_BENCH_PERF_H 38 | -------------------------------------------------------------------------------- /src/bench/prevector_destructor.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2017 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #include "bench.h" 6 | #include "prevector.h" 7 | 8 | static void PrevectorDestructor(benchmark::State& state) 9 | { 10 | while (state.KeepRunning()) { 11 | for (auto x = 0; x < 1000; ++x) { 12 | prevector<28, unsigned char> t0; 13 | prevector<28, unsigned char> t1; 14 | t0.resize(28); 15 | t1.resize(29); 16 | } 17 | } 18 | } 19 | 20 | static void PrevectorClear(benchmark::State& state) 21 | { 22 | 23 | while (state.KeepRunning()) { 24 | for (auto x = 0; x < 1000; ++x) { 25 | prevector<28, unsigned char> t0; 26 | prevector<28, unsigned char> t1; 27 | t0.resize(28); 28 | t0.clear(); 29 | t1.resize(29); 30 | t0.clear(); 31 | } 32 | } 33 | } 34 | 35 | BENCHMARK(PrevectorDestructor); 36 | BENCHMARK(PrevectorClear); 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 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x82,0x90,0x41}, 8833}, 12 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x7e,0x3a,0xed}, 8833} 13 | }; 14 | 15 | static SeedSpec6 pnSeed6_test[] = { 16 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x0e,0xf1,0xb7}, 18833} 17 | }; 18 | 19 | #endif // BITCOIN_CHAINPARAMSSEEDS_H 20 | -------------------------------------------------------------------------------- /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 https://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 | struct CCheckpointData; 14 | 15 | /** 16 | * Block-chain checkpoints are compiled-in sanity checks. 17 | * They are updated every release or three. 18 | */ 19 | namespace Checkpoints 20 | { 21 | 22 | //! Return conservative estimate of total number of blocks, 0 if unknown 23 | int GetTotalBlocksEstimate(const CCheckpointData& data); 24 | 25 | //! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint 26 | CBlockIndex* GetLastCheckpoint(const CCheckpointData& data); 27 | 28 | double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true); 29 | 30 | bool IsAncestorOfLastCheckpoint(const CCheckpointData& data, const CBlockIndex* pindex); 31 | } //namespace Checkpoints 32 | 33 | #endif // BITCOIN_CHECKPOINTS_H 34 | -------------------------------------------------------------------------------- /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 https://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 https://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 https://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/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/config/.empty -------------------------------------------------------------------------------- /src/crc32c/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | -------------------------------------------------------------------------------- /src/crc32c/.clang_complete: -------------------------------------------------------------------------------- 1 | -Ibuild/include/ 2 | -Ibuild/third_party/glog/ 3 | -Iinclude/ 4 | -Ithird_party/benchmark/include/ 5 | -Ithird_party/googletest/googletest/include/ 6 | -Ithird_party/googletest/googlemock/include/ 7 | -Ithird_party/glog/src/ 8 | -std=c++11 9 | -------------------------------------------------------------------------------- /src/crc32c/.gitignore: -------------------------------------------------------------------------------- 1 | # Editors. 2 | *.sw* 3 | .DS_Store 4 | /.vscode 5 | 6 | # Build directory. 7 | build/ 8 | out/ 9 | -------------------------------------------------------------------------------- /src/crc32c/.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/crc32c/.gitmodules -------------------------------------------------------------------------------- /src/crc32c/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the list of CRC32C authors for copyright purposes. 2 | # 3 | # This does not necessarily list everyone who has contributed code, since in 4 | # some cases, their employer may be the copyright holder. To see the full list 5 | # of contributors, see the revision history in source control. 6 | Google Inc. 7 | 8 | Fangming Fang 9 | Vadim Skipin 10 | -------------------------------------------------------------------------------- /src/crc32c/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution, 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | -------------------------------------------------------------------------------- /src/crc32c/Crc32cConfig.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2017 The CRC32C 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("${CMAKE_CURRENT_LIST_DIR}/Crc32cTargets.cmake") 6 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_arm64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 | // Linux-specific code checking the availability for ARM CRC32C instructions. 6 | 7 | #ifndef CRC32C_CRC32C_ARM_LINUX_H_ 8 | #define CRC32C_CRC32C_ARM_LINUX_H_ 9 | 10 | #include 11 | #include 12 | 13 | #ifdef CRC32C_HAVE_CONFIG_H 14 | #include "crc32c/crc32c_config.h" 15 | #endif 16 | 17 | #if HAVE_ARM64_CRC32C 18 | 19 | namespace crc32c { 20 | 21 | uint32_t ExtendArm64(uint32_t crc, const uint8_t* data, size_t count); 22 | 23 | } // namespace crc32c 24 | 25 | #endif // HAVE_ARM64_CRC32C 26 | 27 | #endif // CRC32C_CRC32C_ARM_LINUX_H_ 28 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_arm64_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 "gtest/gtest.h" 6 | 7 | #include "./crc32c_arm64.h" 8 | #include "./crc32c_extend_unittests.h" 9 | 10 | namespace crc32c { 11 | 12 | #if HAVE_ARM64_CRC32C 13 | 14 | struct Arm64TestTraits { 15 | static uint32_t Extend(uint32_t crc, const uint8_t* data, size_t count) { 16 | return ExtendArm64(crc, data, count); 17 | } 18 | }; 19 | 20 | INSTANTIATE_TYPED_TEST_SUITE_P(Arm64, ExtendTest, Arm64TestTraits); 21 | 22 | #endif // HAVE_ARM64_CRC32C 23 | 24 | } // namespace crc32c 25 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_internal.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 CRC32C_CRC32C_INTERNAL_H_ 6 | #define CRC32C_CRC32C_INTERNAL_H_ 7 | 8 | // Internal functions that may change between releases. 9 | 10 | #include 11 | #include 12 | 13 | namespace crc32c { 14 | 15 | // Un-accelerated implementation that works on all CPUs. 16 | uint32_t ExtendPortable(uint32_t crc, const uint8_t* data, size_t count); 17 | 18 | // CRCs are pre- and post- conditioned by xoring with all ones. 19 | static constexpr const uint32_t kCRC32Xor = static_cast(0xffffffffU); 20 | 21 | } // namespace crc32c 22 | 23 | #endif // CRC32C_CRC32C_INTERNAL_H_ 24 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_portable_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 "gtest/gtest.h" 6 | 7 | #include "./crc32c_extend_unittests.h" 8 | #include "./crc32c_internal.h" 9 | 10 | namespace crc32c { 11 | 12 | struct PortableTestTraits { 13 | static uint32_t Extend(uint32_t crc, const uint8_t* data, size_t count) { 14 | return ExtendPortable(crc, data, count); 15 | } 16 | }; 17 | 18 | INSTANTIATE_TYPED_TEST_SUITE_P(Portable, ExtendTest, PortableTestTraits); 19 | 20 | } // namespace crc32c 21 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_prefetch_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 "./crc32c_prefetch.h" 6 | 7 | // There is no easy way to test cache prefetching. We can only test that the 8 | // crc32c_prefetch.h header compiles on its own, so it doesn't have any unstated 9 | // dependencies. 10 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_read_le_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 "./crc32c_read_le.h" 6 | 7 | #include 8 | #include 9 | 10 | #include "gtest/gtest.h" 11 | 12 | #include "./crc32c_round_up.h" 13 | 14 | namespace crc32c { 15 | 16 | TEST(Crc32CReadLETest, ReadUint32LE) { 17 | // little-endian 0x12345678 18 | alignas(4) uint8_t bytes[] = {0x78, 0x56, 0x34, 0x12}; 19 | 20 | ASSERT_EQ(RoundUp<4>(bytes), bytes) << "Stack array is not aligned"; 21 | EXPECT_EQ(static_cast(0x12345678), ReadUint32LE(bytes)); 22 | } 23 | 24 | TEST(Crc32CReadLETest, ReadUint64LE) { 25 | // little-endian 0x123456789ABCDEF0 26 | alignas(8) uint8_t bytes[] = {0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12}; 27 | 28 | ASSERT_EQ(RoundUp<8>(bytes), bytes) << "Stack array is not aligned"; 29 | EXPECT_EQ(static_cast(0x123456789ABCDEF0), ReadUint64LE(bytes)); 30 | } 31 | 32 | } // namespace crc32c 33 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_sse42_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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 "gtest/gtest.h" 6 | 7 | #include "./crc32c_extend_unittests.h" 8 | #include "./crc32c_sse42.h" 9 | 10 | namespace crc32c { 11 | 12 | #if HAVE_SSE42 && (defined(_M_X64) || defined(__x86_64__)) 13 | 14 | struct Sse42TestTraits { 15 | static uint32_t Extend(uint32_t crc, const uint8_t* data, size_t count) { 16 | return ExtendSse42(crc, data, count); 17 | } 18 | }; 19 | 20 | INSTANTIATE_TYPED_TEST_SUITE_P(Sse42, ExtendTest, Sse42TestTraits); 21 | 22 | #endif // HAVE_SSE42 && (defined(_M_X64) || defined(__x86_64__)) 23 | 24 | } // namespace crc32c 25 | -------------------------------------------------------------------------------- /src/crc32c/src/crc32c_test_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The CRC32C 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. 4 | 5 | #ifdef CRC32C_HAVE_CONFIG_H 6 | #include "crc32c/crc32c_config.h" 7 | #endif 8 | 9 | #include "gtest/gtest.h" 10 | 11 | #if CRC32C_TESTS_BUILT_WITH_GLOG 12 | #include "glog/logging.h" 13 | #endif // CRC32C_TESTS_BUILT_WITH_GLOG 14 | 15 | int main(int argc, char** argv) { 16 | #if CRC32C_TESTS_BUILT_WITH_GLOG 17 | google::InitGoogleLogging(argv[0]); 18 | google::InstallFailureSignalHandler(); 19 | #endif // CRC32C_TESTS_BUILT_WITH_GLOG 20 | testing::InitGoogleTest(&argc, argv); 21 | return RUN_ALL_TESTS(); 22 | } 23 | -------------------------------------------------------------------------------- /src/crypto/chacha20.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 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_CHACHA20_H 6 | #define BITCOIN_CRYPTO_CHACHA20_H 7 | 8 | #include 9 | #include 10 | 11 | /** A PRNG class for ChaCha20. */ 12 | class ChaCha20 13 | { 14 | private: 15 | uint32_t input[16]; 16 | 17 | public: 18 | ChaCha20(); 19 | ChaCha20(const unsigned char* key, size_t keylen); 20 | void SetKey(const unsigned char* key, size_t keylen); 21 | void SetIV(uint64_t iv); 22 | void Seek(uint64_t pos); 23 | void Output(unsigned char* output, size_t bytes); 24 | }; 25 | 26 | #endif // BITCOIN_CRYPTO_CHACHA20_H 27 | -------------------------------------------------------------------------------- /src/crypto/ctaes/COPYING: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Pieter Wuille 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 https://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 https://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 https://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 https://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 https://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 https://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/sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://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/experimental_features.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #ifndef ZCASH_EXPERIMENTAL_FEATURES_H 6 | #define ZCASH_EXPERIMENTAL_FEATURES_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | extern bool fExperimentalDeveloperEncryptWallet; 13 | extern bool fExperimentalDeveloperSetPoolSizeZero; 14 | extern bool fExperimentalPaymentDisclosure; 15 | extern bool fExperimentalInsightExplorer; 16 | extern bool fExperimentalLightWalletd; 17 | 18 | std::optional InitExperimentalMode(); 19 | std::vector GetExperimentalFeatures(); 20 | 21 | #endif // ZCASH_EXPERIMENTAL_FEATURES_H 22 | -------------------------------------------------------------------------------- /src/fs.cpp: -------------------------------------------------------------------------------- 1 | #include "fs.h" 2 | 3 | namespace fsbridge { 4 | 5 | FILE *fopen(const fs::path& p, const char *mode) 6 | { 7 | return ::fopen(p.string().c_str(), mode); 8 | } 9 | 10 | FILE *freopen(const fs::path& p, const char *mode, FILE *stream) 11 | { 12 | return ::freopen(p.string().c_str(), mode, stream); 13 | } 14 | 15 | } // fsbridge 16 | -------------------------------------------------------------------------------- /src/fs.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #ifndef BITCOIN_FS_H 6 | #define BITCOIN_FS_H 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | /** Filesystem operations and types */ 16 | namespace fs = boost::filesystem; 17 | 18 | /** Bridge operations to C stdio */ 19 | namespace fsbridge { 20 | FILE *fopen(const fs::path& p, const char *mode); 21 | FILE *freopen(const fs::path& p, const char *mode, FILE *stream); 22 | }; 23 | 24 | #endif // BITCOIN_FS_H 25 | -------------------------------------------------------------------------------- /src/fuzzing/CheckBlock/input/0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/CheckBlock/input/0.bin -------------------------------------------------------------------------------- /src/fuzzing/CheckBlock/input/476431.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/CheckBlock/input/476431.bin -------------------------------------------------------------------------------- /src/fuzzing/CheckBlock/input/620000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/CheckBlock/input/620000.bin -------------------------------------------------------------------------------- /src/fuzzing/DecodeHexTx/input/coinbase.txt: -------------------------------------------------------------------------------- 1 | 0400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff2a03677b090004e161a75d0edb51e814ae3737f790e3c94f11495327270fdfbd6132d5e90f87507455844cffffffff023f1e9b3b000000001976a914e0082ee3d89f84adbadaaebddd1746bb20e6d4ee88ac80b2e60e0000000017a914ce811a7457b9f4553af120e553bc8ddd8bb33ce98700000000000000000000000000000000000000 -------------------------------------------------------------------------------- /src/fuzzing/DeserializeAddrMan/fuzz.cpp: -------------------------------------------------------------------------------- 1 | #include "addrman.h" 2 | #include "streams.h" 3 | 4 | 5 | #ifdef FUZZ_WITH_AFL 6 | 7 | int main (int argc, char *argv[]) { 8 | CAddrMan addrman; 9 | CAutoFile filein(fopen(argv[1], "rb"), SER_DISK, CLIENT_VERSION); 10 | try { 11 | filein >> addrman; 12 | return 0; 13 | } catch (const std::exception&) { 14 | return -1; 15 | } 16 | } 17 | 18 | #endif 19 | 20 | #ifdef FUZZ_WITH_LIBFUZZER 21 | 22 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 23 | CAddrMan addrman; 24 | CDataStream ds(Data, Data+Size, SER_DISK, CLIENT_VERSION); 25 | try { 26 | ds >> addrman; 27 | } catch (const std::exception &e) { 28 | return 0; 29 | } 30 | return 0; // Non-zero return values are reserved for future use. 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/fuzzing/DeserializeAddrMan/input/peers.dat-minus-4-byte-header: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/DeserializeAddrMan/input/peers.dat-minus-4-byte-header -------------------------------------------------------------------------------- /src/fuzzing/DeserializeTx/input/coinbase.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/DeserializeTx/input/coinbase.bin -------------------------------------------------------------------------------- /src/fuzzing/DeserializeTx/input/manyoutputs.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/DeserializeTx/input/manyoutputs.bin -------------------------------------------------------------------------------- /src/fuzzing/DeserializeTx/input/sapling.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/DeserializeTx/input/sapling.bin -------------------------------------------------------------------------------- /src/fuzzing/DeserializeTx/input/sprout.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/DeserializeTx/input/sprout.bin -------------------------------------------------------------------------------- /src/fuzzing/ReadFeeEstimates/fuzz.cpp: -------------------------------------------------------------------------------- 1 | #include "txmempool.h" 2 | 3 | #ifdef FUZZ_WITH_AFL 4 | 5 | int main (int argc, char *argv[]) { 6 | CFeeRate rate; 7 | CTxMemPool mempool(rate); 8 | CAutoFile est_filein(fopen(argv[1], "rb"), SER_DISK, CLIENT_VERSION); 9 | 10 | if (mempool.ReadFeeEstimates(est_filein)) { 11 | return 0; 12 | } else { 13 | return -1; 14 | } 15 | } 16 | 17 | #endif 18 | 19 | #ifdef FUZZ_WITH_LIBFUZZER 20 | 21 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 22 | CFeeRate rate; 23 | CTxMemPool mempool(rate); 24 | CAutoFile est_filein(fmemopen(Data, Size, "rb"), SER_DISK, CLIENT_VERSION); 25 | 26 | if (mempool.ReadFeeEstimates(est_filein)) { 27 | return 0; 28 | } else { 29 | return -1; 30 | } 31 | } 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/fuzzing/ReadFeeEstimates/input/fee_estimates.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/ReadFeeEstimates/input/fee_estimates.dat -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/dict: -------------------------------------------------------------------------------- 1 | kw1="{" 2 | kw2="}" 3 | kw5="[" 4 | kw6="]" 5 | kw7=":" 6 | kw8="," 7 | kw9="\"" 8 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/fuzz.cpp: -------------------------------------------------------------------------------- 1 | #include "univalue.h" 2 | 3 | int fuzz_UniValue_Read(std::string notquitejson) { 4 | UniValue valRequest; 5 | if (!valRequest.read(notquitejson)) { 6 | return -1; 7 | } 8 | return 0; 9 | } 10 | 11 | #ifdef FUZZ_WITH_AFL 12 | 13 | #error "The AFL version of this fuzzer has not yet been implemented." 14 | 15 | int main (int argc, char *argv[]) { 16 | // not implemented 17 | return 0; 18 | } 19 | 20 | #endif // FUZZ_WITH_AFL 21 | #ifdef FUZZ_WITH_LIBFUZZER 22 | 23 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 24 | std::string s; 25 | s.assign((const char *)Data, Size); 26 | return fuzz_UniValue_Read(s); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail1.json: -------------------------------------------------------------------------------- 1 | "This is a string that never ends, yes it goes on and on, my friends. 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail10.json: -------------------------------------------------------------------------------- 1 | {"Extra value after close": true} "misplaced quoted value" -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail11.json: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail12.json: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail13.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail14.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail15.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail16.json: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail17.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail18.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail19.json: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail2.json: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail20.json: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail21.json: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail22.json: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail23.json: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail24.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail25.json: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail26.json: -------------------------------------------------------------------------------- 1 | ["tab\ character\ in\ string\ "] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail27.json: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail28.json: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail29.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail3.json: -------------------------------------------------------------------------------- 1 | {unquoted_key: "keys must be quoted"} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail30.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail31.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail32.json: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail33.json: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail34.json: -------------------------------------------------------------------------------- 1 | {} garbage -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail35.json: -------------------------------------------------------------------------------- 1 | [ true true true [] [] [] ] 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail36.json: -------------------------------------------------------------------------------- 1 | {"a":} 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail37.json: -------------------------------------------------------------------------------- 1 | {"a":1 "b":2} 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail38.json: -------------------------------------------------------------------------------- 1 | ["\ud834"] 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail39.json: -------------------------------------------------------------------------------- 1 | ["\udd61"] 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail4.json: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail40.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/UniValue__Read/input/fail40.json -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail41.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/fuzzing/UniValue__Read/input/fail41.json -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail42.json: -------------------------------------------------------------------------------- 1 | ["before nul byte"]"after nul byte" 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail5.json: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail6.json: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail7.json: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail8.json: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/fail9.json: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/pass2.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/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/fuzzing/UniValue__Read/input/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/fuzzing/UniValue__Read/input/round2.json: -------------------------------------------------------------------------------- 1 | ["a§■𐎒𝅘𝅥𝅯"] 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/round3.json: -------------------------------------------------------------------------------- 1 | "abcdefghijklmnopqrstuvwxyz" 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/round4.json: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/round5.json: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/round6.json: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /src/fuzzing/UniValue__Read/input/round7.json: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /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/test_allocator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "support/allocators/secure.h" 4 | 5 | TEST(AllocatorTests, LockedPoolAbortOnDoubleFree) { 6 | LockedPoolManager &pool = LockedPoolManager::Instance(); 7 | 8 | // We should be able to allocate and free memory. 9 | void *a0 = pool.alloc(16); 10 | pool.free(a0); 11 | 12 | // Process terminates on double-free. 13 | EXPECT_DEATH(pool.free(a0), "Arena: invalid or double free"); 14 | } 15 | 16 | TEST(AllocatorTests, LockedPoolAbortOnFreeInvalidPointer) { 17 | LockedPoolManager &pool = LockedPoolManager::Instance(); 18 | bool notInPool = false; 19 | 20 | // Process terminates if we try to free memory that wasn't allocated by the pool. 21 | EXPECT_DEATH(pool.free(¬InPool), "LockedPool: invalid address not pointing to any arena"); 22 | } 23 | -------------------------------------------------------------------------------- /src/gtest/test_block.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "primitives/block.h" 4 | #include "streams.h" 5 | #include "version.h" 6 | 7 | 8 | TEST(BlockTests, HeaderSizeIsExpected) { 9 | // Dummy header with an empty Equihash solution. 10 | CBlockHeader header; 11 | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); 12 | ss << header; 13 | 14 | ASSERT_EQ(ss.size(), CBlockHeader::HEADER_SIZE); 15 | } 16 | -------------------------------------------------------------------------------- /src/gtest/test_pedersen_hash.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "librustzcash.h" 3 | #include "uint256.h" 4 | 5 | TEST(PedersenHash, TestAPI) { 6 | const uint256 a = uint256S("87a086ae7d2252d58729b30263fb7b66308bf94ef59a76c9c86e7ea016536505"); 7 | const uint256 b = uint256S("a75b84a125b2353da7e8d96ee2a15efe4de23df9601b9d9564ba59de57130406"); 8 | uint256 result; 9 | 10 | librustzcash_merkle_hash(25, a.begin(), b.begin(), result.begin()); 11 | 12 | uint256 expected_result = uint256S("5bf43b5736c19b714d1f462c9d22ba3492c36e3d9bbd7ca24d94b440550aa561"); 13 | 14 | ASSERT_TRUE(result == expected_result); 15 | } 16 | -------------------------------------------------------------------------------- /src/gtest/test_random.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "random.h" 4 | #include "gtest/utils.h" 5 | 6 | TEST(Random, MappedShuffle) { 7 | std::vector a {8, 4, 6, 3, 5}; 8 | std::vector m {0, 1, 2, 3, 4}; 9 | 10 | auto a1 = a; 11 | auto m1 = m; 12 | MappedShuffle(a1.begin(), m1.begin(), a1.size(), GenZero); 13 | std::vector ea1 {4, 6, 3, 5, 8}; 14 | std::vector em1 {1, 2, 3, 4, 0}; 15 | EXPECT_EQ(ea1, a1); 16 | EXPECT_EQ(em1, m1); 17 | 18 | auto a2 = a; 19 | auto m2 = m; 20 | MappedShuffle(a2.begin(), m2.begin(), a2.size(), GenMax); 21 | std::vector ea2 {8, 4, 6, 3, 5}; 22 | std::vector em2 {0, 1, 2, 3, 4}; 23 | EXPECT_EQ(ea2, a2); 24 | EXPECT_EQ(em2, m2); 25 | 26 | auto a3 = a; 27 | auto m3 = m; 28 | MappedShuffle(a3.begin(), m3.begin(), a3.size(), GenIdentity); 29 | std::vector ea3 {8, 4, 6, 3, 5}; 30 | std::vector em3 {0, 1, 2, 3, 4}; 31 | EXPECT_EQ(ea3, a3); 32 | EXPECT_EQ(em3, m3); 33 | } 34 | -------------------------------------------------------------------------------- /src/gtest/test_tautology.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST(tautologies, SevenEqSeven) { 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 "gtest/utils.h" 2 | 3 | int GenZero(int n) 4 | { 5 | return 0; 6 | } 7 | 8 | int GenMax(int n) 9 | { 10 | return n-1; 11 | } 12 | -------------------------------------------------------------------------------- /src/gtest/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_GTEST_UTILS_H 2 | #define BITCOIN_GTEST_UTILS_H 3 | 4 | int GenZero(int n); 5 | int GenMax(int n); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /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 https://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/leveldb/.appveyor.yml: -------------------------------------------------------------------------------- 1 | # Build matrix / environment variables are explained on: 2 | # https://www.appveyor.com/docs/appveyor-yml/ 3 | # This file can be validated on: https://ci.appveyor.com/tools/validate-yaml 4 | 5 | version: "{build}" 6 | 7 | environment: 8 | matrix: 9 | # AppVeyor currently has no custom job name feature. 10 | # http://help.appveyor.com/discussions/questions/1623-can-i-provide-a-friendly-name-for-jobs 11 | - JOB: Visual Studio 2017 12 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 13 | CMAKE_GENERATOR: Visual Studio 15 2017 14 | 15 | platform: 16 | - x86 17 | - x64 18 | 19 | configuration: 20 | - RelWithDebInfo 21 | - Debug 22 | 23 | build_script: 24 | - git submodule update --init --recursive 25 | - mkdir build 26 | - cd build 27 | - if "%platform%"=="x64" set CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64 28 | - cmake --version 29 | - cmake .. -G "%CMAKE_GENERATOR%" 30 | -DCMAKE_CONFIGURATION_TYPES="%CONFIGURATION%" 31 | - cmake --build . --config "%CONFIGURATION%" 32 | - cd .. 33 | 34 | test_script: 35 | - cd build && ctest --verbose --build-config "%CONFIGURATION%" && cd .. 36 | -------------------------------------------------------------------------------- /src/leveldb/.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | # find . -iname '*.cc' -o -iname '*.h' -o -iname '*.h.in' | xargs clang-format -i --style=file 4 | BasedOnStyle: Google 5 | DerivePointerAlignment: false 6 | 7 | # Public headers are in a different location in the internal Google repository. 8 | # Order them so that when imported to the authoritative repository they will be 9 | # in correct alphabetical order. 10 | IncludeCategories: 11 | - Regex: '^(<|"(benchmarks|db|helpers)/)' 12 | Priority: 1 13 | - Regex: '^"(leveldb)/' 14 | Priority: 2 15 | - Regex: '^(<|"(issues|port|table|third_party|util)/)' 16 | Priority: 3 17 | - Regex: '.*' 18 | Priority: 4 19 | -------------------------------------------------------------------------------- /src/leveldb/.gitignore: -------------------------------------------------------------------------------- 1 | # Editors. 2 | *.sw* 3 | .vscode 4 | .DS_Store 5 | 6 | # Build directory. 7 | build/ 8 | out/ 9 | -------------------------------------------------------------------------------- /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/cmake/leveldbConfig.cmake: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/leveldbTargets.cmake") 2 | -------------------------------------------------------------------------------- /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 | Status BuildTable(const std::string& dbname, Env* env, const Options& options, 26 | TableCache* table_cache, Iterator* iter, FileMetaData* meta); 27 | 28 | } // namespace leveldb 29 | 30 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 31 | -------------------------------------------------------------------------------- /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 | 10 | #include "db/dbformat.h" 11 | #include "leveldb/db.h" 12 | 13 | namespace leveldb { 14 | 15 | class DBImpl; 16 | 17 | // Return a new iterator that converts internal keys (yielded by 18 | // "*internal_iter") that were live at the specified "sequence" number 19 | // into appropriate user keys. 20 | Iterator* NewDBIterator(DBImpl* db, const Comparator* user_key_comparator, 21 | Iterator* internal_iter, SequenceNumber sequence, 22 | uint32_t seed); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 27 | -------------------------------------------------------------------------------- /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.md 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 | #include "leveldb/export.h" 9 | 10 | namespace leveldb { 11 | 12 | class Env; 13 | 14 | // Returns a new environment that stores its data in memory and delegates 15 | // all non-file-storage tasks to base_env. The caller must delete the result 16 | // when it is no longer needed. 17 | // *base_env must remain live while the result is in use. 18 | LEVELDB_EXPORT Env* NewMemEnv(Env* base_env); 19 | 20 | } // namespace leveldb 21 | 22 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 23 | -------------------------------------------------------------------------------- /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 | 10 | #include "leveldb/env.h" 11 | #include "leveldb/export.h" 12 | #include "leveldb/status.h" 13 | 14 | namespace leveldb { 15 | 16 | // Dump the contents of the file named by fname in text format to 17 | // *dst. Makes a sequence of dst->Append() calls; each call is passed 18 | // the newline-terminated text corresponding to a single item found 19 | // in the file. 20 | // 21 | // Returns a non-OK result if fname does not name a leveldb storage 22 | // file, or if the file cannot be read. 23 | LEVELDB_EXPORT Status DumpFile(Env* env, const std::string& fname, 24 | WritableFile* dst); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 29 | -------------------------------------------------------------------------------- /src/leveldb/include/leveldb/export.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 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_EXPORT_H_ 6 | #define STORAGE_LEVELDB_INCLUDE_EXPORT_H_ 7 | 8 | #if !defined(LEVELDB_EXPORT) 9 | 10 | #if defined(LEVELDB_SHARED_LIBRARY) 11 | #if defined(_WIN32) 12 | 13 | #if defined(LEVELDB_COMPILE_LIBRARY) 14 | #define LEVELDB_EXPORT __declspec(dllexport) 15 | #else 16 | #define LEVELDB_EXPORT __declspec(dllimport) 17 | #endif // defined(LEVELDB_COMPILE_LIBRARY) 18 | 19 | #else // defined(_WIN32) 20 | #if defined(LEVELDB_COMPILE_LIBRARY) 21 | #define LEVELDB_EXPORT __attribute__((visibility("default"))) 22 | #else 23 | #define LEVELDB_EXPORT 24 | #endif 25 | #endif // defined(_WIN32) 26 | 27 | #else // defined(LEVELDB_SHARED_LIBRARY) 28 | #define LEVELDB_EXPORT 29 | #endif 30 | 31 | #endif // !defined(LEVELDB_EXPORT) 32 | 33 | #endif // STORAGE_LEVELDB_INCLUDE_EXPORT_H_ 34 | -------------------------------------------------------------------------------- /src/leveldb/port/README.md: -------------------------------------------------------------------------------- 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_stdcxx.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) || defined(LEVELDB_PLATFORM_WINDOWS) 14 | #include "port/port_stdcxx.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | #include "port/port_chromium.h" 17 | #endif 18 | 19 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 20 | -------------------------------------------------------------------------------- /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 | Iterator* NewMergingIterator(const Comparator* comparator, Iterator** children, 22 | int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /src/leveldb/util/env_posix_test_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 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_ENV_POSIX_TEST_HELPER_H_ 6 | #define STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class EnvPosixTest; 11 | 12 | // A helper for the POSIX Env to facilitate testing. 13 | class EnvPosixTestHelper { 14 | private: 15 | friend class EnvPosixTest; 16 | 17 | // Set the maximum number of read-only files that will be opened. 18 | // Must be called before creating an Env. 19 | static void SetReadOnlyFDLimit(int limit); 20 | 21 | // Set the maximum number of read-only files that will be mapped via mmap. 22 | // Must be called before creating an Env. 23 | static void SetReadOnlyMMapLimit(int limit); 24 | }; 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_ 29 | -------------------------------------------------------------------------------- /src/leveldb/util/env_windows_test_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 (c) 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_ENV_WINDOWS_TEST_HELPER_H_ 6 | #define STORAGE_LEVELDB_UTIL_ENV_WINDOWS_TEST_HELPER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class EnvWindowsTest; 11 | 12 | // A helper for the Windows Env to facilitate testing. 13 | class EnvWindowsTestHelper { 14 | private: 15 | friend class CorruptionTest; 16 | friend class EnvWindowsTest; 17 | 18 | // Set the maximum number of read-only files that will be mapped via mmap. 19 | // Must be called before creating an Env. 20 | static void SetReadOnlyMMapLimit(int limit); 21 | }; 22 | 23 | } // namespace leveldb 24 | 25 | #endif // STORAGE_LEVELDB_UTIL_ENV_WINDOWS_TEST_HELPER_H_ 26 | -------------------------------------------------------------------------------- /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 | uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } // namespace leveldb 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 | enum { kNumBuckets = 154 }; 25 | 26 | double Median() const; 27 | double Percentile(double p) const; 28 | double Average() const; 29 | double StandardDeviation() const; 30 | 31 | static const double kBucketLimit[kNumBuckets]; 32 | 33 | double min_; 34 | double max_; 35 | double num_; 36 | double sum_; 37 | double sum_squares_; 38 | 39 | double buckets_[kNumBuckets]; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 45 | -------------------------------------------------------------------------------- /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() : comparator(BytewiseComparator()), env(Env::Default()) {} 13 | 14 | } // namespace leveldb 15 | -------------------------------------------------------------------------------- /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 https://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/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/reverse_iterator.h: -------------------------------------------------------------------------------- 1 | // Taken from https://gist.github.com/arvidsson/7231973 2 | 3 | #ifndef BITCOIN_REVERSE_ITERATOR_HPP 4 | #define BITCOIN_REVERSE_ITERATOR_HPP 5 | 6 | /** 7 | * Template used for reverse iteration in C++11 range-based for loops. 8 | * 9 | * std::vector v = {1, 2, 3, 4, 5}; 10 | * for (auto x : reverse_iterate(v)) 11 | * std::cout << x << " "; 12 | */ 13 | 14 | template 15 | class reverse_range 16 | { 17 | T &x; 18 | 19 | public: 20 | reverse_range(T &x) : x(x) {} 21 | 22 | auto begin() const -> decltype(this->x.rbegin()) 23 | { 24 | return x.rbegin(); 25 | } 26 | 27 | auto end() const -> decltype(this->x.rend()) 28 | { 29 | return x.rend(); 30 | } 31 | }; 32 | 33 | template 34 | reverse_range reverse_iterate(T &x) 35 | { 36 | return reverse_range(x); 37 | } 38 | 39 | #endif // BITCOIN_REVERSE_ITERATOR_HPP 40 | -------------------------------------------------------------------------------- /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 https://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 | _lock.swap(templock); 19 | } 20 | 21 | ~reverse_lock() { 22 | templock.lock(); 23 | templock.swap(lock); 24 | } 25 | 26 | private: 27 | reverse_lock(reverse_lock const&); 28 | reverse_lock& operator=(reverse_lock const&); 29 | 30 | Lock& lock; 31 | Lock templock; 32 | }; 33 | 34 | #endif // BITCOIN_REVERSELOCK_H 35 | -------------------------------------------------------------------------------- /src/rpc/client.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 https://www.opensource.org/licenses/mit-license.php . 5 | 6 | #ifndef BITCOIN_RPC_CLIENT_H 7 | #define BITCOIN_RPC_CLIENT_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_RPC_CLIENT_H 18 | -------------------------------------------------------------------------------- /src/rust/README.md: -------------------------------------------------------------------------------- 1 | # librustzcash 2 | 3 | `librustzcash` is an FFI library crate that exposes the Zcash Rust components to 4 | the `zcashd` full node. 5 | 6 | The FFI API does not have any stability guarantees, and will change as required 7 | by `zcashd`. 8 | 9 | ## License 10 | 11 | Licensed under either of 12 | 13 | * Apache License, Version 2.0, ([LICENSE-APACHE](../LICENSE-APACHE) or 14 | https://www.apache.org/licenses/LICENSE-2.0) 15 | * MIT license ([LICENSE-MIT](../LICENSE-MIT) or https://opensource.org/licenses/MIT) 16 | 17 | at your option. 18 | 19 | ### Contribution 20 | 21 | Unless you explicitly state otherwise, any contribution intentionally 22 | submitted for inclusion in the work by you, as defined in the Apache-2.0 23 | license, shall be dual licensed as above, without any additional terms or 24 | conditions. 25 | 26 | -------------------------------------------------------------------------------- /src/rust/include/rust/types.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #ifndef ZCASH_RUST_INCLUDE_RUST_TYPES_H 6 | #define ZCASH_RUST_INCLUDE_RUST_TYPES_H 7 | 8 | #include 9 | 10 | #ifdef WIN32 11 | typedef uint16_t codeunit; 12 | #else 13 | typedef uint8_t codeunit; 14 | #endif 15 | 16 | #endif // ZCASH_RUST_INCLUDE_RUST_TYPES_H 17 | -------------------------------------------------------------------------------- /src/rust/src/tests/res/tree1023.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/rust/src/tests/res/tree1023.dat -------------------------------------------------------------------------------- /src/rust/src/tests/res/tree16.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/rust/src/tests/res/tree16.dat -------------------------------------------------------------------------------- /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 https://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 | // DoS prevention: limit cache size to less than 40MB (over 500000 14 | // entries on 64-bit systems). 15 | static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 40; 16 | 17 | class CPubKey; 18 | 19 | class CachingTransactionSignatureChecker : public TransactionSignatureChecker 20 | { 21 | private: 22 | bool store; 23 | 24 | public: 25 | CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amount, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amount, txdataIn), store(storeIn) {} 26 | 27 | bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; 28 | }; 29 | 30 | #endif // BITCOIN_SCRIPT_SIGCACHE_H 31 | -------------------------------------------------------------------------------- /src/secp256k1/.gitattributes: -------------------------------------------------------------------------------- 1 | src/precomputed_ecmult.c linguist-generated 2 | src/precomputed_ecmult_gen.c linguist-generated 3 | -------------------------------------------------------------------------------- /src/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | bench 2 | bench_ecmult 3 | bench_internal 4 | tests 5 | exhaustive_tests 6 | precompute_ecmult_gen 7 | precompute_ecmult 8 | valgrind_ctime_test 9 | ecdh_example 10 | ecdsa_example 11 | schnorr_example 12 | *.exe 13 | *.so 14 | *.a 15 | *.csv 16 | *.log 17 | *.trs 18 | *.sage.py 19 | 20 | Makefile 21 | configure 22 | .libs/ 23 | Makefile.in 24 | aclocal.m4 25 | autom4te.cache/ 26 | config.log 27 | config.status 28 | conftest* 29 | *.tar.gz 30 | *.la 31 | libtool 32 | .deps/ 33 | .dirstamp 34 | *.lo 35 | *.o 36 | *~ 37 | 38 | coverage/ 39 | coverage.html 40 | coverage.*.html 41 | *.gcda 42 | *.gcno 43 | *.gcov 44 | 45 | src/libsecp256k1-config.h 46 | src/libsecp256k1-config.h.in 47 | build-aux/ar-lib 48 | build-aux/config.guess 49 | build-aux/config.sub 50 | build-aux/depcomp 51 | build-aux/install-sh 52 | build-aux/ltmain.sh 53 | build-aux/m4/libtool.m4 54 | build-aux/m4/lt~obsolete.m4 55 | build-aux/m4/ltoptions.m4 56 | build-aux/m4/ltsugar.m4 57 | build-aux/m4/ltversion.m4 58 | build-aux/missing 59 | build-aux/compile 60 | build-aux/test-driver 61 | src/stamp-h1 62 | libsecp256k1.pc 63 | -------------------------------------------------------------------------------- /src/secp256k1/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). 4 | 5 | ## [Unreleased] 6 | 7 | ## [0.2.0] - 2022-12-12 8 | 9 | ### Added 10 | - Added `secp256k1_selftest`, to be used in conjunction with `secp256k1_context_static`. 11 | 12 | ### Changed 13 | - Enabled modules schnorrsig, extrakeys and ECDH by default in `./configure`. 14 | 15 | ### Deprecated 16 | - Deprecated context flags `SECP256K1_CONTEXT_VERIFY` and `SECP256K1_CONTEXT_SIGN`. Use `SECP256K1_CONTEXT_NONE` instead. 17 | - Renamed `secp256k1_context_no_precomp` to `secp256k1_context_static`. 18 | 19 | ### ABI Compatibility 20 | 21 | Since this is the first release, we do not compare application binary interfaces. 22 | However, there are unreleased versions of libsecp256k1 that are *not* ABI compatible with this version. 23 | 24 | ## [0.1.0] - 2013-03-05 to 2021-12-25 25 | 26 | This version was in fact never released. 27 | The number was given by the build system since the introduction of autotools in Jan 2014 (ea0fe5a5bf0c04f9cc955b2966b614f5f378c6f6). 28 | Therefore, this version number does not uniquely identify a set of source files. 29 | -------------------------------------------------------------------------------- /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/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | To report security issues send an email to secp256k1-security@bitcoincore.org (not for support). 6 | 7 | The following keys may be used to communicate sensitive information to developers: 8 | 9 | | Name | Fingerprint | 10 | |------|-------------| 11 | | Pieter Wuille | 133E AC17 9436 F14A 5CF1 B794 860F EB80 4E66 9320 | 12 | | Jonas Nick | 36C7 1A37 C9D9 88BD E825 08D9 B1A7 0E4F 8DCD 0366 | 13 | | Tim Ruffing | 09E0 3F87 1092 E40E 106E 902B 33BC 86AB 80FF 5516 | 14 | 15 | You can import a key by running the following command with that individual’s fingerprint: `gpg --keyserver hkps://keys.openpgp.org --recv-keys ""` Ensure that you put quotes around fingerprints containing spaces. 16 | -------------------------------------------------------------------------------- /src/secp256k1/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /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: -L${libdir} -lsecp256k1 12 | Libs.private: @SECP_LIBS@ 13 | 14 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecmult_compute_table.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Copyright (c) 2013, 2014, 2017, 2021 Pieter Wuille, Andrew Poelstra, Jonas Nick, Russell O'Connor * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php. * 5 | *****************************************************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_COMPUTE_TABLE_H 8 | #define SECP256K1_ECMULT_COMPUTE_TABLE_H 9 | 10 | /* Construct table of all odd multiples of gen in range 1..(2**(window_g-1)-1). */ 11 | static void secp256k1_ecmult_compute_table(secp256k1_ge_storage* table, int window_g, const secp256k1_gej* gen); 12 | 13 | /* Like secp256k1_ecmult_compute_table, but one for both gen and gen*2^128. */ 14 | static void secp256k1_ecmult_compute_two_tables(secp256k1_ge_storage* table, secp256k1_ge_storage* table_128, int window_g, const secp256k1_ge* gen); 15 | 16 | #endif /* SECP256K1_ECMULT_COMPUTE_TABLE_H */ 17 | -------------------------------------------------------------------------------- /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 https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_CONST_H 8 | #define SECP256K1_ECMULT_CONST_H 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | /** 14 | * Multiply: R = q*A (in constant-time) 15 | * Here `bits` should be set to the maximum bitlength of the _absolute value_ of `q`, plus 16 | * one because we internally sometimes add 2 to the number during the WNAF conversion. 17 | * A must not be infinity. 18 | */ 19 | static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q, int bits); 20 | 21 | #endif /* SECP256K1_ECMULT_CONST_H */ 22 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecmult_gen_compute_table.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2013, 2014, 2015 Pieter Wuille, Gregory Maxwell * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_ECMULT_GEN_COMPUTE_TABLE_H 8 | #define SECP256K1_ECMULT_GEN_COMPUTE_TABLE_H 9 | 10 | #include "ecmult_gen.h" 11 | 12 | static void secp256k1_ecmult_gen_compute_table(secp256k1_ge_storage* table, const secp256k1_ge* gen, int bits); 13 | 14 | #endif /* SECP256K1_ECMULT_GEN_COMPUTE_TABLE_H */ 15 | -------------------------------------------------------------------------------- /src/secp256k1/src/int128_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef SECP256K1_INT128_IMPL_H 2 | #define SECP256K1_INT128_IMPL_H 3 | 4 | #include "util.h" 5 | 6 | #include "int128.h" 7 | 8 | #if defined(SECP256K1_WIDEMUL_INT128) 9 | # if defined(SECP256K1_INT128_NATIVE) 10 | # include "int128_native_impl.h" 11 | # elif defined(SECP256K1_INT128_STRUCT) 12 | # include "int128_struct_impl.h" 13 | # else 14 | # error "Please select int128 implementation" 15 | # endif 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/secp256k1/src/int128_native.h: -------------------------------------------------------------------------------- 1 | #ifndef SECP256K1_INT128_NATIVE_H 2 | #define SECP256K1_INT128_NATIVE_H 3 | 4 | #include 5 | #include "util.h" 6 | 7 | #if !defined(UINT128_MAX) && defined(__SIZEOF_INT128__) 8 | SECP256K1_GNUC_EXT typedef unsigned __int128 uint128_t; 9 | SECP256K1_GNUC_EXT typedef __int128 int128_t; 10 | # define UINT128_MAX ((uint128_t)(-1)) 11 | # define INT128_MAX ((int128_t)(UINT128_MAX >> 1)) 12 | # define INT128_MIN (-INT128_MAX - 1) 13 | /* No (U)INT128_C macros because compilers providing __int128 do not support 128-bit literals. */ 14 | #endif 15 | 16 | typedef uint128_t secp256k1_uint128; 17 | typedef int128_t secp256k1_int128; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/int128_struct.h: -------------------------------------------------------------------------------- 1 | #ifndef SECP256K1_INT128_STRUCT_H 2 | #define SECP256K1_INT128_STRUCT_H 3 | 4 | #include 5 | #include "util.h" 6 | 7 | typedef struct { 8 | uint64_t lo; 9 | uint64_t hi; 10 | } secp256k1_uint128; 11 | 12 | typedef secp256k1_uint128 secp256k1_int128; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /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 | noinst_HEADERS += src/modules/ecdh/bench_impl.h 5 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/extrakeys/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_extrakeys.h 2 | noinst_HEADERS += src/modules/extrakeys/tests_impl.h 3 | noinst_HEADERS += src/modules/extrakeys/tests_exhaustive_impl.h 4 | noinst_HEADERS += src/modules/extrakeys/main_impl.h 5 | -------------------------------------------------------------------------------- /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 | noinst_HEADERS += src/modules/recovery/tests_exhaustive_impl.h 5 | noinst_HEADERS += src/modules/recovery/bench_impl.h 6 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/schnorrsig/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_schnorrsig.h 2 | noinst_HEADERS += src/modules/schnorrsig/main_impl.h 3 | noinst_HEADERS += src/modules/schnorrsig/tests_impl.h 4 | noinst_HEADERS += src/modules/schnorrsig/tests_exhaustive_impl.h 5 | noinst_HEADERS += src/modules/schnorrsig/bench_impl.h 6 | -------------------------------------------------------------------------------- /src/secp256k1/src/precomputed_ecmult_gen.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | * Copyright (c) 2013, 2014, 2015, 2021 Thomas Daede, Cory Fields, Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or https://www.opensource.org/licenses/mit-license.php. * 5 | *********************************************************************************/ 6 | 7 | #ifndef SECP256K1_PRECOMPUTED_ECMULT_GEN_H 8 | #define SECP256K1_PRECOMPUTED_ECMULT_GEN_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "group.h" 15 | #include "ecmult_gen.h" 16 | #ifdef EXHAUSTIVE_TEST_ORDER 17 | static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(ECMULT_GEN_PREC_BITS)][ECMULT_GEN_PREC_G(ECMULT_GEN_PREC_BITS)]; 18 | #else 19 | extern const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table[ECMULT_GEN_PREC_N(ECMULT_GEN_PREC_BITS)][ECMULT_GEN_PREC_G(ECMULT_GEN_PREC_BITS)]; 20 | #endif /* defined(EXHAUSTIVE_TEST_ORDER) */ 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif /* SECP256K1_PRECOMPUTED_ECMULT_GEN_H */ 27 | -------------------------------------------------------------------------------- /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 https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 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 /* SECP256K1_SCALAR_REPR_H */ 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 https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 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 /* SECP256K1_SCALAR_REPR_H */ 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 https://www.opensource.org/licenses/mit-license.php.* 5 | ***********************************************************************/ 6 | 7 | #ifndef SECP256K1_SCALAR_REPR_H 8 | #define SECP256K1_SCALAR_REPR_H 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef uint32_t secp256k1_scalar; 14 | 15 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) (d0) 16 | 17 | #endif /* SECP256K1_SCALAR_REPR_H */ 18 | -------------------------------------------------------------------------------- /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 https://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 | /** Secure overwrite a buffer (possibly containing secret data) with zero-bytes. The write 12 | * operation will not be optimized out by the compiler. */ 13 | void memory_cleanse(void *ptr, size_t len); 14 | 15 | #endif // BITCOIN_SUPPORT_CLEANSE_H 16 | -------------------------------------------------------------------------------- /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 https://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 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/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 https://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, "ECC sanity test"); 18 | } 19 | 20 | BOOST_AUTO_TEST_SUITE_END() 21 | -------------------------------------------------------------------------------- /src/test/test_random.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 https://www.opensource.org/licenses/mit-license.php . 5 | 6 | #ifndef BITCOIN_TEST_TEST_RANDOM_H 7 | #define BITCOIN_TEST_TEST_RANDOM_H 8 | 9 | #include "random.h" 10 | 11 | extern uint256 insecure_rand_seed; 12 | extern FastRandomContext insecure_rand_ctx; 13 | 14 | static inline void seed_insecure_rand(bool fDeterministic = false) 15 | { 16 | if (fDeterministic) { 17 | insecure_rand_seed = uint256(); 18 | } else { 19 | insecure_rand_seed = GetRandHash(); 20 | } 21 | insecure_rand_ctx = FastRandomContext(insecure_rand_seed); 22 | } 23 | 24 | static inline uint32_t insecure_rand(void) 25 | { 26 | return insecure_rand_ctx.rand32(); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/test/test_util.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_TEST_TEST_UTIL_H 2 | #define BITCOIN_TEST_TEST_UTIL_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | UniValue read_json(const std::string& jsondata); 9 | unsigned int ParseScriptFlags(std::string strFlags); 10 | std::string FormatScriptFlags(unsigned int flags); 11 | UniValue createArgs(int nRequired, const char* address1 = NULL, const char* address2 = NULL); 12 | UniValue CallRPC(std::string args); 13 | 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /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 https://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/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.md: -------------------------------------------------------------------------------- 1 | 2 | # UniValue 3 | 4 | ## Summary 5 | 6 | A universal value class, with JSON encoding and decoding. 7 | 8 | UniValue is an abstract data type that may be a null, boolean, string, 9 | number, array container, or a key/value dictionary container, nested to 10 | an arbitrary depth. 11 | 12 | This class is aligned with the JSON standard, [RFC 13 | 7159](https://tools.ietf.org/html/rfc7159.html). 14 | 15 | ## Library usage 16 | 17 | This is a fork of univalue used by Bitcoin Core. It is not maintained for usage 18 | by other projects. Notably, the API may break in non-backward-compatible ways. 19 | 20 | Other projects looking for a maintained library should use the upstream 21 | univalue at https://github.com/jgarzik/univalue. 22 | -------------------------------------------------------------------------------- /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 | 2 | object 3 | unitester 4 | test_json 5 | no_nul 6 | 7 | *.trs 8 | *.log 9 | -------------------------------------------------------------------------------- /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/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/univalue/test/fail40.json -------------------------------------------------------------------------------- /src/univalue/test/fail41.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ycashfoundation/ycash/a1b0f39a4338c58be1e7509423d255c153d7975e/src/univalue/test/fail41.json -------------------------------------------------------------------------------- /src/univalue/test/fail42.json: -------------------------------------------------------------------------------- 1 | ["before nul byte"]"after nul byte" 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail44.json: -------------------------------------------------------------------------------- 1 | "This file ends without a newline or close-quote. -------------------------------------------------------------------------------- /src/univalue/test/fail45.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] 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/pass4.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] 2 | -------------------------------------------------------------------------------- /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 https://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/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 https://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/wallet/rpcwallet.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #ifndef BITCOIN_WALLET_RPCWALLET_H 6 | #define BITCOIN_WALLET_RPCWALLET_H 7 | 8 | #include "policy/fees.h" // for DEFAULT_FEE 9 | 10 | class CRPCTable; 11 | 12 | void RegisterWalletRPCCommands(CRPCTable &tableRPC); 13 | 14 | #endif //BITCOIN_WALLET_RPCWALLET_H 15 | -------------------------------------------------------------------------------- /src/wallet/test/wallet_test_fixture.cpp: -------------------------------------------------------------------------------- 1 | #include "wallet/test/wallet_test_fixture.h" 2 | 3 | #include "rpc/server.h" 4 | #include "wallet/db.h" 5 | #include "wallet/wallet.h" 6 | 7 | WalletTestingSetup::WalletTestingSetup(): TestingSetup() 8 | { 9 | bitdb.MakeMock(); 10 | 11 | bool fFirstRun; 12 | pwalletMain = new CWallet("wallet_test.dat"); 13 | pwalletMain->LoadWallet(fFirstRun); 14 | RegisterValidationInterface(pwalletMain); 15 | 16 | RegisterWalletRPCCommands(tableRPC); 17 | } 18 | 19 | WalletTestingSetup::~WalletTestingSetup() 20 | { 21 | UnregisterValidationInterface(pwalletMain); 22 | delete pwalletMain; 23 | pwalletMain = NULL; 24 | 25 | bitdb.Flush(true); 26 | bitdb.Reset(); 27 | } 28 | -------------------------------------------------------------------------------- /src/wallet/test/wallet_test_fixture.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 4 | 5 | #ifndef BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H 6 | #define BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H 7 | 8 | #include "test/test_bitcoin.h" 9 | 10 | /** Testing setup and teardown for wallet. 11 | */ 12 | struct WalletTestingSetup: public TestingSetup { 13 | WalletTestingSetup(); 14 | ~WalletTestingSetup(); 15 | }; 16 | 17 | #endif // BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H 18 | -------------------------------------------------------------------------------- /src/warnings.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2016 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . 5 | 6 | #ifndef BITCOIN_WARNINGS_H 7 | #define BITCOIN_WARNINGS_H 8 | 9 | #include 10 | #include 11 | 12 | void SetMiscWarning(const std::string& strWarning, int64_t timestamp); 13 | std::pair GetMiscWarning(); 14 | void SetfLargeWorkForkFound(bool flag); 15 | bool GetfLargeWorkForkFound(); 16 | void SetfLargeWorkInvalidChainFound(bool flag); 17 | bool GetfLargeWorkInvalidChainFound(); 18 | std::pair GetWarnings(const std::string& strFor); 19 | 20 | static const bool DEFAULT_TESTSAFEMODE = false; 21 | 22 | #endif // BITCOIN_WARNINGS_H 23 | -------------------------------------------------------------------------------- /src/zcash/Zcash.h: -------------------------------------------------------------------------------- 1 | #ifndef ZCASH_ZCASH_ZCASH_H 2 | #define ZCASH_ZCASH_ZCASH_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 SAPLING_INCREMENTAL_MERKLE_TREE_DEPTH 32 10 | 11 | #define NOTEENCRYPTION_AUTH_BYTES 16 12 | 13 | #define ZC_NOTEPLAINTEXT_LEADING 1 14 | #define ZC_V_SIZE 8 15 | #define ZC_RHO_SIZE 32 16 | #define ZC_R_SIZE 32 17 | #define ZC_MEMO_SIZE 512 18 | #define ZC_DIVERSIFIER_SIZE 11 19 | #define ZC_JUBJUB_POINT_SIZE 32 20 | #define ZC_JUBJUB_SCALAR_SIZE 32 21 | 22 | #define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE) 23 | 24 | #define ZC_SAPLING_ENCPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_DIVERSIFIER_SIZE + ZC_V_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE) 25 | #define ZC_SAPLING_OUTPLAINTEXT_SIZE (ZC_JUBJUB_POINT_SIZE + ZC_JUBJUB_SCALAR_SIZE) 26 | 27 | #define ZC_SAPLING_ENCCIPHERTEXT_SIZE (ZC_SAPLING_ENCPLAINTEXT_SIZE + NOTEENCRYPTION_AUTH_BYTES) 28 | #define ZC_SAPLING_OUTCIPHERTEXT_SIZE (ZC_SAPLING_OUTPLAINTEXT_SIZE + NOTEENCRYPTION_AUTH_BYTES) 29 | 30 | #endif // ZCASH_ZCASH_ZCASH_H 31 | -------------------------------------------------------------------------------- /src/zcash/prf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Zcash uses SHA256Compress as a PRF for various components 3 | within the zkSNARK circuit. 4 | */ 5 | 6 | #ifndef ZCASH_ZCASH_PRF_H 7 | #define ZCASH_ZCASH_PRF_H 8 | 9 | #include "uint256.h" 10 | #include "uint252.h" 11 | 12 | #include 13 | 14 | //! Sprout functions 15 | uint256 PRF_addr_a_pk(const uint252& a_sk); 16 | uint256 PRF_addr_sk_enc(const uint252& a_sk); 17 | uint256 PRF_nf(const uint252& a_sk, const uint256& rho); 18 | uint256 PRF_pk(const uint252& a_sk, size_t i0, const uint256& h_sig); 19 | uint256 PRF_rho(const uint252& phi, size_t i0, const uint256& h_sig); 20 | 21 | //! Sapling functions 22 | uint256 PRF_ask(const uint256& sk); 23 | uint256 PRF_nsk(const uint256& sk); 24 | uint256 PRF_ovk(const uint256& sk); 25 | uint256 PRF_rcm(const uint256& rseed); 26 | uint256 PRF_esk(const uint256& rseed); 27 | 28 | const char PRF_ASK_TAG = 0; 29 | const char PRF_NSK_TAG = 1; 30 | const char PRF_OVK_TAG = 2; 31 | const char PRF_RCM_TAG = 4; 32 | const char PRF_ESK_TAG = 5; 33 | 34 | std::array default_diversifier(const uint256& sk); 35 | 36 | #endif // ZCASH_ZCASH_PRF_H 37 | -------------------------------------------------------------------------------- /src/zcash/util.h: -------------------------------------------------------------------------------- 1 | #ifndef ZCASH_ZCASH_UTIL_H 2 | #define ZCASH_ZCASH_UTIL_H 3 | 4 | #include 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_ZCASH_UTIL_H 12 | -------------------------------------------------------------------------------- /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 https://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::NotifyBlock(const CBlock &) 20 | { 21 | return true; 22 | } 23 | 24 | bool CZMQAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/) 25 | { 26 | return true; 27 | } 28 | -------------------------------------------------------------------------------- /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 https://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 | -------------------------------------------------------------------------------- /test/lint/lint-all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright (c) 2017-2019 The Bitcoin Core developers 4 | # Distributed under the MIT software license, see the accompanying 5 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 6 | # 7 | # This script runs all contrib/devtools/lint-*.sh files, and fails if any exit 8 | # with a non-zero status code. 9 | 10 | # This script is intentionally locale-dependent by not setting "export LC_ALL=C". 11 | # in order to allow for the executed lint scripts to opt in or opt out of locale 12 | # dependence themselves. 13 | 14 | set -u 15 | 16 | SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}") 17 | LINTALL=$(basename "${BASH_SOURCE[0]}") 18 | 19 | EXIT_CODE=0 20 | 21 | for f in "${SCRIPTDIR}"/lint-*.sh; do 22 | if [ "$(basename "$f")" != "$LINTALL" ]; then 23 | if ! "$f"; then 24 | echo "^---- failure generated from $f" 25 | EXIT_CODE=1 26 | fi 27 | fi 28 | done 29 | 30 | exit ${EXIT_CODE} 31 | -------------------------------------------------------------------------------- /test/lint/lint-python-utf8-encoding.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright (c) 2018 The Bitcoin Core developers 4 | # Distributed under the MIT software license, see the accompanying 5 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 6 | # 7 | # Make sure we explicitly open all text files using UTF-8 (or ASCII) encoding to 8 | # avoid potential issues on the BSDs where the locale is not always set. 9 | 10 | export LC_ALL=C 11 | EXIT_CODE=0 12 | OUTPUT=$(git grep " open(" -- "*.py" | grep -vE "encoding=.(ascii|utf8|utf-8)." | grep -vE "open\([^,]*, ['\"][^'\"]*b[^'\"]*['\"]") 13 | if [[ ${OUTPUT} != "" ]]; then 14 | echo "Python's open(...) seems to be used to open text files without explicitly" 15 | echo "specifying encoding=\"utf8\":" 16 | echo 17 | echo "${OUTPUT}" 18 | EXIT_CODE=1 19 | fi 20 | exit ${EXIT_CODE} 21 | -------------------------------------------------------------------------------- /test/lint/lint-shebang.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright (c) 2018 The Bitcoin Core developers 4 | # Distributed under the MIT software license, see the accompanying 5 | # file COPYING or https://www.opensource.org/licenses/mit-license.php . 6 | # 7 | # Assert expected shebang lines 8 | 9 | export LC_ALL=C 10 | EXIT_CODE=0 11 | for PYTHON_FILE in $(git ls-files -- "*.py"); do 12 | if [[ $(head -c 2 "${PYTHON_FILE}") == "#!" && 13 | $(head -n 1 "${PYTHON_FILE}") != "#!/usr/bin/env python3" ]]; then 14 | echo "Missing shebang \"#!/usr/bin/env python3\" in ${PYTHON_FILE} (do not use python or python2)" 15 | EXIT_CODE=1 16 | fi 17 | done 18 | for SHELL_FILE in $(git ls-files -- "*.sh"); do 19 | if [[ $(head -n 1 "${SHELL_FILE}") != "#!/usr/bin/env bash" && 20 | $(head -n 1 "${SHELL_FILE}") != "#!/bin/sh" ]]; then 21 | echo "Missing expected shebang \"#!/usr/bin/env bash\" or \"#!/bin/sh\" in ${SHELL_FILE}" 22 | EXIT_CODE=1 23 | fi 24 | done 25 | exit ${EXIT_CODE} 26 | -------------------------------------------------------------------------------- /zcutil/afl/zcash-wrapper-clang: -------------------------------------------------------------------------------- 1 | zcash-wrapper -------------------------------------------------------------------------------- /zcutil/afl/zcash-wrapper-clang++: -------------------------------------------------------------------------------- 1 | zcash-wrapper -------------------------------------------------------------------------------- /zcutil/afl/zcash-wrapper-g++: -------------------------------------------------------------------------------- 1 | zcash-wrapper -------------------------------------------------------------------------------- /zcutil/afl/zcash-wrapper-gcc: -------------------------------------------------------------------------------- 1 | zcash-wrapper -------------------------------------------------------------------------------- /zcutil/cleanup-tags.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env 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 | export LC_ALL=C 8 | set -exu -o pipefail 9 | 10 | ZCASH_TAG_RGX='^v[0-9]+.[0-9]+.[0-9]+.z[0-9]+' 11 | MAXJOBS=7 12 | 13 | i=0 14 | 15 | for nonzctag in $(git ls-remote origin \ 16 | | grep refs/tags/ \ 17 | | grep -v '\^{}$' \ 18 | | sed 's,^.*refs/tags/,,' \ 19 | | grep -Ev "$ZCASH_TAG_RGX" 20 | ) 21 | do 22 | git push origin ":refs/tags/${nonzctag}" & 23 | i="$(expr "$i" + 1)" 24 | [ "$i" -ge "$MAXJOBS" ] && wait -n 25 | done 26 | 27 | wait 28 | -------------------------------------------------------------------------------- /zcutil/distclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2020 The Zcash developers 3 | 4 | export LC_ALL=C 5 | 6 | zcutil/clean.sh 7 | 8 | rm -rf depends/*-*-* 9 | rm -rf depends/built 10 | rm -rf depends/sources 11 | 12 | rm -rf afl-temp 13 | rm -rf src/fuzzing/*/output 14 | 15 | # These are not in clean.sh because they are only generated when building dependencies. 16 | rm -f zcutil/bin/db_* 17 | rmdir zcutil/bin 2>/dev/null || true 18 | -------------------------------------------------------------------------------- /zcutil/libfuzzer/zcash-wrapper-clang: -------------------------------------------------------------------------------- 1 | zcash-wrapper -------------------------------------------------------------------------------- /zcutil/libfuzzer/zcash-wrapper-clang++: -------------------------------------------------------------------------------- 1 | zcash-wrapper --------------------------------------------------------------------------------