Bitcoin Forum
June 21, 2024, 08:16:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: Bitcoin wallet doesn't store public keys on: June 20, 2014, 12:32:39 PM
Where did you get this information? It's wrong.
Bitcoin Core's wallet does store the public keys.
See here for the code that loads keys: https://github.com/bitcoin/bitcoin/blob/master/src/walletdb.cpp#L409

My point is that it appears that bitcoin client is not using this "stored" public keys value, because every time it needs to check the public key associated with a private key it just sets the private key to a EC_KEY openssl object and then asks for its public key. What openssl does is to compute the public key related to the private key, so if bitcoin is storing the public keys it's being useless.
Also the CKey class that is used in the wallet to persist the keys to storage only represents private key data, not public keys, so every time it needs to know the public key, it have to go through openssl mechanism.
You can easily check this by modifying the code to store a key pair where the public key is not related to the private key (just for demonstrations sake), so what it will do is actually store only the private key, and query for its corresponding public key, which will result in the correct private/public keys. So, by this behaviour we see that it's not actually using the stored public keys.
I'm just wondering why this happens.
2  Bitcoin / Development & Technical Discussion / Bitcoin wallet doesn't store public keys on: June 18, 2014, 02:54:01 PM
Why the qt bitcoin client doesn't store the public keys associated with the private keys?
Sure it can be computed from the private key alone, but it is a costly operation to do every single time when it could just store a few extra bytes in the wallet.
Any other good reason for this behaviour? Anyone knows if every wallet does the same?

Thanks,
3  Bitcoin / Development & Technical Discussion / How could I back scan the ledger to find a transaction to a specific address? on: June 11, 2014, 10:17:00 PM
How could I do this in the bitcoin client?
Are there any API to search for transactions?
I'm not interested on how to do this manually, but instead on how to add this as a feature in the bitcoin client.
4  Bitcoin / Development & Technical Discussion / Re: Miners and non-standard transactions on: February 21, 2014, 02:10:02 PM
Is there a documentation on how I could do that? Or if not, can you at least point me in the right direction??
Thanks
5  Bitcoin / Development & Technical Discussion / Miners and non-standard transactions on: February 21, 2014, 01:06:36 PM
If I'm a miner, how can I choose which types of transactions to accept? e.g. non-standard OP_CODES and so on...
6  Bitcoin / Development & Technical Discussion / Nothing to see here on: February 05, 2014, 11:43:30 PM
I told you!
7  Bitcoin / Development & Technical Discussion / Check bitcoin version byte in OP_CHECKSIG on: February 05, 2014, 11:15:39 PM
Is there a way to check what is the version byte of the address associated with the public key current on the stack?

The idea is this: During the execution of OP_CHECKSIG, I want to check if the version byte of the address associated with the public key current on the stack is, let's say 0xCB, and if it is, I want to do some pre-processing on the public key before proceeding with the validation.

Because the way I see it, during OP_CHECKSIG I'll have access (normally) to the public key and a signature. But only from the public key I can't construct the address, I can only construct the HASH160 (which is lacking the checksum and the first version byte). Of course I could only append this two, but I can't do that because I don't know the version byte beforehand, I can only know the version byte by looking at the address.

I hope I made it clear...

Anyone has an insight on this?

Cheers,
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!