0xMiden / 0xMiden/protocol

`create_p2id_note` should take `Address` as parameter (or should it?)

Aberta
#1,837 2 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Rust
Estrelas
132
Forks
167
Merge médio
1d 23h
PRs com merge (30d)
110

Descrição

Three options:
1. `create_p2id_note` should take `Address` as parameter, or
2. we add a new `create_p2addr_note` function to live alongside `create_p2id_note`, or this option but also
3. remove `create_p2id_note` in favor of `create_p2addr_note`

Option 1.'s naming is confusing, so I would favor 2 or 3.

**Q1**: is `p2id` is useful once we have `p2addr`?
**A1**: (glossing over the `AddressInterface` part) I think the answer is "yes, but": sending public notes to public accounts doesn't need encryption or variable tag lengths, and *could* be achieved by `create_p2id_note`. But, having both functions will create more confusion than good imo.

**Q2**: Assuming we deprecate `create_p2id_note` in favor of `create_p2addr_note`, how does the sender obtain `Address` for a public account that hasn't published their `AccountId`?
**A2**: We need to construct some default `Address` based on the `AccountId`. We can choose some good defaults for public accounts:
- the default `tag_len` is based on whether the note is private/public, not the account, so we need a new default value based on the privacy of the account
- `None` for encryption key (once https://github.com/0xMiden/miden-base/issues/1741 lands)
- `AddressInterface::Unspecified` for the interface?

---

Regardless of whether we deprecate `create_p2id_note` or not, I would suggest that for now, we simply proceed with option 2. It will be a non-breaking change, and can be a patch release to address https://github.com/0xMiden/miden-private-transport/issues/23.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.