Bitcoin Forum
April 23, 2024, 09:51:31 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: destination address of a mined block  (Read 2984 times)
collapse (OP)
Full Member
***
Offline Offline

Activity: 206
Merit: 102


step forward


View Profile
October 12, 2013, 06:57:38 PM
 #1

How to obtain destination address of a mined block?

Similar to out address:
Code:
        const CTxOut& txout = tx.vout[0];
        txnouttype type;
        vector<CTxDestination> addresses;
        int nRequired;

        if (ExtractDestinations(txout.scriptPubKey, type, addresses, nRequired)){
            BOOST_FOREACH(const CTxDestination& addr, addresses){
            printf("out_address:%s\n",CBitcoinAddress(addr).ToString().c_str());
         }

Elacoin-ELC,Betacoin-BET,Neutroncoin-NTRN,Americancoin-AMC,Stronghands-SHND,Craftcoin-CRC,DOGE,BCH,BTC,...,Bitcoin,...(and a lot more)
Linux updated wallets (source code) for: ELC, BET, AMC, NKT, SLING, CRC,...
[if (blocknumber > 115000) maxblocksize=largerlimit]   [I don't think the threshold should ever be 0.  We should always allow at least some free transactions.]
1713865891
Hero Member
*
Offline Offline

Posts: 1713865891

View Profile Personal Message (Offline)

Ignore
1713865891
Reply with quote  #2

1713865891
Report to moderator
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713865891
Hero Member
*
Offline Offline

Posts: 1713865891

View Profile Personal Message (Offline)

Ignore
1713865891
Reply with quote  #2

1713865891
Report to moderator
maaku
Legendary
*
expert
Offline Offline

Activity: 905
Merit: 1011


View Profile
October 15, 2013, 04:05:21 PM
 #2

Coinbase outputs, as implemented by the reference client, are not one of the standard address formats.

What is your question, exactly?

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
collapse (OP)
Full Member
***
Offline Offline

Activity: 206
Merit: 102


step forward


View Profile
October 15, 2013, 06:06:00 PM
 #3

In bitcoin-qt, seems that each mined block goes to new bitcoin address, first transaction output (mined block).
I was searching for "default address" for mined blocks, but do not seems possible. Createnewblock should be modified for this.



Elacoin-ELC,Betacoin-BET,Neutroncoin-NTRN,Americancoin-AMC,Stronghands-SHND,Craftcoin-CRC,DOGE,BCH,BTC,...,Bitcoin,...(and a lot more)
Linux updated wallets (source code) for: ELC, BET, AMC, NKT, SLING, CRC,...
[if (blocknumber > 115000) maxblocksize=largerlimit]   [I don't think the threshold should ever be 0.  We should always allow at least some free transactions.]
maaku
Legendary
*
expert
Offline Offline

Activity: 905
Merit: 1011


View Profile
October 15, 2013, 07:19:35 PM
 #4

It uses a public key from your reserved key pool, in a public-key script (NOT a pubkey-hash script -- there is no address which specifies this script type used in coinbase transactions). You can use 'getblocktemplate' to construct your own coinbase, with whatever script you desire.

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
wiggi
Sr. Member
****
Offline Offline

Activity: 403
Merit: 251


View Profile
October 16, 2013, 03:27:51 PM
 #5

How to obtain destination address of a mined block?

If the block is already mined, you could re-use code from 'getblock' and 'getrawtransaction'.
(shows address of a mined block in plain text if verbose==1,
block reward is usually (not sure if always) the 1st tx in the list from 'getblock')

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!