stellar/django-polaris

SEP-6: `Asset.distribution_account` is always used as anchor's receiving address

Closed this issue · 4 comments

I want to use muxed accounts as anchor receiving account instead account+memo

Validation here doesn't allow me to do it

receiving_account, memo_str, memo_type = validate_account_and_memo(

Are there any reasons to not allow to use MuxedAccount here? It looks much comfortble for users than memo - many of them forget to attach it to the transaction

Hi @nikita-gorodeckij,

The second line you point out is a bug, thanks for pointing that out, but the first is not.

The standard doesn't support using muxed accounts as receiving addresses for withdrawals. I think we'd need to discuss this at the protocol level before I change the code to support this.

SEP-6 withdraws require that the anchor specify a memo so that Polaris can match the payment made from the client to the anchor. These memos are per-transaction memos, they need to be unique per transaction so they disambiguate on-chain transactions.

Theoretically, you could just encode the per-transaction memo in the receiving address, creating a muxed account. This is something we should discuss on stellar-protocol. Note that wallets wouldn't have this functionality when you launch though, so it may be worth just using memos.

I'll update the code to ensure the correct receiving address is used. This is the one that comes from get_receiving_account_and_memo(). It defaults to asset.distribution_account anyway.

I'm going to change the title of the issue to highlight the bug that needs fixing here. But I'll open an issue on the protocol repo to discuss your use of muxed accounts.