Bitcoin Forum
October 23, 2017, 07:32:23 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: destination address of a mined block  (Read 2887 times)
collapse
Full Member
***
Offline Offline

Activity: 146


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());
         }

---
1508787143
Hero Member
*
Offline Offline

Posts: 1508787143

View Profile Personal Message (Offline)

Ignore
1508787143
Reply with quote  #2

1508787143
Report to moderator
1508787143
Hero Member
*
Offline Offline

Posts: 1508787143

View Profile Personal Message (Offline)

Ignore
1508787143
Reply with quote  #2

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

Posts: 1508787143

View Profile Personal Message (Offline)

Ignore
1508787143
Reply with quote  #2

1508787143
Report to moderator
1508787143
Hero Member
*
Offline Offline

Posts: 1508787143

View Profile Personal Message (Offline)

Ignore
1508787143
Reply with quote  #2

1508787143
Report to moderator
1508787143
Hero Member
*
Offline Offline

Posts: 1508787143

View Profile Personal Message (Offline)

Ignore
1508787143
Reply with quote  #2

1508787143
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: 146


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.



---
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
****
Online Online

Activity: 373


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!