Bitcoin Forum
May 06, 2024, 02:45:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 [49] 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ... 589 »
961  Bitcoin / Development & Technical Discussion / Re: Manually convert a Binary or HEX private key to WIF, then find the Public Key on: September 18, 2018, 12:12:42 AM
There are multiple mathematical formulas and algorithms involved in both the calculation of a public key from a private key, and from a public key to a bech32 address.

I would estimate that it would take you a few decades to do either of these algorithms. With a computer to do some precomputation, you can probably do it in a few years.



For public key from a private key, Andrew Poelstra has a pretty good post describing it here: https://bitcointalk.org/index.php?topic=1534028.msg15594185#msg15594185 along with a precomputed table for you.



For the Bech32 calculation, you will need to be able to do two different hash functions: SHA256 and RIPEMD160. Then you also need to calculate the checksum which uses a BCH error correcting code.

For SHA256, Ken Shirriff has a pretty good blog post about how to do SHA256 by hand for mining. It's the same operations, just on different data. Also, you are doing only 1 SHA256 computation, not 2 as mining requires. You perform the SHA256 on your serialized public key in compressed form.

For RIPEMD160, I don't think anyone has really explained how to do by hand (and I don't really want to be cause it is long and takes a lot of time which I don't have). The algorithm is described in this paper with pseudocode given in Appendix A. It is similar to SHA256 in that the message is broken up into chunks which are XOR'd initially with some initial values and then later with the previous chunk.. You would like use a similar method as described in the SHA256 blog post but with the modifications to be able to do RIPEMD160. You perform RIPEMD160 on the above SHA256.

For calculating the checksum, you use the algorithm described under the Checksum section in the BIP. The gist of it is that, given a list of numbers, you apply multiple polynomials on all of the numbers and the "sum" of the results is the checksum (it's a lot more complicated than that and I don't remember all of the details). The python code given in the bech32_polymod() function describes how to do this. Note that ^= in python means XOR, not exponentiation.

To calculate the final bech32 string, you first need to convert the hash160 into a list of numbers usable for bech32's checksum calculation. You do this by splitting up the 160 bit hash into 5 bit chunks. Each 5 bit chunk is then a number so you now have a list of 5 bit numbers. You prepend to that the witness version, which is 0, so the list now starts with the number 0. Then you prepend to that an expansion of the human readable part of a bech32 string, bc. This is expanded by using the bech32_hrp_expand() function in the python code given in the BIP. You will get a list of numbers like so: [3, 3, 0, 2, 3]. So the resulting list of numbers will be 39 numbers in length and begin with [3, 3, 0, 2, 3, 0, .... Lastly you append six 0's to the end of the list which represent the positions that the checksum will go in. Now you do the bech32_polymod() function on this list of numbers and the resulting value you get back is the checksum.

Now you must convert all of these numbers to characters. You do this by breaking the checksum into 5 bit chunks to get a list of 6 numbers. Then, given the list of numbers containing the witness version number, the hash160, and the checksum, convert each number to the corresponding character using the lookup table described in the BIP. Note that you do not need to do this to the expanded human readable part. The resulting bech32 address is the human readable part concatenated to the character '1' concatenated to the characters for the witness version number, the hash160, and the checksum. So it will begin with bc1....

Regarding the human readable part expansion, that is done because the human readable part can be any ascii character and the numbers in the list of numbers need to be in the interval [0, 32). However ASCII can have numbers outside of that interval, so the expansion is done to have the higher bits, then the lower bits so it all fits in the interval.

Bech32 would probably only really take a few days / weeks. You just need to be careful to not make a mistake. The thing that takes a while would be privkey to pubkey.
962  Bitcoin / Development & Technical Discussion / Re: Bitcoin-core. Unhandled rejection RpcError: 404 Not Found when calling getBlockc on: September 15, 2018, 07:53:25 PM
getblockchaininformation is not a RPC command. You are probably looking for getblockchaininfo.
963  Bitcoin / Development & Technical Discussion / Re: SIGHASH_NOINPUT and Lightning Network on: September 13, 2018, 01:30:46 PM
1.
Here is SIGHASH_NOINPUT: https://github.com/Roasbeef/bitcoin/commit/4b3c3f1baf7985208ceb6887261ee150ab6e3328
Code:
    const bool fAnyoneCanPay;  //! whether the hashtype has the SIGHASH_ANYONECANPAY flag set
    const bool fNoInput;       //! whether the hashtype has the SIGHASH_NOINPUT flag set
    const bool fHashSingle;    //! whether the hashtype is SIGHASH_SINGLE
But I can't find "SIGHASH_NOINPUT" in bitcoin master source.
This is only in branch?
It doesn't it exist in Bitcoin yet. SIGHASH_NOINPUT requires a soft fork.

2.In Bitcoin blockchain are transactions which opens bidirectional LN channel?
If not, these are in testnet?
This question doesn't make any sense.

3.I want search blocks are find all transactions which opens bidirectional LN channel.
How I can do it?
You can't. Lightning Network funding transactions look identical to any other transaction paying to a P2WSH output.
964  Bitcoin / Development & Technical Discussion / Re: What`s the deal with the testnet? on: September 11, 2018, 04:14:02 PM
Has anyone notice this? Today one miner has been mined almost all blocks on testnet. And he has not including any segwit transactions in the blocks! My test transactions have not been confirmed since 6 hours ago!
https://live.blockcypher.com/btc-testnet/tx/b80f9a8aa0e3a636c517072597b945cee4d878d9f645d19a8666dc6f6ca91d31/

I am a bit worry of this type of attack could deal a great damage to Bitcoin Mainnet!
It can't do anything to mainnet since testnet is a completely separate network with almost 0 hashrate. The only reason this can happen on testnet is because someone has the majority hashrate.
965  Bitcoin / Bitcoin Technical Support / Re: strange bitcoind reindex and txindex on: September 09, 2018, 04:16:53 PM
Is your node fully synced? What do you get from the getblockchaininfo command?
966  Bitcoin / Electrum / Re: [Electrum 3.2.3] Why does it wish to use an at-risk package called libsecp256k1? on: September 08, 2018, 04:28:39 PM
Has there been any reported hacks that took advantage of the fact that some parts of libsecp256k1 are experimental?
No, because those things are not used in Bitcoin. Also, the library is heavily reviewed by cryptographers.

Even experimental things are generally safe to use as their cryptography is reviewed before it is implemented into libsecp256k1. The experimental mostly refers to the fact that APIs may change for those experimental things. Also, the experimental stuff is not enabled by default and must be explicitly enabled when compiling the library.
967  Bitcoin / Bitcoin Technical Support / Re: A TECHNICAL question about blockchain, btc mining on: September 08, 2018, 04:24:43 PM
1-) I'm looking at block 540494, its nonce is 2097181953 its hash is 00000000000000000024ada2........

so it starts with 18 leading zeros..

that means a miner starts from 0 calculates its hash with the nonce=0 IF no valid result, THEN increments nonce by 1. now nonce=1, and keep doing this until a hash is found with 18 leading zeros. Because current difficulty requires them to find a hash with 18 leading zeros, right?
Yes, and no. Yes, a miner started from 0 and incremented the nonce until they found a hash that met the proof of work requirements. No, the difficulty does not require them to find a hash with 18 leading zeroes.

The leading zeroes thing is just a simplification of how the proof of work check actually works. What actually happens is that there is some target value that is a 256 bit integer. Block hashes are interpreted as a 256 bit integer. So all that happens is that the block hash (interpreted as a 256 bit integer) is compared to the target value. The block hash must then be less than or equal to the target value. Because the target value is "small" (small in terms of the 256 bit number space), it will have many leading zeroes. But the zeroes themselves do not actually matter, all that matters is the value.

Sub-question: I know difficulty changes every 2 weeks, it is now 7,019,199,231,177 but who decides how many leading zeros should be in the valid hash? is it something to do with "target difficulty" rather than the "difficulty number" itself? Are these 2 different difficulty parameters that define the difficulty?
There is only one parameter that matters: the target value. The difficulty is just the inverse of the target divided by the maximum target value.

The difficulty readjustment is really a target readjustment. The target changes every 2016 blocks, which is approximately two weeks. It does not actually change every two weeks since it may take shorter or longer than 2 weeks to find 2016 blocks. The target is just scaled proportionally to the amount of time it took to mine 2016 blocks and the amount of time it should take to mine 2016 blocks (2 weeks). Of course there must have been a starting point for the target, and that is the maximum target value (so difficulty is the lowest) which is defined in the consensus rules. The maximum target value was used in the genesis block so that is the starting point for target adjustment.

So for this particular example (block 540494) the nonce is 2097181953

that means a miner tried every single nonce from 0 to 2,097,181,953, and calculated hash 2,097,181,953 (lets say 2 billions) times in total and found the valid result which is the hash starting with 18 zeros. (00000000000000000024ada2........)

Now what I dont understand is that an ASIC machine can hash 12 trillion times PER SECOND. and our nonce is 2,097,181,953. so that means winning miner spent only fraction of a second to calculate 2 billions hashes. But it cant be true because block time is 10 minutes, right? so what is wrong here?? What am I doing wrong with this calculation?

My understanding is like the following;


* Miner have a list of transactions and all the properties (headers I believe) to calculate the hash of the block.

* Miner calculates hashes for all the nonces between 0 and the current difficulty (it is now 7,019,199,231,177)

* IF miner finds a hash with at least 18 leading zeros (can be more than 18 zeros, right? since even if it has 20 leading zeros, it is still proof of the work.) that miner gets the reward.

* IF miner cant find a nonce between 0 - 7,019,199,231,177 then miner picks different set of transactions (since calculations with the current list of transactions wont be resulting valid hash.. So miner adds couple more transactions into the block and starts the whole process all over again with the new list of transactions.. hoping to find a valid hash with the nonce between 0 and 7,019,199,231,177 and with the new set of transactions.
That is close. Miners don't usually re-select transactions after every set of nonces is exhausted. Usually they will change something within the block they already have. Specifically, they will set some value in their coinbase transaction that is known as the extra nonce. This extra nonce is then incremented every time the nonce runs out so that the merkle root is different and thus the nonces can be tried again. Furthermore, miners may change things like the block timestamp and block version number in order to get different candidate blocks.

* Miner have a list of transactions and all the properties (headers I believe) to calculate the hash of the block.
Transactions are just transactions. There are no transaction headers. The block contains the transactions themselves and then the hash of all of the transactions is included in the merkle root which is in the block header.

* Miner calculates hashes for all the nonces between 0 and the current difficulty (it is now 7,019,199,231,177)
No, the nonce is a 32 bit integer. It can only have the 32 bit integer values. It does not change with the difficulty.

* IF miner finds a hash with at least 18 leading zeros (can be more than 18 zeros, right? since even if it has 20 leading zeros, it is still proof of the work.) that miner gets the reward.
A block hash is valid so long as it is less than or equal to the current target. So one with more leading zeroes is inherently less than, thus it will still be accepted.
968  Bitcoin / Bitcoin Technical Support / Re: Separate public and private key wallets on: September 08, 2018, 04:15:17 PM
Is it possible to setup bitcoind such that it only uses a wallet with public keys and have a separate local (does not talk to the world) bitcoind with a wallet that has the private keys ?
Yes, but it is somewhat annoying to setup and it doesn't really work in the way that you would want it to.

On your offline wallet, get a bunch of addresses by using getnewaddress. Import these addresses into your online wallet using importmulti. Your online wallet will now track those addresses and your balance will update when those addresses receive coins.

Because those addresses are imported and are watching only, any time you do any wallet command, you must set whatever watching only option for that command to true, otherwise it will pull things from the online wallet itself and not the things you are watching.

HOWEVER, you cannot use getnewaddress or the GUI equivalent on the online wallet as that will actually give you keys generated in the online wallet. Furthermore, in order to have your offline wallet sign the transactions, you will need to provide additional information from the online wallet besides the transaction being signed. You will need to provide the scriptPubKey's of the outputs being spent, the amounts, and some other stuff I can't remember right now.



Note that the above HOWEVER only applies to versions prior to 0.17. The upcoming 0.17.0 release fixes these problems. You can create a wallet that has no private keys thus eliminating the need to be careful about getnewaddress as getnewaddress will not work when private keys are disabled for a wallet. Furthermore, 0.17 introduces BIP 174 Partially Signed Bitcoin Transactions which solves the issue of having to provide additional information as part of the command arguments. Instead that information will be packed into a PSBT which you can create and send to the offline wallet.
969  Bitcoin / Electrum / Re: [Electrum 3.2.3] Why does it wish to use an at-risk package called libsecp256k1? on: September 08, 2018, 02:56:59 PM
Because there isn't really a risk to using libsecp256k1. That's just there as a disclaimer since some parts of the library are experimental, but those are also labeled clearly.

libsecp256k1 is what Bitcoin Core uses for all of its ECDSA operations for several years now. The library was created by some Bitcoin Core developers.
970  Bitcoin / Development & Technical Discussion / Re: BIP-174 vs Lightning network on: September 07, 2018, 05:17:35 PM
BIP 174 and the Lightning Network are two completely separate and independent things. They are designed to achieve complete separate and independent goals. That article is wrong.

The Lightning Network is a scaling solution for doing transactions off chain.

BIP 174 is a transaction format for transactions that are not ready to be broadcast to the Bitcoin network yet. It is not a protocol nor is it a layer 2 solution for off chain transactions.

BIP 174 only helps for creating and signing on chain transactions. It is designed for inter-client compatibility and to allow easier hardware wallet and offline wallet setups.
971  Bitcoin / Bitcoin Technical Support / Re: Possible bug in decoderawtransaction in 16.02? on: September 06, 2018, 07:42:55 PM
Yes, this does indeed work! The documentation found at https://bitcoin.org/en/developer-reference#decoderawtransaction doesn't list the second parameter. According to the documentation decoderawtransaction only takes a single parameter. Guess the documentation isn't up to date here.
Yeah, those docs tend to lag a few versions. The most up to date versions exist in the code itself. You can get those docs by doing
Code:
bitcoin-cli help <command>
It will give you the help for the command.

One last question about the heuristic in this specific case: It's pretty clear the assumption made this was a transaction without witness data is wrong based on the fact it's reporting a negative value as an amount. So shouldn't the "heuristic algoritm" reassess itself when the output generated was clearly wrong:

Code:
Input -> Trying as non witness -> Output is valid -> Done
Input -> Trying as non witness -> Output is invalid -> Trying as witness ->Output is valid -> Done

I might be oversimplifying things here but it seems to me this would lead to a lot less incorrect assumptions from heuristics.
Indeed, that probably would help. The heuristic currently is actually rather dumb. IIRC it decodes as non-witness first and then checks for whether there are invalid opcodes in the scripts of any inputs. We could certainly have it check the output amounts to see if they are sane (between 0 and 21 million).
972  Bitcoin / Development & Technical Discussion / Re: Total Number of full nodes operating. Less than 10k. on: September 06, 2018, 02:23:03 PM
Paying someone to run nodes (or running one yourself on a third party controlled VPS service like amazon or digital ocean, for that matter) wouldn't serve much of a purpose.

I don't understand why? Amazon or any digital third party doesn't do it on their consent, nor do they do it for their convenience but it's us who do it (or can do it) and we can use VPN services to stop being watched by them that we are doing this, that too anonymously, and as well, is there anything illegal in doing like this?
There's nothing illegal about it. There is just no real benefit to the network if many or all nodes are running on VPS services like AWS. All of those nodes are using the same block of IP addresses. They are likely hosted in the same data centers, so they are centralized in both the same digital region (IP address blocks) and the same physical region (datacenter location). Furthermore, if Amazon or DIgitalOcean decided that they didn't want people running Bitcoin nodes on their VPSes, they could shut down those VPSes and take off a large portion of the network. Thus having many nodes on VPSes with the same VPS providers does not really contribute to the decentralization of the network and is similar to just one node being run.
973  Bitcoin / Bitcoin Technical Support / Re: Possible bug in decoderawtransaction in 16.02? on: September 06, 2018, 02:16:39 PM
This is a known issue and unfortunately it cannot be fixed without a fork. The issue lies with the format of a segwit transaction itself. A segwit transaction, under some circumstances, can be interpreted as either a 0 input, 1 output transaction, or as a witness transaction. Since getrawtransaction fetches transactions from blocks themselves or from the mempool, the transaction must be a valid network transaction and thus witness serialization can be attempted safely as a first step and only deserializing as non-witness if the witness deserialization fails.

However, decoderawtransaction behaves differently as it is intended to be used during the transaction creation steps. This means that it must be able to handle 0-input, 1 output transactions (which are inherently non-witness) as users may create a 0-input, 1 output transaction, decode it, and then pass it to fundrawtransaction to get inputs. But because some 0-input, 1 output transactions can be interpreted as witness transactions, and some witness transactions can be interpreted as 0-input, 1 output transactions, decoderawtransaction does not always succeed to decoding a transaction correctly. It uses some heuristics in order to decrease the number of false decodings, but sometimes, as you can clearly see, it's wrong.

Fortunately, if you know that a transaction is witness you can set the iswitness argument (added in 0.16) to true to tell it explicitly to decode the transaction as witness. You can set it to false for non-witness decoding. Not setting it uses the heuristics.

So your command will be something like:
Code:
bitcoin-cli decoderawtransaction <tx> true
974  Bitcoin / Development & Technical Discussion / Re: Mining reward "stealing" attack on: September 05, 2018, 03:11:09 AM
First of all, double the current hashrate would be nearly impossible for someone to get. They would have to acquire ALL of the mining equipment in the world, and then do it again, all without taking away the existing equipment. This would be exorbitantly expensive, both in resources and in time. Manufacturers can't just magically produce machines that they don't have. It takes time, money, and raw materials. Such an operation would be very obvious.

Second, people running nodes, and nodes themselves, are not stupid. They would definitely notice a 500,000+ block blockchain reorganization. That is extremely obvious and there would be warnings put up all over place. Such an attack would likely result in some form of human intervention which prevents people's nodes from switching to using the attacker's blockchain.
975  Bitcoin / Development & Technical Discussion / Re: just for you to know on: September 04, 2018, 03:47:13 AM
https://botbot.me/freenode/bitcoin-core-dev/msg/104049316/
and the one below.
one of them got a sinking feeling haha
Quote
Have you noticed ...
no it's not the case

It's a good thing that the code is completely different from what you did.

Also, this isn't "stealing your idea". You created a pull request for a particular feature. People did not like how you implemented it (and they also did not like how you rude you were in the thread and on IRC). The existence of your pull request has been taken as a feature request (you put out a request for us to implement this feature). Someone is implementing the feature you requested.
976  Bitcoin / Bitcoin Technical Support / Re: How to:Running a hybrid full node = Broadcasting to clearnet and TOR hidden net on: September 04, 2018, 01:32:09 AM
Right click the file and ‘Extract all’. Open the new directory, then the one named ‘Tor’. Double click on Tor.exe.

Sounds suspicious, there's no need to do that at all.

My advice: Do not do this. Follow the guide in the docs at the Bitcoin github.com page.
There's a link in the linked article that goes directly to the TOR Project's website. That's what it is telling people to download and extract. Furthermore, the link is to the download page, not a directly download link itself.
977  Bitcoin / Bitcoin Technical Support / Re: Access funds on legacy address related to segwit addr to which I got access to on: August 30, 2018, 03:52:12 PM
1. scriptPubKey for both addresses contains 09763cb05dcea0f98f53b0f08651f92c5d2d2f38 part, which is, afaik, actuall public key. First byte differs, which makes sense, since it's prefix, 00 for legacy and 05 for segwit respectively.
No, this is wrong.

First of all, 0x05 does not mean segwit, it means P2SH. Bitcoin Core by default creates addresses that are P2WPKH nested inside of a P2SH address. That is why you see embedded in the getaddressinfo output.

Your pool software is incorrect here, and that is the source of the problems. The scriptPubKey that you should have used is a91409763cb05dcea0f98f53b0f08651f92c5d2d2f3887 which maps to the address 32Z3eXSPgxcHj2fnQy8d6dg66eVtZfxrBM. The 09763cb05dcea0f98f53b0f08651f92c5d2d2f38 part is the hash160 of the redeemScript. Since this is a P2WPKH nested in a P2SH, the redeemScript is 00142ee67d879ccf17daec87b4ed4a6cecdd9b3f64a0. However, what your pool software did was it ignored the version byte (the 0x05) which indicates that the hash160 encoded in the address should use a P2SH scriptPubKey. Instead, it made a P2PKH scriptPubKey using the provided hash160 which is why you see that the coins were sent to 1s2iywx94HudryMHsU2g1K9x8DB1cahGc.

regarding output for 1s2iywx94HudryMHsU2g1K9x8DB1cahGc :

2. pubkey property is missing, which is weird, because usually its included for legacy addresses
It is missing because the pubkey does not exist in your wallet. What it is looking for is a pubkey that has a hash160 of 09763cb05dcea0f98f53b0f08651f92c5d2d2f38. But what you have is a redeemScript that has a hash160  of 09763cb05dcea0f98f53b0f08651f92c5d2d2f38. The pubkey that is in that redeemScript is unrelated to this address entirely.

3. isMine property equals false, wich means that wallet does not recognize this address relation to wallet PK.
The address is unrelated to the pubkey.

So, can anyone please provide some insight and tell us if (and how?) we can access those funds, or we've lost them for good? Thanks in advance.
Your coins are lost, you cannot recover them. You would need a public key which hashes to 09763cb05dcea0f98f53b0f08651f92c5d2d2f38 and its associated private key. All you have is a redeemScript that has that hash. That redeemScript is not a public key. Thus you cannot get those coins as you cannot spend them.


Which means your ScriptPubKey is if you use P2WPKH (bc1q9mn8mp.... address):
Code:
00 14 2ee67d879ccf17daec87b4ed4a6cecdd9b3f64a0

Or it is the following if you use P2WPKH nested in P2SH
Code:
a9 14 2ee67d879ccf17daec87b4ed4a6cecdd9b3f64a0 87

But what your program was doing to create your address (32Z3eXSPgxcHj2fnQy8d6dg66eVtZfxrBM) is the following:
Code:
a9 14 09763cb05dcea0f98f53b0f08651f92c5d2d2f38 87
0976... is your ScriptHash which means it was a "redeem script" that got hashed not a public key. Possibly means more than 1 key was used but I may be mistaken about that.
No No No! You are horribly mistaken and completely wrong. That is not how P2WPKH is nested in P2SH. Doing this will cause your coins to be lost. P2WPKH nested in P2SH uses the scriptPubKey of the P2WPKH output as the redeemScript. It does not use the keyhash as the hash in the P2SH scriptPubKey. The P2SH address OP has is correct, his pool software is just broken.
978  Bitcoin / Development & Technical Discussion / Re: Is it possible to know the date I changed my wallet.dat password? on: August 28, 2018, 03:31:45 PM
Just use dumpwallet and look at the dates in the resulting dump. The block of 100 keys with the most recent timestamp is the time the encryption was changed. Also, note that if you have used the wallet, you will see some keys that do not fit into these blocks of 100 keys. Those keys are generated after a key from the keypool is used.

Thanks, I already tried dumpwallet however it ask me to enter the wallet passphrase first which I have forgotten. If you know how to bypass this hurdle please let us know.
Right, duh.

The way to get this information out without using dumpwallet is to use BDB's db_dump utility which will output all of the raw records from the wallet. What you want are the keymeta ones. When you use db_dump, you will get a bunch of hex output. What you want to do is look for the lines which begin with the hex 076b65796d65746121. The line immediately after contains the actual key metadata which has the timestamp for key creation. These timestamps are 8 byte, little endian integers. They begin at the 5th byte after the beginning of the line, so 8 characters after the beginning.

For example, here is a keymeta record from one of my wallets:
Code:
076b65796d6574612103ffc5d227b2e27f2e1253eb44c359eed1af38ec6028da2ec62205f479f533c6d7
0b0000005c147e5b000000000c6d2f30272f30272f35373727eaa6033dd5740c71a55efd9e7e6c8d102974535f0000000000000000000000000000000000000000
As you can see, the first line begins with 076b65796d65746121. Then on the second line, the timestamp is 5c147e5b00000000. Converting this to the unix timestamp results in 1534989404. This is a UNIX timestamp. As an actual date and time, it is Thursday, August 23, 2018 1:56:44 AM UTC.

This is a bit more manual, but it could probably be scripted.

Also, make sure you use the BDB 4.8 version of db_dump which can be downloaded from http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html (scroll down to 4.8.30).

Note that you have to use the command line, i.e. the terminal (for unix systems) or the command prompt (windows). The command that you will use is
Code:
db_dump wallet.dat
979  Bitcoin / Development & Technical Discussion / Re: Is it possible to know the date I changed my wallet.dat password? on: August 28, 2018, 02:13:47 AM
I don't believe that data is stored within the wallet for older, non-HD wallets.

With the newer HD wallets, whenever you change the password, it will modify the seed and the master key and then generate new keys/addresses... I have two old dumpwallet outputs from a testnet wallet, one before a password change, and one after. The timestamps in these files show the original creation date for the keys (ie. when the keys were generated to fill the keypool)...

So, by looking at the current "hdmaster" key timestamp, I can tell when the password was changed. Unfortunately, given that your wallet was created in 2013, that would predate Bitcoin Core HD Wallets Undecided
You don't need an HD wallet to observe this. With both HD and non-HD wallets, you should see a block of 100 (or 1000) keys created at one time, and then another block of 100 keys created at another time. That other time would be the time that the password was changed.

Just use dumpwallet and look at the dates in the resulting dump. The block of 100 keys with the most recent timestamp is the time the encryption was changed. Also, note that if you have used the wallet, you will see some keys that do not fit into these blocks of 100 keys. Those keys are generated after a key from the keypool is used.
980  Bitcoin / Bitcoin Technical Support / Re: Bitcoin Core Multi-wallet HTTP RPC request problem in v16 on: August 26, 2018, 09:34:22 PM
I believe you are just using EasyBitcoin incorrectly.

The constructor for a Bitcoin object is

Code:
__construct($username, $password, $host = 'localhost', $port = 8332, $url = null)
So you are setting $host to be the URL you want to use. However when EasyBitcoin sends the RPC call, it will use the URL of {$this->host}:{$this->port}/{$this->url}. So the real URL that you are using is 127.0.0.1:8332/wallet/wallet1.dat/:8333 which is not the wallet your bitcoind has loaded.

Rather you should be doing
Code:
$bitcoin = new Bitcoin("userhidden","passhiddden", '127.0.0.1', '8332', 'wallet/wallet1.dat/');

You can check the endpoints that are actually being called by starting bitcoind with -debug=rpc and then looking at the debug log. The endpoints that are being called should be logged and you can see the difference between the URLs from bitcoin-cli and the URLs from EasyBitcoin.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 [49] 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ... 589 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!