eips icon indicating copy to clipboard operation
eips copied to clipboard

EIP-41 Stealth address standard

Open ross-weir opened this issue 2 years ago • 2 comments

ross-weir avatar Dec 17 '22 00:12 ross-weir

  1. There is no need to use registers to store gr, gy... parameters. Storing in a register of SELF (especially when accessed unconditionally with .get ) is always equivalent to embedding those values in the contract body (i.e. in ErgoTree). This is not only functionally equivalent, but also stored in the same box, just in different register.
  2. When registers are not used and parameters are embedded, no need to use special P2SA, because P2S will be enough and different receiverPublicKey will generate different P2S addresses.
  3. this will also solve scalability problem
  4. this encoding saves some space in box storage also
  5. all information necessary for wallet and other off-chain tools can be extracted from p2s address alone.
  6. when wallet user want to receive stealth payment, he need to choose the payment type, and then the wallet can generate p2s stealth address.
  7. even when gr, gy... parameters embedded in ErgoTree, they still can be segregated into constants array of ErgoTree and serve as paremeters of contract template
  8. talking about templates. wallets can adopt EIP-5 to generate parameterised addresses for different use cases. Stealth Address is one such use case, so it is a good application of Contract Template EIP-5

aslesarenko avatar Jan 13 '23 20:01 aslesarenko

  1. There is no need to use registers to store gr, gy... parameters. Storing in a register of SELF (especially when accessed unconditionally with .get ) is always equivalent to embedding those values in the contract body (i.e. in ErgoTree). This is not only functionally equivalent, but also stored in the same box, just in different register.
  2. When registers are not used and parameters are embedded, no need to use special P2SA, because P2S will be enough and different receiverPublicKey will generate different P2S addresses.
  3. this will also solve scalability problem
  4. this encoding saves some space in box storage also
  5. all information necessary for wallet and other off-chain tools can be extracted from p2s address alone.
  6. when wallet user want to receive stealth payment, he need to choose the payment type, and then the wallet can generate p2s stealth address.
  7. even when gr, gy... parameters embedded in ErgoTree, they still can be segregated into constants array of ErgoTree and serve as paremeters of contract template
  8. talking about templates. wallets can adopt EIP-5 to generate parameterised addresses for different use cases. Stealth Address is one such use case, so it is a good application of Contract Template EIP-5

Thanks a lot for the feedback!

Embedding values is something I thought about but decided against because the parameters (gr, gy...) are created from one-time secrets generated by the sender. Because there's no way for the receiver to know what values the sender used there's no way to know if a P2S address is a stealth payment for them, they'd still need to check all P2S addresses that look like a stealth payment to see if they're spendable - they may even check P2S addresses that look like stealth payments but aren't

ross-weir avatar Jan 14 '23 06:01 ross-weir