Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //idea 1
- var rkeys = {};
- rkeys = create_address(rand_32()); //for testing obviously
- var payID = {};
- payID.ID = "0e0eedd4"; //for example, 32 bit
- payID.sec = sc_reduce32(cn_fast_hash(payID.ID)); //not used
- payID.pub = sec_key_to_pub(payID.sec);
- var txkey = random_keypair(); //same keypair used for tx
- var der = generate_key_derivation(rkeys.view.pub, txkey.sec);
- ver realPayID = derive_public_key(der, -1, payID.pub); //this actually works, though I've no idea of any concerns
- //could use index > last output instead of -1
- //an integrated address like this would be 101 base58 characters instead of 139 now
- //idea 1.a (costs less)
- var rkeys = {};
- rkeys = create_address(rand_32()); //for testing obviously
- var payID = {};
- payID.ID = "0e0eedd4"; //for example, 32 bit
- payID.sec = sc_reduce32(cn_fast_hash(payID.ID)); /*I do not know if sc_reduce32 needs to be used, as we don't need a "real"
- scalar for our realPayID. It appears to work without after numerous tests (in JS at least), but then again sc_reduce32 costs
- very little.*/
- var txkey = random_keypair(); //same keypair used for tx
- var der = generate_key_derivation(rkeys.view.pub, txkey.sec);
- ver realPayID = derive_secret_key(der, -1, payID.sec); //this actually works, though I've no idea of any concerns
- //could use index > last output instead of -1
- //an integrated address like this would be 101 base58 characters instead of 139 now
- //idea 2
- /*I've decided idea 2 is not good (just using a different derivation as the paymentID), because while it's simpler and costs less, 32 bits does not create a good secret for the derivation.*/
- //actually idea 2 is really bad, it could be used to unmask txns heading to known addresses
Advertisement
Add Comment
Please, Sign In to add comment