Closed phyro closed 3 years ago
We can make the proof invalid by exporting the payment proof and slightly changing the amount or sender_address value (or possibly alter the signature of the receiver or sender to make only one of them invalid)
{
"amount": "100000000",
"excess": "0921b43153863b028ee2e46a52d915233b1e2a897dbc3d31e36a20015c85d846df",
"recipient_address": "grin1vm68yyu6f5gyz7tk7zwjf2ws5vu44wkyurd84as0tnums2fsahks8x3zjc",
"recipient_sig": "01b6c6d48ab46997c3e8fb0993390cfde7aa4de42a52622fb74cd0a8906d30ead017253caa20f9850f48434b501f7a23aae169b27064fc4a2745edbb6724da01",
"sender_address": "grin12wktxlyfx62wx48ldn55katd8zm5d6qfa6mupt9r4uul8eqxagsqct3je5",
"sender_sig": "0f3883b5413bb0e98136e5a84e112d5ffa5ab1db82f0997809692d09d3677610b168b26b76389deb18027b7fa0a3dd77d96729b5ee96b80e6682dd65259ce703"
}
let's try to slightly change the amount and use verify_proof command to check the integrity of the transaction.
grin-wallet verify_proof "/Users/workstation/Downloads/proof_invalid.txt"
Password:
20201219 11:28:07.469 ERROR grin_wallet_controller::command - Proof not valid: Payment Proof generation error: Invalid recipient signature
Wallet command failed: LibWallet Error: Payment Proof generation error: Invalid recipient signature
Proof of payment was not valid in our case
@mojitoo please include the output of command
grin-wallet -V
and your environment
uname -a
Description: By default, whenever a transaction is sent to a destination Slatepack Address, a payment proof is created automatically. Test that export and verification of a payment proof does not work for invalid proofs.
Note that as of right now, the payment proofs only work for the sender-initiated flow. They can't be done with the receiver-initiated flow (invoice).
Prerequisites: Setup two GRIN-Wallets (1) + (2) and send funds from wallet (1) to wallet (2) via Slatepacks through either Tor or Text method. This should create a payment proof for the sender.
There are 2 ways to make the proof invalid:
amount
orsender_address
value (or possibly alter the signature of the receiver or sender to make only one of them invalid)Example: The sender (wallet who finalized tx) can export the payment proof by specifying the tx-id (-i) or tx-log-id (-t) of a transaction, and choosing the path for the proof file, e.g:
He can then provide this proof to any wallet for verification. To verify:
This will ensure that:
Expected result: Payment proof verification should result in an invalid payment proof.
Note: More about these flows can be read on:
and your environment