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

cmd/addr: sub-address generation #24

Open
cirocosta opened this issue Aug 26, 2021 · 0 comments
Open

cmd/addr: sub-address generation #24

cirocosta opened this issue Aug 26, 2021 · 0 comments

Comments

@cirocosta
Copy link
Owner

cirocosta commented Aug 26, 2021

given that we have included the necessary crypto utils for generating the primary address, we could keep going and add support for subaddresses, which is not very far off.

from monero-project/monero#2056

I imagine we could do so by either extending the interface of Seed with an extra method Subaddress(major, minor uint32) []byte (1) or getting rid of PrimaryAddress() []byte and having only the subaddress one considering major=0,minor=0 the case for PrimaryAddress (2).

imo, (1) is the way to go.


m = Hs(a || i)
M = m*G
D = B + M
C = a*D

being

  • a being the master private view key
  • Hs being Keccak-256 with || representing the concatenation
  • G the base point of he ed25519 curve per cryptonote's paper
  • B being the master public spend key
  • C and D the generated public view and public spend keys that can be composed together to form the final address using the same method as we do for a primary address
  • * being scalar multiplication
  • + being compressed addition
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

No branches or pull requests

1 participant