1

If I mine blocks with daemon as "start_mining ADDRESS" then how can I check coinbase transactions to prove the payments? For example, I have mined the block 1 to address 41tYuMHTrVxCLszpbcd4b9UNA9o5Myat81KbjjtueDjrAjgrqWm4Eoibn1j9YakCkxAJx4oTJ3oxaPo9VoZZm5AE1YQcWkJ

print_block 1
timestamp: 1622650264 (2021-06-02 16:11:04)
previous hash: ca9a7c50189c41469e988a6467329d31e664d2ff732fcef233a365ceb77ab6a3
nonce: 3898888432
is orphan: 0
height: 1
depth: 70
hash: 26ea8f7e8c62917d36f2854123fa9ba20efee9bd199899325ac57d73af0f2a5d
difficulty: 1
cumulative difficulty: 2
POW hash: d010deb032bf01e1335100ae8cd47b317a0f4a706540b08e8d44859fddb46573
block size: 79
block weight: 79
long term weight: 79
num txes: 0
reward: 10000000000.00
miner tx hash: b3b2df387e10d0ffe1979c078d4b5f40c7426ff20eb90c0e369867b7c89e5845
{
  "major_version": 1,
  "minor_version": 14,
  "timestamp": 1622650264,
  "prev_id": "ca9a7c50189c41469e988a6467329d31e664d2ff732fcef233a365ceb77ab6a3",
  "nonce": 3898888432,
  "miner_tx": {
    "version": 1,
    "unlock_time": 61,
    "vin": [ {
        "gen": {
          "height": 1
        }
      }
    ],
    "vout": [ {
        "amount": 1000000000000,
        "target": {
          "key": "14b12f54354d3d3c876fbaf16850ec58f91dc9f389f549af8b2e196aacce5646"
        }
      }
    ],
    "extra": [ 1, 74, 106, 48, 234, 162, 215, 245, 229, 194, 58, 61, 147, 198, 172, 106, 186, 155, 32, 233, 94, 142, 237, 206, 249, 81, 252, 225, 209, 181, 128, 62, 139
    ],
    "signatures": [ ]
  },
  "tx_hashes": [ ]
}

For some unknown reason, the wallet does not display this transaction. Can I use a command like "check_tx_key TXID TXKEY ADDRESS" to prove the transaction? If yes then where can I get TXKEY for that?

2 Answers2

1

How to prove coinbase payment?

You can use get_tx_proof:

[wallet xxxx]: help get_tx_proof 
Command usage: 
  get_tx_proof <txid> <address> [<message>]

Command description: Generate a signature proving funds sent to <address> in <txid>, optionally with a challenge string <message>, using either the transaction secret key (when <address> is not your wallet's address) or the view secret key (otherwise), which does not disclose the secret key.

Then the person verifying can use check_tx_proof:

[wallet xxxx]: help check_tx_proof 
Command usage: 
  check_tx_proof <txid> <address> <signature_file> [<message>]

Command description: Check the proof for funds going to <address> in <txid> with the challenge string <message> if any.

Your question however is ambiguous. Above is what you can use to prove you have the funds from a tx for someone else to then verify, however, from your following remark, it seems you want to simply check whether you mined a block and got rewarded.

For some unknown reason, the wallet does not display this transaction.

Use show_transfers in your wallet:

[wallet xxxx]: show_transfers coinbase

If you don't see the tx, you didn't mine a block paying out to your wallet.

jtgrassie
  • 19,111
  • 4
  • 14
  • 51
  • "You can use get_tx_proof" No I can not. This is the wallet command but I have mined with daemon not wallet. "Use show_transfers in your wallet" Yes I can use this command and wallet does not shown the coinbase transaction although I set up mining to my address. So I need to know the reason: why transaction from miner does not reflect on my wallet? – Ivan Ivanov Jun 04 '21 at 07:24
  • "This is the wallet command but I have mined with daemon not wallet." obviously, you have to use the wallet to get a proof or view your transactions. – jtgrassie Jun 04 '21 at 16:44
  • "obviously, you have to use the wallet to get a proof or view your transactions." No. For "to get a proof" the wallet should known a private key. But where does the wallet get the transaction key from? The coinbase transaction has mined NOT BY WALLET I had to mined it with daemon monerod. The daemon is a separate process that is independent from wallet. – Ivan Ivanov Jun 06 '21 at 08:13
  • What you used to mine the block is irrespective, point being, whatever you used to mine the block, the coinbase tx has to pay to a wallet (more specifically to an output your wallet can spend). "But where does the wallet get the transaction key from?" You wallet scans the blockchain for outputs it can spend (i.e. txs sent to it). – jtgrassie Jun 06 '21 at 23:19
  • Use case: Alice has mined a block an told to Bob that the block reward has been sent to Bob's address xxxx. Bob told that he had not to received the transaction. Question: is there a way to prove who is liar: Alice or Bob? Without knowing Bob's private key? – Ivan Ivanov Jun 08 '21 at 03:57
  • So you created a block template sending the coinbase to an address you do not own. How did you create the block template? I ask, because if you used the daemon RPC, then you wouldn't have the tx private key of the coinbase, and thus indeed, you wouldn't have enough info to get a proof. – jtgrassie Jun 08 '21 at 13:15
  • "if you used the daemon RPC, then you wouldn't have the tx private key of the coinbase". I used the command line utility monerod with the command "start_mining XXX ...". Does this mean that there is no way I can verify the correctness of the coinbase transaction in this case? – Ivan Ivanov Jun 09 '21 at 13:55
  • "correctness"?? Your: Alice mines (in the daemon) to Bob's wallet address and want's to create a proof; no she cant. Because she doesn't have the tx private key or Bob's private view key. – jtgrassie Jun 09 '21 at 16:06
  • Does this mean that it is a bad idea to mine blocks with a daemon (to someone else's address)? Should Alice mine with the wallet instead? – Ivan Ivanov Jun 10 '21 at 17:24
0

I was trying to do the exact same thing, and I discovered it is impossible if you mine with the daemon. The reason is that the transaction (private) key for the miner transaction is discarded by the daemon as soon as the block is created. You can see that in the method construct_miner_tx in cryptonote_tx_utils.cpp.

The miners can find the outputs for them because they can check the output public key using the transaction public key (which is in the extra) and their address private view key (like in any other output). But it is impossible to retrieve the transaction private key. Therefore it is impossible to prove the transaction to other people, unless you give them your private view key.

Btw, you cannot to that with get_tx_proof for the same reason. That command will try to find the transaction private key, which is not stored anywhere.

Get_tx_key and get_tx_proof can work only within the wallet and only if the wallet saved the transaction keys. In fact, if you restore a wallet from the mnemonics, you won't be able to retrieve the transaction private keys anymore, they will be lost forever.

Kzar
  • 113
  • 4