SHOW:
|
|
- or go back to the newest paste.
| 1 | - | /*Stealth Short Payment IDs - proposals for shortening displayed payment IDs (to 32 bit), keeping full 32 byte "actual" payment IDs, AND incorporating a stealth feature to improve anonymity*/ |
| 1 | + | /*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*/ |
| 2 | ||
| 3 | - | //idea 1d |
| 3 | + | //proposal 1.4 (older ideas discarded as non-scalable) |
| 4 | - | var rkeys = {};
|
| 4 | + | |
| 5 | 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.*/ | |
| 6 | - | 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). An new integrated address would be just 104 characters long vs 139 for present version.*/ |
| 6 | + | |
| 7 | var txkey = random_keypair(); //same keypair used for tx | |
| 8 | var der = generate_key_derivation(rkeys.view.pub, txkey.sec); | |
| 9 | var payIdOutput = derive_public_key(der, 0xFFFFFF, rkeys.spend.pub); | |
| 10 | - | var payIdOutput = derive_public_key(der, -1, rkeys.spend.pub); |
| 10 | + | |
| 11 | ||
| 12 | //receiver would: | |
| 13 | der = generate_key_derivation(txkey.pub, rkeys.view.sec); //txkey.pub from tx_extra | |
| 14 | payIdOutput = derive_public_key(der, 0xFFFFFF, rkeys.spend.pub); | |
| 15 | - | payIdOutput = derive_public_key(der, -1, rkeys.spend.pub); |
| 15 | + | |
| 16 | //*compare payIdHash with known set* | |
| 17 | - | //compare payIdHash with known set |
| 17 | + | |
| 18 | /*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*/ | |
| 19 | - | /*Note on output index in derive_public/secret_key operations: -1 actually works in JS, but it should of course be tested and reviewed before actual use. 1> last real output index could be used instead of -1.*/ |
| 19 | + | |
| 20 | /*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.*/ |