Author

Topic: P2PK Transactions (Read 696 times)

newbie
Activity: 2
Merit: 0
May 02, 2017, 10:52:25 AM
#2
An ! can bring a man to his knees. Please ignore/lock topic. The functionality works.
newbie
Activity: 2
Merit: 0
April 28, 2017, 10:38:02 AM
#1
I am playing around with the core code trying to implement my own wallet (out of curiosity and mainly to get better grips with internals).

So far this is what i have done
- Launched in regtest mode , generated 101 blocks with mining reward 50.0 BTC paid out.
- Got hold of the chainActive structure and basically trying to implement a version of ScanForWalletTransactions.
- Following the crumbs from the above function leads me to Solver (called via isMine)

Code:
bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet);

If I look at the representation of the pubKey script in the reward transaction it looks something like :

Code:
2103d7a738b1e5d4f66470d3439d970661c83e35054408eff625b441967be85caea7ac

Which is decoded to :

Code:
03d7a738b1e5d4f66470d3439d970661c83e35054408eff625b441967be85caea7 OP_CHECKSIG

Looking at the solver  , this transactions will not be decoded to TX_PUBKEY as it expects the following in the template

Code:
CScript() << OP_PUBKEY << OP_CHECKSIG

But the getBalance RPC can correctly deduce the balance,  so essentially it works.
For the love of god , i am unable to figure out how is the simple script signature of OP_CHECKSIG is added to the wallet.  Any tips will be appreciated.

Cheers!
Jump to: