Commit Graph

1246 Commits

Author SHA1 Message Date
Taylor Hornby
2902ac7ce8 Use libsodium's s < L check, instead checking that libsodium checks that. 2016-08-18 16:38:20 -06:00
Patrick Strateman
e279e5f90a Record nMinPingUsecTime 2016-08-15 19:31:14 -06:00
Simon
10d2c57c0d Replace calls to GetHash() with GetTxid() for transaction objects.
Where the caller intends to receive a transaction id and not a double
SHA256 hash.
2016-07-26 17:13:03 -07:00
Taylor Hornby
67f0243533 Remove in-band error signalling from SignatureHash, fixing the SIGHASH_SINGLE bug. 2016-07-19 16:36:35 -06:00
Daira Hopwood
4bc00dc141 Bucket -> note.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-07-18 10:06:18 -06:00
Sean Bowe
cc01120a17 Rename more usage of serial. 2016-07-18 10:06:18 -06:00
Sean Bowe
b7e4abd6f7 Rename some usage of 'pour'. 2016-07-18 10:06:18 -06:00
Sean Bowe
bb64be52fe Rename mapSerials to mapNullifiers. 2016-07-18 10:06:18 -06:00
Sean Bowe
d90e46ba8d Renaming SetSerial to SetNullifier. 2016-07-18 10:06:18 -06:00
Sean Bowe
ee964faf3d Rename HavePourRequirements to HaveJoinSplitRequirements. 2016-07-18 10:06:18 -06:00
Sean Bowe
942bc46756 Rename GetPourValueIn to GetJoinSplitValueIn 2016-07-18 10:06:18 -06:00
Sean Bowe
bfeaf0049a Rename JSDescription's serials to nullifiers. 2016-07-18 10:06:18 -06:00
Sean Bowe
8675d94b63 Rename vpour to vjoinsplit. 2016-07-18 10:06:18 -06:00
Sean Bowe
a8c68ffe99 Rename CPourTx to JSDescription. 2016-07-18 10:06:18 -06:00
Taylor Hornby
948d4e6c10 Split JoinSplit proof verification out of CheckTransaction. 2016-06-23 16:35:31 -06:00
zkbot
6793168a2e Auto merge of #1017 - ebfull:coinbase-must-be-protected, r=ebfull
Enforce that coinbases must be protected

This PR forces miners to place their funds in the private value transfer system, making "transparent coins" opt-in for users, and increasing privacy for all participants on a systemic level.

Closes #101.
2016-06-15 03:06:23 +00:00
Sean Bowe
d212ba320b Disable enforced coinbase protection in miner_tests. 2016-06-14 15:18:52 -06:00
Sean Bowe
a180d0a6c6 Rename to fCoinbaseMustBeProtected. 2016-06-14 15:16:34 -06:00
Sean Bowe
89f3cd11c7 Ensure NonContextualCheckInputs runs before routines in ContextualCheckInputs. 2016-06-14 12:41:32 -06:00
Sean Bowe
542da618df Enforce remaining softfork activation rules unconditionally. 2016-06-14 12:34:38 -06:00
Sean Bowe
b3be1ef529 Enforce BIP16 and BIP30 unconditionally to all blocks. 2016-06-14 09:49:48 -06:00
Sean Bowe
c0dde76d8a Disable coinbase-must-be-protected rule on regtest. 2016-06-13 12:23:55 -06:00
Sean Bowe
1d38795f50 Prevent coinbases from being spent to transparent outputs. 2016-06-13 11:58:10 -06:00
Sean Bowe
2c901fd87d Refactor contextual and noncontextual input checks. 2016-06-13 11:52:46 -06:00
Sean Bowe
10df6fb3df Rename CheckInputs to ContextualCheckInputs since it relies on a global variable
and assumes calling conditions.
2016-06-13 11:45:41 -06:00
zkbot
47e6645005 Auto merge of #1009 - ThisIsNotOfficialCodeItsJustForks:t171-hard-fork-alerts-and-tests, r=ebfull
Enable -alertnotify for hard fork detection. Test it.

Closes #171. Closes #131.
2016-06-12 18:04:53 +00:00
Jack Grigg
d4388ed52b Updated a hard-coded number of blocks to account for decreased block interval 2016-06-10 12:02:49 +12:00
Jack Grigg
45e3deea8a Decrease block interval to 2.5 minutes 2016-06-10 11:45:04 +12:00
Taylor Hornby
57c074e1e4 Enable -alertnotify for hard fork detection. Test it. 2016-06-09 13:48:04 -06:00
Jack Grigg
a5150a156e Set -relaypriority default to false
This enables spending of individual coins during mining slow start.

Closes #904.
2016-06-07 21:11:57 +12:00
zkbot
19769ba6c5 Auto merge of #976 - ebfull:implement-joinsplit-signatures, r=ebfull
Signing pours with ed25519

This is an alternative to #964 which uses ed25519 instead of secp256k1, and avoids the separate hash for fitting the public key into the `h_sig` block. It's based on @defuse's work in that branch.

Closes #808.
2016-05-31 03:46:30 +00:00
Sean Bowe
7c68cc0747 Add additional assertions. 2016-05-30 21:38:44 -06:00
Sean Bowe
e8af0028eb Change error for invalid joinsplit signature for consistency. 2016-05-30 19:38:01 -06:00
Sean Bowe
69c0f9128c Enforce that the S value of the ed25519 signature is smaller than the group order to prevent malleability attacks. 2016-05-30 11:05:55 -06:00
Sean Bowe
320f2cc7e0 Switch to Ed25519 for cryptographic binding of joinsplits to transactions. 2016-05-30 11:05:55 -06:00
Taylor Hornby
b48122b57b Fix tests for JoinSplit signatures 2016-05-30 11:05:43 -06:00
Taylor Hornby
a138f81404 Implement signature verification in CheckTransaction 2016-05-30 11:05:43 -06:00
zkbot
b1f699660f Auto merge of #887 - str4d:mining-slow-start, r=ebfull
Implement mining slow start

Closes #762.
2016-05-27 02:15:24 +00:00
Sean Bowe
2dc3599271 Transplant of libzcash. 2016-05-12 16:44:47 -06:00
Sean Bowe
2140639309 Remove scriptPubKey/scriptSig from CPourTx, and add randomSeed. 2016-05-12 16:44:30 -06:00
Jack Grigg
bcb34c0802 Implement mining slow start with a linear ramp 2016-05-10 23:03:18 +12:00
Sean Bowe
434f328446 Integrate new incremental merkle tree implementation into consensus. 2016-04-28 16:07:52 -06:00
Taylor Hornby
6ad4db2253 Add check that vpubs are not both nonzero and test it. 2016-04-27 14:12:30 -06:00
Sean Bowe
f3ffa3d27f Implementation of Founders' Reward.
All blocks before the first subsidy halving block, with the exception of
the genesis block, must contain an output which sends 20% of the block
subsidy value to a scriptPubKey `FOUNDERS_REWARD_SCRIPT`.
2016-04-08 14:40:28 -06:00
Jack Grigg
fdda3c5085 Use Equihash for Proof-of-Work
The main and test networks are configured to use parameters that are currently
low-memory but usable with the basic solver; they will be increased once the
solver is optimised. The regtest network is configured to have extremely low
memory usage for speed.

Note that Bitcoin's double-hasher is used for the difficulty check. This does
not match the paper, but is simpler than changing the block header
serialization. Single hashing is kept for the EquiHash solver because there is
no requirement on execution time there, only on memory usage.
2016-04-08 13:56:00 +12:00
Sean Bowe
d66877afb3 Added mapSerials consensus rules to prohibit double-spending. 2016-01-19 14:36:09 -07:00
Sean Bowe
03bff15fe2 Enforce zk-SNARK validity during consensus. 2016-01-19 14:36:09 -07:00
Sean Bowe
a8ac403db0 Added mapAnchors consensus rules, finished zcrawpour/zcrawreceive.
Some specifics on consensus changes:
* Transactions must be anchored to a real anchor in the chain.
* Anchors are pushed and popped during ConnectBlock/DisconnectBlock as appropriate.
* DisconnectTip triggers evictions, under some circumstances, of transactions in the
  mempool which are anchored to roots that are no longer valid.
* Commitments append to the tree at the current best root during ConnectBlock.
2016-01-19 14:36:04 -07:00
Sean Bowe
f512cf7c7b Added value balance consensus enforcement for pours. 2016-01-19 14:36:04 -07:00
Sean Bowe
69761d8269 Primitive, context-free consensus changes for CPourTx
* PourTxs cannot appear in coinbase transactions.
* Transactions can only contain empty vin/vouts if they contain a PourTx.
* PourTx public values must be well-formed (not negative or too large).
* Transactions cannot have the same serial twice throughout all PourTxs.
2016-01-19 14:36:04 -07:00