Skip to content

Add OpenAlias for Monero sends - #1456

Open
sneurlax wants to merge 8 commits into
stagingfrom
feat/openalias
Open

sneurlax wants to merge 8 commits into
stagingfrom
feat/openalias

Conversation

@sneurlax

@sneurlax sneurlax commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

@sneurlax
sneurlax marked this pull request as draft October 1, 2026 17:42
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.08029% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.55%. Comparing base (1e2e4d9) to head (680c4bb).
⚠️ Report is 30 commits behind head on staging.

Files with missing lines Patch % Lines
lib/services/openalias/open_alias_service.dart 85.71% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1456      +/-   ##
===========================================
+ Coverage     7.85%   10.55%   +2.69%     
===========================================
  Files         1125     1130       +5     
  Lines       112820   113685     +865     
===========================================
+ Hits          8866    11995    +3129     
+ Misses      103954   101690    -2264     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sneurlax
sneurlax marked this pull request as ready for review October 1, 2026 18:23
@sneurlax
sneurlax marked this pull request as draft October 7, 2026 02:17
@sneurlax

sneurlax commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

this is a valid impl but we are taking another approach that is WIP and the last few PRs merged in various cypherstack repos today indicate the approach (DYOR)

@sneurlax

sneurlax commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

TODO: drop Util.debugIsDesktopOverride and its test because #1465 added Util.layoutPlatform for the same purpose. Port open_alias_preview_test.dart to use it.

@sneurlax
sneurlax force-pushed the feat/openalias branch 2 times, most recently from 11db864 to 6357703 Compare October 15, 2026 01:07
@sneurlax
sneurlax marked this pull request as ready for review October 15, 2026 20:32
@julian-CStack
julian-CStack marked this pull request as draft October 16, 2026 12:40
Add cs_openalias, pinned by commit, and override its unpublished
constituents openalias, dnssec_resolver and doh_transport with pinned
commits too. doh_transport needs socks_socket ^2.0.0, so socks_socket
becomes a direct dependency at 2.0.0, and fusiondart and electrum_adapter
move to the revisions that accept it (electrum_adapter 3.0.2 -> 4.0.1,
the merge of cypherstack/electrum_adapter#15). The lock was resolved from
local checkouts of the pinned commits and carries the GitHub URLs, so it
resolves without local paths once those commits are on GitHub.
…a send

On Monero, an address field holding a name that has the form of an
OpenAlias counts as a valid recipient, so Preview is enabled and no
"Invalid address" is shown. Previewing such a send first looks the alias
up through cs_openalias behind the usual progress dialog, whose Cancel
cancels the lookup. The resolved address replaces the alias in the field
as a paste would, and the preview continues as for any literal address.
A failed or unavailable lookup shows the OpenAlias error and stops
before anything else runs.

OpenAliasService reads the Incognito and Tor settings for each lookup.
With Incognito mode on, or Tor on but unavailable, nothing is sent and
the error says why; otherwise it returns the facade's operation, routed
through the Tor proxy when Tor is on.
TxData gains an optional openAlias: the alias, trimmed and lowercased,
that the recipient's address was resolved from. copyWith keeps it.
The preview functions keep the alias they resolved in a local and pass it
as TxData.openAlias with the single recipient, so it is set only for the
send that resolved it. Other coins, literal addresses and multiple
recipients leave it null.
When the transaction carries an OpenAlias, the confirm screen shows it
labelled "OpenAlias" above the recipient on mobile and above "Send to" on
desktop.
@sneurlax
sneurlax marked this pull request as ready for review October 20, 2026 19:30
The cs_openalias pin moves with the code because cs_openalias 0.0.1
dropped `userMessage`, `openAliasLookupFailedTitle` and
`normalizeOpenAlias`. Pins cs_openalias 15b980d, openalias 46d8402,
dnssec_resolver 8e133d6 and doh_transport 3dbac48.

Resolved with `flutter pub get` against ~/.pub-cache git mirrors of
github.com/cypherstack/<pkg> fetched from the local checkouts; the URLs
resolve once those SHAs are on GitHub.
Only the generic branch passed the resolved alias into TxData, so the
Firo spark mint, transparent and spark sends and the MWEB send reached
the confirm screen without the alias row. Their prepare methods return
copies of the TxData they are given, so passing it in is enough.

PayNym sends are left alone: their recipient is the payment code, never
a typed address, so no alias can reach them.

No widget test: the preview harness fakes a Cryptonote wallet and the
lookup is still gated on Monero, so covering a Firo or MWEB branch
needs a new fake wallet rather than a case.
A coin that supports OpenAlias names the application of its records
(`oa1:xmr` for Monero) through `CryptoCurrency.openAliasApplication`,
null for every other coin. The send screens use that instead of checking
for Monero, pass the tag through the service to the lookup, and name the
coin in the lookup error texts. A coin opts in by overriding
openAliasApplication; the send views pass the alias through on every
path. Monero is the only coin that sets it.

Pins cs_openalias 84e3e85, which takes `application`, with openalias
46d8402, dnssec_resolver ea1f7c0 and doh_transport 7211549, resolved
the same way as before. openalias is also a dev dependency so the
application test can import it.
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.

1 participant