1

I'm trying to figure out how to validate the signature of a Monero transaction manually.

I've read this question: How to verify MLSAG sign with a real transaction and I am trying to recreate this example. It looks like the transaction is hashed to 25d83d029ac3eb919038b422326084e8aa4c7ff7db2f8891428d8bfe66c4abb5 and MLSAG_Ver can then be used to confirm that the signature in rctsig_prunable/MGs is valid. But I haven't been able to find any examples as to how this hash is calculated, so I'm hoping to get an example for both the transaction shown in that question (as well as the older RingCT type 2 transaction if possible).

What I've tried:

function sighash($l, $m, $r){
    $l = Sha3::hash(hex2bin($l), 256); //Keccak256 hash function
    $m = Sha3::hash(hex2bin($m), 256);
    $r = Sha3::hash(hex2bin($r), 256);
    return Sha3::hash(hex2bin($l.$m.$r), 256);
}

$l = '02000102000bda97ba08a9d6019dcd0194fa01ec458a0ce803bb01d202a401b2263352ef16ca15e8cbc67cd1ddd66ae3dc8ea904ab19db9a29de287a5d948b152e0200026ae6652253f1c77e93410f85bf0e495b306d2e5f4f2297ee4b4fc10fe871435c00028d703e7041838d747e5634b7ca6b990720c57f93e65f7f266b05e0dad6ca8b912c01ad79af52c10613be3b4a9a71bd2e8b92cdfa5fa2f548ba985fdd8385bb30947f020901d79d2e801fa7c27a';
$m = '049091a309fed5f2ae3250548eb60f5f3eb89676f186063e218c62711ff1991d89b3adb9824a26f3ee8e1c0e5ecbebf2951fb90b7d90716d8a6edc1bfdfba054fa5576d086056a7f3036956468e22148f0522fd6d4';
$r = '0143ceca385ba0d58b8a4f1740430130db045ad593e03f9a51bf1a66b0b2dd2b986a55f12a12ded59360d23271ceb518375c34e3e69cfff8578f2a77409fb7ddbf8ba64620054a4ef1f67a55d978e484ad891fb92e113b8cc88885f3c43632db38b55f16aa5328e7d7b296d9d6852e999c3c129cda31144392820d47e727b4a009cf2b47c99832dbfdc3358ecfd5db44f3d0d3aab9f269aefab130796d5206b702e916663e10ef7213504a3d14e87863d57528bf2c4f96957d8592e831f45c110507db0e4204cc15e34e775212c293b35f133f0ab21aa209ab4dbc88fcef359b46a08ec2236f70fb8bd3516e3c875a832d2de51659e25fef0b5a311c394a1f740859872b292334d934008e4c01b70826b278f8efc87933ef2d520542538bce9c62f197ef5461013d0b30f780ff089d27cd2c320b6fa26b159e8c4e5d60538a57c6c7004a54aecb38e3cca49b76fb27c95c23b4b5e42c5dcdaf1992dec119a9e6bd390c4ef356b0b61a4e865a9a0135905a9db7f2494fc0ff42e04302e405512fa2934b75a3dba15d8b6cf184a93bdd8956b0b1eca0fe7740545d5cf5559c6f8817d207bea0798be8166038312d3baa3037d16603978b5098cffb858d6f9f350e54f3396eed2f6f1ac98adb8df1981d646146622a5d8c14ce6bc726ea471ff60169a0e63c376abbd7b022f4a6b388095a1697cc55f1ea0292a9742653c734eefe7f3bf7b90cd936a72de9cd59c3f0171ea2496fefcc8693460f27a4c2e03c1d79cc35f8249f23e3ca3da67ff536df7477202cbfe99be75fb609677a8b7acdc312aafd331b90d57eaf2731a042ae0955905608e4c02401f50fbd9b61f8320a68ca82fc4ce713c19973f2de1baedb0d0cd4776a2c51f843d07b205924c246cd8bd93dfa3c5d249c4b1ef31c91040839edda8282d9dacb1e739343084a6626c57aec778c0e49d725342bb828b303257552d56c00b63545256b9af3ee69a10d597e893eea0a5e34f91f569b94c7d3d83a38012a804752174bfeed91f8150544591f98db9b0f8c3a4f1bb2ffce27aaed405f84b70d8e04ee00774399f8efd28b5f19f1c3d333';
echo sighash($l, $m, $r); //returns: 22967426bf12c748add7f2713532ac9f06f2d1341465d61b8b9a41135a75eebe

(Also, how difficult would it be to validate the bulletproof range proof? Also, I know the process of generating the transaction ID hash is similar to that of generating the hash to be signed, so how would that be done?)

Thank you!

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.