Skip to content

Select the authored Mimblewimble on-chain note - #1522

Draft
sneurlax wants to merge 34 commits into
feat/slatepack-interfacefrom
fix/mimblewimble-on-chain-note
Draft

sneurlax wants to merge 34 commits into
feat/slatepack-interfacefrom
fix/mimblewimble-on-chain-note

Conversation

@sneurlax

@sneurlax sneurlax commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Select the actual participant-authored message for Epic/MWC transaction details, skipping an empty placeholder from the other participant.

This is intentionally stacked on #1507 and kept separate from the status-label correction.

Verification

  • on-chain-note tests: 3 passed
  • combined split integration suite: 136 passed
  • combined Linux release build: passed

Latest staging refresh (2026-11-17)

Rebased exactly onto the post-#1521 #1507 head a9c0d0efcddf; patch equivalence was confirmed with range-diff. New head: 02deffaecc38. The authored-note tests pass 3/3 with the dependency configuration regenerated from the new base. The GitHub Actions Test workflow completed green on the exact refreshed head.

The slatepack result types were identical apart from an Epic prefix, so
there is now one set. The epicbox/mwcmqs server and config models keep
their own classes, Hive type ids and JSON keys but inherit the common
fields from RelayServerModel and RelayConfigModel.
EpicTransaction/MwcTransaction and their message types had the same
fields. Both native interfaces now return MimblewimbleTransaction; the
templates in tool/wl_templates construct it, so regenerate lib/wl_gen
after pulling this.
Both wallets carried the same sync percent, scan loop, refresh
sequence, balance parsing, slate analysis and wallet info bookkeeping,
differing only in how they talk to their native library. The shared
parts now live in an abstract MimblewimbleWallet with hooks for the
native calls, and the slatepack/relay API (createSlatepack,
receiveSlatepack, finalizeSlatepack, getRelayConfig, ...) is declared
there so UI can be written against one type.

ExtraEpiccashWalletInfo and ExtraMimblewimblecoinWalletInfo had the
same JSON shape and are now one class; each wallet still stores it
under its own WalletInfoKeys entry.
The finalize view, entry/import/response dialogs, send-slatepack dialog
and method toggle existed twice, differing only in the wallet type they
cast to and in whether the copy said "slate" or "slatepack". They now
take a MimblewimbleWallet and pick their wording from SlatepackTerms.
The forked _createSlatepack/_importSlatepack/receive handlers in the
send, receive and confirm views collapse the same way.

EpicFinalizeView stays as a thin wrapper so its route name keeps
working. The transaction method enums and their providers become one
enum keyed by coin, keeping Epic's default of relay (epicbox) and MWC's
default of slatepack.
qr 3 only notices oversized data while painting, after qr_flutter's own
validation has passed, so a slatepack too long for a level L code threw
during build. QR now checks the data first and shows an errorStateBuilder,
defaulting to a short message.
SlatepackInterface is the coin-neutral contract the slatepack screens
use: supported methods, on-chain note and invoice capabilities, terms,
restore progress, inspectSlatepack, localTxForSlate, create/receive/
finalize, cancel, and unsupported defaults for pending slatepacks,
repost, invoices and payment proofs. MimblewimbleWallet mixes it in;
inspectSlatepack replaces fullDecodeSlatepack and analyzeSlatepack.
SlatepackResult gains state, slateId, amount and fee, FinalizeResult
gains posted and kernelExcess, and receive returns a SlatepackResult.

UI changes:
- Slatepack sends go through prepareSend and the confirm screen on
  mobile and desktop, so the fee is shown. Epic and MWC prepareSend tag
  otherData with the method; the confirm screen creates the slatepack.
- SlatepackImportFlow inspects any pasted slatepack and dispatches on
  its state: receive S1, finalize S2, placeholders for invoices, messages
  for finalized and unknown slates. Finalize summaries use the local tx.
- One SlatepackDialog for S1/S2/I1/I2 with copy, share, save to
  <slateId>.<state>.slatepack, the encrypted flag and a QR code only up
  to 1000 characters, tap to enlarge.
- SlatepackInputField: paste, scan (QrCodeScannerDialog on desktop) and
  open file with a 256 KiB cap, used wherever a slatepack is entered.
- The Finalize nav item and desktop tab become "Slatepack" and open the
  import flow. Desktop receive always shows the address and QR.
- The method toggle is per wallet instead of per coin.
- Casts to MimblewimbleWallet and coin gates in slatepack UI use the
  interface. Relay settings stay coin specific.

Dead code removed: Epic's isSlatepack, MWC's slatepack type detection
helpers and its slatepack-as-address branch in prepareSend.
desktopTextExtraSmall uses the disabled button text color, which is
nearly white on the desktop card, so the explanation above the input was
almost invisible. Use the subtitle color like the other slatepack hints.
Creating a slatepack did not compare the result with what the user had
just confirmed, reported failures as "Broadcast transaction failed"
although nothing is broadcast, and dropped the result without a trace
when the confirmation view had closed in the meantime.

A slatepack created for another amount is now cancelled and refused
with an error naming both amounts. A different fee is logged and shown
as a warning only, because the confirmed fee is an estimate and the
wallet may select other inputs when it builds the slate. Failures are
titled "Could not create the slate" or "slatepack". The sending dialog
is closed through a navigator looked up before the send, so it no
longer stays up when the view is gone, and that case is logged.
An imported response slatepack was offered for finalizing even when the
wallet had no transaction for it, with only a note in the summary, and
a transaction the wallet had received counted as a match.

The lookup now reports the direction of the local transaction, prefers
the send when a wallet holds both sides of a slate, and refreshes the
stored history once before giving up, since a send made moments ago may
not be in it yet. Without a send of its own the import flow explains
that only the wallet that started the transaction can finalize it and
no longer shows the Finalize button.
The slatepack dialog refused to draw a QR code for anything over 1000
characters. Epic Cash slates and MWC slatepacks can be longer than that
and were drawn at any length before the shared dialog replaced the
per-coin ones, so the longer ones lost their QR code.

The limit is now what a QR code can hold at the error correction level
the widget draws at, 2953 bytes, counted in bytes instead of
characters. Longer data still gets the note to copy, share or save it.
The import flow passed whatever was pasted, scanned or opened straight
to the wallet, so a slatepack with a greeting, a quote marker or other
text around it was rejected.

The flow now trims the text and, when it holds an armored slatepack,
keeps only the part from the begin marker to the end marker. Both the
BEGINSLATEPACK and BEGINSLATE_BIN frames are recognised, with or
without the final period. JSON slates and anything without a frame are
only trimmed. Inspecting, receiving and finalizing all use that text.
On the slatepack screen a second press of Continue could start the
import again while the first was still under way. On a phone the screen
closes the keyboard and waits briefly before it starts, which leaves
room for that, and the slatepack would then be processed twice.

The screen now tracks a running import, ignores further presses and
disables the button until the import has returned.
Receiving a slatepack takes a while. If the screen that started the
import was gone by the time the wallet had signed it, the response was
dropped without a word, even though the wallet had already recorded
the transaction and the sender still needs that response.

The import flow now keeps hold of the root navigator before it starts
and shows the response from there when its own screen has closed. It
logs the slate id in that case, and also when a finalize completes
after the screen closed. The response text itself is not logged.
The slatepack dialog shared its text without a position for the share
sheet. An iPad needs one to place the popover and refuses to open the
sheet without it, so Share did nothing there apart from logging an
error.

The dialog now passes the Share button's rect on screen. Other devices
ignore it.
The sending dialog was closed by popping the root navigator. If another
route had opened above the dialog by the time the send returned, that
route was popped and the dialog stayed up.

The dialog's route is now kept and removed directly, so nothing else is
closed. A failed HTTP address also closes the dialog when the view is
already gone.
The import flow showed its loading overlay through showLoading, which
only removes the overlay while the calling screen is still mounted. If
that screen closed while the wallet was working, the overlay stayed
over the whole app, under the response that is now shown in that case.

The flow keeps its own overlay route on the root navigator and removes
it when the wallet answers. An error is shown from the root navigator
too when the screen is gone.
@sneurlax
sneurlax marked this pull request as draft November 13, 2026 22:50
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.09%. Comparing base (a9c0d0e) to head (02deffa).

Files with missing lines Patch % Lines
lib/wallets/wallet/impl/epiccash_wallet.dart 0.00% 1 Missing ⚠️
...b/wallets/wallet/impl/mimblewimblecoin_wallet.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           feat/slatepack-interface    #1522   +/-   ##
=========================================================
  Coverage                     17.08%   17.09%           
=========================================================
  Files                          1147     1147           
  Lines                        113612   113616    +4     
=========================================================
+ Hits                          19415    19421    +6     
+ Misses                        94197    94195    -2     

☔ 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.

julian-CStack and others added 6 commits November 17, 2026 11:26
Both plugins turn a missing slate message into the string "null", and on
a send the first participant entry belongs to the recipient. Taking
messages.first therefore showed "null" as the on-chain note of every sent
transaction. Use the first participant message that has text.
@sneurlax
sneurlax force-pushed the fix/mimblewimble-on-chain-note branch from 181431e to 02deffa Compare November 17, 2026 19:55
@sneurlax
sneurlax force-pushed the feat/slatepack-interface branch 2 times, most recently from c9338d5 to 31224b6 Compare November 21, 2026 03:46
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.

2 participants