consensus/cmd/web/views/proof.qtpl
DataHoarder 55661a12da
All checks were successful
continuous-integration/drone/push Build is passing
WIP: Bootstrap-based responsive interface, CSS only
2024-03-20 13:37:26 +01:00

56 lines
3.7 KiB
Plaintext

{% import "git.gammaspectra.live/P2Pool/p2pool-observer/cmd/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) Name() string {
return "proof"
}
%}
{% 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/{%z= encodedMinerAddress %}">{%z= encodedMinerAddress %}</a>)</span></p>
{% else %}
<p><strong>Payout Address:</strong> <span class="mono small"><a href="/miner/{%z= encodedMinerAddress %}">{%z= 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.Context(), 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.Context(), p.Raw.Side.CoinbasePrivateKey) %}</span></p>
<p>Verify on Monero CLI: <span class="mono smaller">check_tx_proof {%= hex(p.Context(), p.Output.Id) %} {%z= encodedMinerAddress %} {%= hex(p.Context(), p.Raw.Side.CoinbasePrivateKey) %}</span></p>
<p>
<a href="{%s p.Context().GetUrl("localmonero.co") %}/blocks/tx/{%= hex(p.Context(), p.Output.Id) %}?xmraddress={%z= encodedMinerAddress %}&txprvkey={%= hex(p.Context(), p.Raw.Side.CoinbasePrivateKey) %}">Verify on LocalMonero</a><br/>
<a href="{%s p.Context().GetUrl("www.exploremonero.com") %}/receipt/{%= hex(p.Context(), p.Output.Id) %}/{%z= encodedMinerAddress %}/{%= hex(p.Context(), p.Raw.Side.CoinbasePrivateKey) %}">Verify on Explore Monero</a><br/>
<a href="{%s p.Context().GetUrl("monero.com") %}/payment/{%= hex(p.Context(), p.Output.Id) %}/{%z= encodedMinerAddress %}/{%= hex(p.Context(), 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(p.Context(), address.GetTxProofV2(p.Output.MinerAddress, p.Output.Id, &p.Raw.Side.CoinbasePrivateKey, "")) %}</span></p>
<p><strong>OutProofV1:</strong> <span class="mono smaller">{%= hex(p.Context(), 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 %}