Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-41 Stealth address standard #87

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ross-weir
Copy link

No description provided.

@ross-weir ross-weir changed the title [DRAFT] EIP-41 Stealth address standard EIP-41 Stealth address standard Dec 17, 2022
@ross-weir ross-weir marked this pull request as ready for review December 17, 2022 07:42
eip-0041.md Outdated Show resolved Hide resolved
eip-0041.md Outdated Show resolved Hide resolved
eip-0041.md Outdated Show resolved Hide resolved
eip-0041.md Outdated Show resolved Hide resolved
}
```

We propose adding a new address type of `AddressType.P2SA`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to describe how to encode a P2SA and make clear that it's a special kind of address, as it's not ErgoTree-based like others.

You can take this comment as the basis for that: #87 (comment)

@aslesarenko
Copy link
Member

aslesarenko commented Jan 13, 2023

  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

@ross-weir
Copy link
Author

  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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants