SHOW:
|
|
- or go back to the newest paste.
| 1 | //idea 1 | |
| 2 | var rkeys = {};
| |
| 3 | rkeys = create_address(rand_32()); //for testing obviously | |
| 4 | var payID = {};
| |
| 5 | payID.ID = "0e0eedd4"; //for example, 32 bit | |
| 6 | payID.sec = sc_reduce32(cn_fast_hash(payID.ID)); //not used | |
| 7 | payID.pub = sec_key_to_pub(payID.sec); | |
| 8 | var txkey = random_keypair(); //same keypair used for tx | |
| 9 | var der = generate_key_derivation(rkeys.view.pub, txkey.sec); | |
| 10 | ver realPayID = derive_public_key(der, -1, payID.pub); //this actually works, though I've no idea of any concerns | |
| 11 | //could use index > last output instead of -1 | |
| 12 | //an integrated address like this would be 101 base58 characters instead of 139 now | |
| 13 | ||
| 14 | //idea 1.a (costs less) | |
| 15 | var rkeys = {};
| |
| 16 | rkeys = create_address(rand_32()); //for testing obviously | |
| 17 | var payID = {};
| |
| 18 | payID.ID = "0e0eedd4"; //for example, 32 bit | |
| 19 | 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" | |
| 20 | scalar for our realPayID. It appears to work without after numerous tests (in JS at least), but then again sc_reduce32 costs | |
| 21 | very little.*/ | |
| 22 | var txkey = random_keypair(); //same keypair used for tx | |
| 23 | var der = generate_key_derivation(rkeys.view.pub, txkey.sec); | |
| 24 | ver realPayID = derive_secret_key(der, -1, payID.sec); //this actually works, though I've no idea of any concerns | |
| 25 | //could use index > last output instead of -1 | |
| 26 | //an integrated address like this would be 101 base58 characters instead of 139 now | |
| 27 | ||
| 28 | //idea 2 | |
| 29 | /*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.*/ | |
| 30 | //actually idea 2 is really bad, it could be used to unmask txns heading to known addresses |