Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Stealth Short Payment IDs - proposal for shortening displayed payment IDs (to 32 bit), keeping full 32 byte "actual" payment IDs, AND incorporating a stealth feature to improve anonymity*/
- //proposal 1.4 (older ideas discarded as non-scalable)
- rkeys = create_address(rand_32()); //for testing
- var payId = "0123456789ab"; /*48 bit, ~281 trillion transactions available per account (started with 32 bit, but didn't want to fall into the "this ought to be enough for anybody" line of thinking). A new integrated address would be just 104 characters long vs 139 for present version.*/
- var payIdHash = cn_fast_hash(payId);
- var txkey = random_keypair(); //same keypair used for tx
- var der = generate_key_derivation(rkeys.view.pub, txkey.sec);
- var payIdOutput = derive_public_key(der, 0xFFFFFF, rkeys.spend.pub);
- var realPayId = hexXor(payIdOutput, payIdHash); //JS can only xor numbers, made up function to xor hex strings
- //receiver would:
- der = generate_key_derivation(txkey.pub, rkeys.view.sec); //txkey.pub from tx_extra
- payIdOutput = derive_public_key(der, 0xFFFFFF, rkeys.spend.pub);
- payIdHash = hexXor(payIdOutput, realPayId); //realPayId from tx_extra
- //*compare payIdHash with known set*
- /*Note on output index in derive_public_key operations: 0xFFFFFF is ~16.7 million, so a tx could have that many outputs before having overlap. Overlap would decode the payment ID to its hash, effectively revealing it for that tx. Another possibility would be to use an output index 1 higher than the last real output, but the idea of having a constant instead appeals to me at the moment. 0xFFFFFF is also 1 less than the square root of the number of possible short payment IDs. :P*/
- /*If a multiple destination tx was created, only the destination for which the payment ID was intended would be able to decode it due to the way derivations are generated.*/
Advertisement
Add Comment
Please, Sign In to add comment