Bitcoin Forum
January 22, 2018, 08:57:22 PM *
News: Electrum users must upgrade to 3.0.5 if they haven't already. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: destination address of a mined block  (Read 2894 times)
collapse
Full Member
***
Offline Offline

Activity: 169


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:FairElasticMining, Betacoin:TxComment, NTRN:CryptoCourses, BitcoinP2PCash, BitcoinFee, SHND:x2Test,..., Americancoin, CRC, ONC, KRN, Bitcoin,...

[if (blocknumber > 115000) maxblocksize=largerlimit]   [I don't think the threshold should ever be 0.  We should always allow at least some free transactions.]
1516654642
Hero Member
*
Offline Offline

Posts: 1516654642

View Profile Personal Message (Offline)

Ignore
1516654642
Reply with quote  #2

1516654642
Report to moderator
1516654642
Hero Member
*
Offline Offline

Posts: 1516654642

View Profile Personal Message (Offline)

Ignore
1516654642
Reply with quote  #2

1516654642
Report to moderator
1516654642
Hero Member
*
Offline Offline

Posts: 1516654642

View Profile Personal Message (Offline)

Ignore
1516654642
Reply with quote  #2

1516654642
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1516654642
Hero Member
*
Offline Offline

Posts: 1516654642

View Profile Personal Message (Offline)

Ignore
1516654642
Reply with quote  #2

1516654642
Report to moderator
1516654642
Hero Member
*
Offline Offline

Posts: 1516654642

View Profile Personal Message (Offline)

Ignore
1516654642
Reply with quote  #2

1516654642
Report to moderator
maaku
Legendary
*
expert
Offline Offline

Activity: 905


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
Full Member
***
Offline Offline

Activity: 169


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:FairElasticMining, Betacoin:TxComment, NTRN:CryptoCourses, BitcoinP2PCash, BitcoinFee, SHND:x2Test,..., Americancoin, CRC, ONC, KRN, Bitcoin,...

[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


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: 374


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!