consensus/cmd/web/views/proof.qtpl

52 lines
3.5 KiB
Plaintext

{% import "git.gammaspectra.live/P2Pool/p2pool-observer/index" %}
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/monero/address" %}
{% import "git.gammaspectra.live/P2Pool/p2pool-observer/p2pool/sidechain" %}
{% code
type ProofPage struct {
// inherit from base page, so its' title is used in error page.
BasePage
Output *index.MainCoinbaseOutput
Block *index.SideBlock
Raw *sidechain.PoolBlock
}
%}
{% func (p *ProofPage) Title() %}
{%= p.BasePage.Title() %} - Payout Proof for output #{%dul uint64(p.Output.Index) %} on Monero block {%dul p.Block.MainHeight %}
{% endfunc %}
{% func (p *ProofPage) Content() %}
<div class="center" style="text-align: center">
<h2>Payout Proof for output #{%dul uint64(p.Output.Index) %} on Monero block {%dul p.Block.MainHeight %}</h2>
{% code encodedMinerAddress := p.Output.MinerAddress.ToBase58() %}
{% if p.Output.MinerAlias != "" %}
<p><strong>Payout Address:</strong> {%s p.Output.MinerAlias %} (<span class="mono small"><a href="/miner/{%s encodedMinerAddress %}">{%s encodedMinerAddress %}</a>)</span></p>
{% else %}
<p><strong>Payout Address:</strong> <span class="mono small"><a href="/miner/{%s encodedMinerAddress %}">{%s encodedMinerAddress %}</a></span></p>
{% endif %}
<p>Received <strong>{%s monero_to_xmr(p.Output.Value) %} XMR</strong> on transaction id <a class="mono small" href="/t/{%= henc(p.Output.Id) %}">{%= hex(p.Output.Id) %}</a> (output index #{%dul uint64(p.Output.Index) %}, global output index #{%dul p.Output.GlobalOutputIndex %}).</p>
<p><strong>{%dul p.Context().Pool.MainChain.Height - p.Block.MainHeight + 1 %} confirmation(s)</strong>. Coinbase outputs will unlock after 60 confirmations.</p>
<p><strong>Stealth Address:</strong> <span class="mono small">{%s address.GetEphemeralPublicKey(p.Output.MinerAddress, &p.Raw.Side.CoinbasePrivateKey, uint64(p.Output.Index)).String() %}</span></p>
<hr/>
<h3>Payment Proofs</h3>
<div style="border: #aaaaaa 1px dashed; margin-bottom: 20px">
<p><strong>Transaction Private Key:</strong> <span class="mono small">{%= hex(p.Raw.Side.CoinbasePrivateKey) %}</span></p>
<p>Verify on Monero CLI: <span class="mono smaller">check_tx_proof {%= hex(p.Output.Id) %} {%s encodedMinerAddress %} {%= hex(p.Raw.Side.CoinbasePrivateKey) %}</span></p>
<p>
<a href="{%s p.Context().GetUrl("localmonero.co") %}/blocks/tx/{%= hex(p.Output.Id) %}?xmraddress={%s encodedMinerAddress %}&txprvkey={%= hex(p.Raw.Side.CoinbasePrivateKey) %}">Verify on LocalMonero</a><br/>
<a href="{%s p.Context().GetUrl("www.exploremonero.com") %}/receipt/{%= hex(p.Output.Id) %}/{%s encodedMinerAddress %}/{%= hex(p.Raw.Side.CoinbasePrivateKey) %}">Verify on Explore Monero</a><br/>
<a href="{%s p.Context().GetUrl("monero.com") %}/payment/{%= hex(p.Output.Id) %}/{%s encodedMinerAddress %}/{%= hex(p.Raw.Side.CoinbasePrivateKey) %}/">Verify on Monero.com</a><br/>
</p>
</div>
<div style="border: #aaaaaa 1px dashed">
<p><strong>OutProofV2:</strong> <span class="mono smaller">{%= hex(address.GetTxProofV2(p.Output.MinerAddress, p.Output.Id, &p.Raw.Side.CoinbasePrivateKey, "")) %}</span></p>
<p><strong>OutProofV1:</strong> <span class="mono smaller">{%= hex(address.GetTxProofV1(p.Output.MinerAddress, p.Output.Id, &p.Raw.Side.CoinbasePrivateKey, "")) %}</span></p>
<p>Verify on Monero GUI <span class="small">(Advanced -> Prove/check -> Check Transaction)</span></p>
</div>
</div>
{% endfunc %}