Commit graph

60 commits

Author SHA1 Message Date
Gregory Maxwell
b04f301c8e Have bitcoind recommend a secure RPC password. Increase invalid password delay.
Help users avoid insecure configurations a bit by recommending a
secure RPC password and increasing the incorrect password delay.

This may open up a RPC DOS for users with exposed RPC ports and
short passwords. Since users shouldn't have exposed RPC ports OR
short passwords, the DOS risk is preferable to the compromise
risk.

Also logs the client IP address for incorrect attempts.
2012-02-05 02:58:35 -05:00
Luke Dashjr
2bc4fd609c Bitcoin-Qt signmessage GUI (pull request #582) 2012-01-27 08:41:55 +01:00
Gavin Andresen
dc77dce07c Fixed addmultisigaddress if looking up public keys from locked wallets. 2012-01-23 12:04:34 -05:00
Forrest Voight
ab84512258 Added mintime and curtime to RPC getmemorypool 2012-01-14 19:23:37 -05:00
Forrest Voight
52a3d2635c Separated COINBASE_FLAGS out into main.h and made RPC getmemorypool return it 2012-01-14 19:22:24 -05:00
Gavin Andresen
9e8818ec9d Remove base58 encoding from validateaddress/addmultisigaddress
base58-encoding of full/compressed public keys needs more thought; it probably makes sense to define a base58 encoding that includes a version byte and a checksum. So just support hex and bitcoin-address encodings for now.
2012-01-13 10:22:24 -05:00
Gavin Andresen
922e8e2929 Replace OP_EVAL (BIP 12) with Pay-to-script-hash (BIP 16). 2012-01-13 10:22:23 -05:00
Gavin Andresen
f290a649f9 Merge branch 'getmininginfo' of https://github.com/luke-jr/bitcoin 2012-01-13 10:06:05 -05:00
Gavin Andresen
a1de57a063 Compile with extra warnings turned on. And more makefile/code tidying up.
This turns on most gcc warnings, and removes some unused variables and other code that triggers warnings.
Exceptions are:
 -Wno-sign-compare : triggered by lots of comparisons of signed integer to foo.size(), which is unsigned.
 -Wno-char-subscripts : triggered by the convert-to-hex functions (I may fix this in a future commit).
2012-01-12 20:02:47 -05:00
Luke Dashjr
340f0876ea collect more info on tx pooling and block finding for getmininginfo 2012-01-12 19:47:39 -05:00
Luke Dashjr
6950bb6200 Add new "getmininginfo" JSON-RPC method, with mining-only fields moved out of "getinfo" 2012-01-12 19:47:23 -05:00
Pieter Wuille
11529c6e4f Compressed pubkeys
This patch enabled compressed pubkeys when -compressedpubkeys is passed.
These are 33 bytes instead of 65, and require only marginally more CPU
power when verifying. Compressed pubkeys have a different corresponding
address, so it is determined at generation. When -compressedpubkeys is
given, all newly generated addresses will use a compressed key, while
older/other addresses keep using normal keys. Unpatched clients will
relay and verify these transactions.
2012-01-09 15:18:19 +01:00
Gavin Andresen
8a53cb0b9d New RPC commands: getblockhash and getblock 2011-12-23 16:26:38 -05:00
Gavin Andresen
2e17ac83c6 Fix broken ExtractAddress (refactored, made callers check for addresses in keystore if they care) 2011-12-22 15:57:31 -05:00
Wladimir J. van der Laan
bde280b9a4 Revert "Use standard C99 (and Qt) types for 64-bit integers"
This reverts commit 21d9f36781.
2011-12-21 22:33:19 +01:00
Luke Dashjr
21d9f36781 Use standard C99 (and Qt) types for 64-bit integers 2011-12-20 16:52:59 -05:00
Gavin Andresen
595925592d Merge branch 'op_eval' 2011-12-20 14:43:31 -05:00
Gavin Andresen
26ce92b352 Use std::numeric_limits<> for typesafe INT_MAX/etc 2011-12-19 19:10:34 -05:00
Gavin Andresen
bafb43d6c1 Merge branch 'txn_block_info' of https://github.com/luke-jr/bitcoin 2011-12-19 15:14:22 -05:00
Gavin Andresen
2a45a494b0 Use block times for 'hard' OP_EVAL switchover, and refactored EvalScript
so it takes a flag for how to interpret OP_EVAL.
Also increased IsStandard size of scriptSigs to 500 bytes, so
a 3-of-3 multisig transaction IsStandard.
2011-12-19 13:24:48 -05:00
Gavin Andresen
fae3e2aab6 Disable addmultisigaddress if not testnet 2011-12-19 13:24:48 -05:00
Gavin Andresen
e679ec969c OP_EVAL implementation
OP_EVAL is a new opcode that evaluates an item on the stack as a script.
It enables a new type of bitcoin address that needs an arbitrarily
complex script to redeem.
2011-12-19 12:40:19 -05:00
Gavin Andresen
bf798734db Support 3 new multisignature IsStandard transactions
Initial support for (a and b), (a or b), and 2-of-3 escrow
transactions (where a, b, and c are keys).
2011-12-19 12:40:19 -05:00
Gavin Andresen
99a289f531 Merge pull request #574 from sipa/dumpprivkey
Dumpprivkey
2011-12-19 07:27:25 -08:00
Gavin Andresen
f8ded588a2 Implement BIP 14 : separate protocol version from client version 2011-12-19 10:24:23 -05:00
Pieter Wuille
95d888a6d1 Key import and export
Introduces two new RPC calls:
* dumpprivkey: retrieve the private key corresponding to an address
* importprivkey: add a private key to your wallet

The private key format is analoguous to the address format. It is
a 51-character base58-encoded string, that includes a version number
and a checksum.

Includes patch by mhanne:
* add optional account parameter for importprivkey, if omitted use default
2011-12-17 21:49:48 +01:00
Pieter Wuille
30ab2c9c46 Preparations for key import/export 2011-12-17 21:49:48 +01:00
Pieter Wuille
93db3fceac Add GetSecret() and GetKeys() to CKeyStore 2011-12-17 21:49:47 +01:00
Gavin Andresen
f81ce5bd6d Speed up RPC authentication (reworked pull from Joel Katz) 2011-12-01 15:55:25 -05:00
Dylan Noblesmith
94f778bdeb Implement an mlock()'d string class for storing passphrases
SecureString is identical to std::string except with secure_allocator
substituting for std::allocator. This makes casting between them
impossible, so converting between the two at API boundaries requires
calling ::c_str() for now.
2011-11-26 06:02:04 +00:00
Gavin Andresen
0310cd6403 Merge pull request #632 from mndrix/deprecate-getblocknumber
Deprecate RPC getblocknumber
2011-11-21 11:31:42 -08:00
Gavin Andresen
d764d9161e Obsolete keypool and make sure database removes log files on shutdown. 2011-11-15 09:30:16 -05:00
Wladimir J. van der Laan
19197d5e29 Do not launch Shutdown in a new thread in case we are running the UI.
This leads to the bitcoin core being shut down while the UI is accessing it, and generally results in a segmentation fault or crash. In case it is desirable to make it possible to shutdown the GUI from its RPC server, we'll need to implement a signal for it. For the mean time, this is a safe stopgap.
2011-11-12 14:14:27 +01:00
Michael Hendricks
29c8b9416d Deprecate RPC getblocknumber
This RPC is exactly identical to getblockcount.  This duplication
dates back to commit 22f721dbf2 when
Satoshi created the RPC interface.

There's no need to have both, so we standardize on "count" which
matches the naming convention in getconnectioncount.

Following the tradition established with previously deprecated APIs,
getblocknumber continues to work, but it's not listed in the help
system.
2011-11-11 10:13:36 -07:00
Luke Dashjr
903a255836 Bugfix: "bits" should be a hex-string, not a number (that just doesn't make sense) 2011-10-06 12:47:28 -04:00
David Joel Schwartz
ae81b82fb8 Use C's const char* for status strings rather than C++'s std::string, which is slower 2011-10-05 14:48:33 -04:00
Gavin Andresen
3a6e468d9a Merge branch 'listsinceblock' of https://github.com/cdhowie/bitcoin 2011-10-05 11:38:24 -04:00
Gavin Andresen
b898c8fce6 Merge branch 'no-cryptopp' of https://github.com/tcatm/bitcoin 2011-10-05 10:38:10 -04:00
Luke Dashjr
3552497ae5 Send "Connection: close" HTTP header with JSON-RPC requests (client) 2011-10-05 10:15:07 -04:00
Forrest Voight
074d584a04 Added RPC call 'getmemorypool' that provides everything needed to construct a block with a custom generation transaction and submit a solution
getmemorypool [data]
If [data] is not specified, returns data needed to construct a block to work on:
  "version" : block version
  "previousblockhash" : hash of current highest block
  "transactions" : contents of non-coinbase transactions that should be included in the next block
  "coinbasevalue" : maximum allowable input to coinbase transaction, including the generation award and transaction fees
  "time" : timestamp appropriate for next block
  "bits" : compressed target of next block
If [data] is specified, tries to solve the block and returns true if it was successful.
2011-10-01 14:42:54 -04:00
Nils Schneider
6ccff2cbde remove cryptopp dependency, add simple unittest for SHA256Transform() 2011-09-30 20:00:22 +02:00
Gavin Andresen
f4769e44a3 Merge pull request #524 from sipa/signandverif
Sign and verify message with bitcoin address
2011-09-30 05:04:26 -07:00
Nils Schneider
7dd4001b40 Merge pull request #537 from tcatm/remove-deprecated-rpcs
remove deprecated RPCs
2011-09-29 09:39:11 -07:00
Nils Schneider
f8acc29fca deprecate midstate and hash1 in getwork 2011-09-28 17:54:44 +02:00
Nils Schneider
eec44dad17 remove deprecated RPCs 2011-09-28 17:43:31 +02:00
Pieter Wuille
3a570dc80a Use key recovery for message signatures
Instead of encoding the public key inside the signature string, use
key recovery to do verification. This allows 88-character base64-encoded
signature strings instead of 188-character ones.
2011-09-27 19:48:22 +02:00
Pieter Wuille
d9867551fc base64-based sign/verify 2011-09-27 19:48:22 +02:00
Pieter Wuille
b53d6284eb Incorporate pubkey in signature, check based on address
Include the public key in the signature string, to allow verification
based on address.
2011-09-27 19:48:22 +02:00
Khalahan
cc2567e32f Sign and verify message with bitcoin address and public key
Add padding to input (fixed string + address) before hashing
2011-09-27 19:48:22 +02:00
Pieter Wuille
4b603f1cd6 Inline base64 encoder/decoder
This replaces the openssl-based base64 encoder and decoder with a more
efficient internal one. Tested against the rfc4648 test vectors.

Decoder is based on JoelKatz' version.
2011-09-27 19:47:35 +02:00