aboutsummaryrefslogtreecommitdiff
path: root/src/script/standard.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge #13429: Return the script type from SolverWladimir J. van der Laan2018-08-251-3/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 984d72ec659361d8c1a6f3c6864e839a807817a7 Return the script type from Solver (Ben Woosley) Pull request description: Because false is synonymous with TX_NONSTANDARD, this conveys the same information and makes the handling explicitly based on script type, simplifying each call site. Prior to this change it was common for the return value to be ignored, or for the return value and TX_NONSTANDARD to be redundantly handled. Tree-SHA512: 31864f856b8cb75f4b782d12678070e8b1cfe9665c6f57cfb25e7ac8bcea8a22f9a78d7c8cf0101c841f2a612400666fb91798bffe88de856e98b873703b0965
| * Return the script type from SolverBen Woosley2018-07-221-3/+2
| | | | | | | | | | | | | | | | | | Because false is synonymous with TX_NONSTANDARD, this conveys the same information and makes the handling explicitly based on script type, simplifying each call site. Prior to this change it was common for the return value to be ignored, or for the return value and TX_NONSTANDARD to be redundantly handled.
* | Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|/
* Add P2WSH destination helper and use it instead of manual hashingPieter Wuille2018-06-171-0/+1
|
* Make CScript -> CScriptID conversion explicitPieter Wuille2018-04-181-1/+1
|
* Merge #11403: SegWit wallet supportJonas Schnelli2018-01-101-2/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b224a47a1 Add address_types test (Pieter Wuille) 7ee54fd7c Support downgrading after recovered keypool witness keys (Pieter Wuille) 940a21932 SegWit wallet support (Pieter Wuille) f37c64e47 Implicitly know about P2WPKH redeemscripts (Pieter Wuille) 57273f2b3 [test] Serialize CTransaction with witness by default (Pieter Wuille) cf2c0b6f5 Support P2WPKH and P2SH-P2WPKH in dumpprivkey (Pieter Wuille) 37c03d3e0 Support P2WPKH addresses in create/addmultisig (Pieter Wuille) 3eaa003c8 Extend validateaddress information for P2SH-embedded witness (Pieter Wuille) 30a27dc5b Expose method to find key for a single-key destination (Pieter Wuille) 985c79552 Improve witness destination types and use them more (Pieter Wuille) cbe197470 [refactor] GetAccount{PubKey,Address} -> GetAccountDestination (Pieter Wuille) 0c8ea6380 Abstract out IsSolvable from Witnessifier (Pieter Wuille) Pull request description: This implements a minimum viable implementation of SegWit wallet support, based on top of #11389, and includes part of the functionality from #11089. Two new configuration options are added: * `-addresstype`, with options `legacy`, `p2sh`, and `bech32`. It controls what kind of addresses are produced by `getnewaddress`, `getaccountaddress`, and `createmultisigaddress`. * `-changetype`, with the same options, and by default equal to `-addresstype`, that controls what kind of change is used. All wallet private and public keys can be used for any type of address. Support for address types dependent on different derivation paths will need a major overhaul of how our internal detection of outputs work. I expect that that will happen for a next major version. The above also applies to imported keys, as having a distinction there but not for normal operations is a disaster for testing, and probably for comprehension of users. This has some ugly effects, like needing to associate the provided label to `importprivkey` with each style address for the corresponding key. To deal with witness outputs requiring a corresponding redeemscript in wallet, three approaches are used: * All SegWit addresses created through `getnewaddress` or multisig RPCs explicitly get their redeemscripts added to the wallet file. This means that downgrading after creating a witness address will work, as long as the wallet file is up to date. * All SegWit keys in the wallet get an _implicit_ redeemscript added, without it being written to the file. This means recovery of an old backup will work, as long as you use new software. * All keypool keys that are seen used in transactions explicitly get their redeemscripts added to the wallet files. This means that downgrading after recovering from a backup that includes a witness address will work. These approaches correspond to solutions 3a, 1a, and 5a respectively from https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2. As argued there, there is no full solution for dealing with the case where you both downgrade and restore a backup, so that's also not implemented. `dumpwallet`, `importwallet`, `importmulti`, `signmessage` and `verifymessage` don't work with SegWit addresses yet. They're remaining TODOs, for this PR or a follow-up. Because of that, several tests unexpectedly run with `-addresstype=legacy` for now. Tree-SHA512: d425dbe517c0422061ab8dacdc3a6ae47da071450932ed992c79559d922dff7b2574a31a8c94feccd3761c1dffb6422c50055e6dca8e3cf94a169bc95e39e959
| * Extend validateaddress information for P2SH-embedded witnessPieter Wuille2018-01-031-0/+4
| | | | | | | | | | This adds new fields 'pubkeys' and 'embedded' to the RPC's output, and improves the documentation for previously added 'witness_version' and 'witness_program' fields.
| * Improve witness destination types and use them morePieter Wuille2018-01-031-2/+16
| |
* | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|/
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Implement BIP173 addresses and testsPieter Wuille2017-09-281-4/+33
|
* Introduce wrappers around CBitcoinAddressPieter Wuille2017-09-061-1/+4
| | | | | | | This patch removes the need for the intermediary Base58 type CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination function that directly operate on the conversion between strings and CTxDestination.
* Comments: More comments on functions/globals in standard.h.Jim Posen2017-08-181-4/+58
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* BIP143: Signing logicPieter Wuille2016-06-221-0/+3
|
* [doc] Fix doxygen comments for membersMarcoFalke2016-04-031-1/+1
|
* Get rid of inaccurate ScriptSigArgsExpectedPieter Wuille2016-02-011-1/+0
| | | | (cherry picked from commit 52b29dca7670c3f6d2ab918c0fff1d17c4e494ad)
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* [trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke2015-11-281-0/+2
| | | | | * DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
* Constrain constant values to a single location in codeLuke Dashjr2015-11-281-0/+1
|
* Accept any sequence of PUSHDATAs in OP_RETURN outputsPeter Todd2015-10-011-1/+1
| | | | | | | | | | | | Previously only one PUSHDATA was allowed, needlessly limiting applications such as matching OP_RETURN contents with bloom filters that operate on a per-PUSHDATA level. Now any combination that passes IsPushOnly() is allowed, so long as the total size of the scriptPubKey is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings) Also, this fixes the odd bug where previously the PUSHDATA could be replaced by any single opcode, even sigops consuming opcodes such as CHECKMULTISIG. (20 sigops!)
* Also remove pay-2-pubkey from watch when adding a priv keyMatt Corallo2015-07-201-0/+1
|
* Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr2015-06-261-1/+0
| | | | | | | | - [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
* Policy: MOVEONLY: Create policy/policy.h with some constantsJorge Timón2015-06-261-17/+0
|
* Enable CHECKLOCKTIMEVERIFY as a standard script verify flagPeter Todd2015-06-221-1/+2
| | | | | | | Transactions that fail CLTV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CLTV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CLTV for production use.
* Merge pull request #5286Wladimir J. van der Laan2015-02-031-1/+1
|\ | | | | | | | | 44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon) a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
| * Change the default maximum OP_RETURN size to 80 bytesFlavien Charlon2014-11-141-1/+1
| | | | | | | | | | The value can be changed through the '-datacarriersize' option, this is modifying the default value for that option.
* | BIP66 changeover logicPieter Wuille2015-02-011-0/+1
| |
* | Merge pull request #5143Wladimir J. van der Laan2015-01-081-1/+2
|\ \ | | | | | | | | | | | | | | | da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille) b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille) ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
| * | Make SCRIPT_VERIFY_CLEANSTACK a standardness requirementPieter Wuille2014-11-251-1/+2
| | |
* | | Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-1/+1
| | | | | | | | | | | | | | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* | | Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
|/ / | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* / Discourage NOPs reserved for soft-fork upgradesPeter Todd2014-11-171-1/+2
|/ | | | | | | | | | | | | | | | | NOP1 to NOP10 are reserved for future soft-fork upgrades. In the event of an upgrade such NOPs have *VERIFY behavior, meaning that if their arguments are not correct the script fails. Discouraging these NOPs by rejecting transactions containing them from the mempool ensures that we'll never accept transactions, nor mine blocks, with scripts that are now invalid according to the majority of hashing power even if we're not yet upgraded. Previously this wasn't an issue as the IsStandard() rules didn't allow upgradable NOPs anyway, but 7f3b4e95 relaxed the IsStandard() rules for P2SH redemptions allowing any redeemScript to be spent. We *do* allow upgradable NOPs in scripts so long as they are not executed. This is harmless as there is no opportunity for the script to be invalid post-upgrade.
* Make comments in /src/script doxygen compatibleMichael Ford2014-11-101-13/+18
|
* minor code style cleanup after recent mergesPhilip Kaufmann2014-11-041-2/+2
| | | | | - add a missing license header - correct some header orderings etc.
* Merge pull request #5196Wladimir J. van der Laan2014-11-041-3/+3
|\ | | | | | | 8473862 Fix all header defines (Pavel Janík)
| * Fix all header definesPavel Janík2014-11-031-3/+3
| |
* | Merge pull request #5162Wladimir J. van der Laan2014-11-041-2/+2
|\ \ | |/ |/| | | | | | | d2e74c5 boost: moveonly: split CPubKey and friends to new files (Cory Fields) 78c228c boost: moveonly: move BIP32Hash to hash.h (Cory Fields) 900078a boost: moveonly: create eccryptoverify.h|cpp and move helper functions there (Cory Fields)
| * boost: moveonly: split CPubKey and friends to new filesCory Fields2014-10-311-2/+2
| |
* | Merge pull request #5077Wladimir J. van der Laan2014-10-311-0/+1
|\ \ | |/ |/| | | 2aa6329 Enable customising node policy for datacarrier data size with a -datacarriersize option (Luke Dashjr)
| * Enable customising node policy for datacarrier data size with a ↵Luke Dashjr2014-10-271-0/+1
| | | | | | | | -datacarriersize option
* | Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille2014-10-251-0/+1
|/ | | | | Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
* script: add a slew of includes all around and drop includes from script.hCory Fields2014-10-171-0/+3
| | | | Lots of files ended up with indirect includes from script.h.
* script: move CScriptID to standard.h and add a ctor for creating them from ↵Cory Fields2014-10-171-0/+9
| | | | | | | | | | | | | | | | CScripts This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash();
* Move CTxDestination from script/script to script/standardPieter Wuille2014-09-161-0/+17
|
* cleanup new script files (no code changes)Philip Kaufmann2014-09-141-3/+3
| | | | | | - add missing header end comments - ensure alphabetical ordering - update copyright year and license
* Separate script/standardjtimon2014-09-081-0/+56