mmgen-wallet/test/ref/thorchain/mainnet-tx-msgdeposit-refreq1.binpb
The MMGen Project ffe488ffbd
THORChain memoless swaps
Memoless swaps permit coins with long addresses and/or restricted memo space,
such as Monero, for example, to be swapped on THORChain.  They introduce added
complexity, along with certain privacy and security tradeoffs, so should only
be used for assets that cannot be swapped the usual way.

A reference request transaction (a.k.a. registration transaction) containing
the memo is sent to the THORChain network, which assigns it a number.  This
number is then encoded in the send amount of the swap transaction in lieu of
a memo.

See https://dev.thorchain.org/swap-guide/memoless-swaps.html for technical
details.

While this patch fully implements the feature in MMGen Wallet, it’s disabled
on mainnet for the time being.  Mainnet will be enabled after memoless swaps
are unhalted on THORChain mainnet and the feature can undergo live testing.

The following example is provided for purposes of illustration only. Normally
we would swap LTC to BCH the standard way.

Sample LTC-to-BCH memoless swap workflow (assumes --autosign):

    # Create the reference request transaction (pass 1):
    $ mmgen-swaptxcreate --memoless LTC 1.2345 BCH

    # Autosign the reference request transaction and send it:
    $ mmgen-txsend
    => TxID

    # Get the reference number from the THORChain network:
    $ mmgen-remote --coin=rune get_refnum TxID
    => REFNUM

    # Create the swap transaction (pass 2):
    $ mmgen-swaptxcreate --refnum=REFNUM LTC 1.2345 BCH

    # Sign and send the swap transaction:
    $ mmgen-txsend

    # Monitor your BCH wallet for the funds:
    $ mmgen-tool --coin=bch twview

Testing/demo:

    $ test/cmdtest.py -e swap.memoless

Note that the real send amount is the amount specified in the second invocation
of ‘mmgen-swaptxcreate’ (i.e. the swap transaction or second pass).  If you
omit the --trade-limit option, the amounts in the two invocations can differ,
otherwise amount and trade limit must be identical for both invocations.

Before sending, the software checks that the provided reference number is valid
and points to an address in the user’s tracking wallet.  Thus funds cannot be
sent to the wrong destination as a result of user error.

References remain valid for approximately six hours.  Before sending, the
software checks that the reference is valid, but not whether it is close to
expiration.  If the reference later expires before the swap transaction is
confirmed, there’s a danger of funds loss.  Therefore, it’s recommended to
create and broadcast the swap transaction without delay.  If necessary, the
transaction can be bumped to ensure timely confirmation.

In order to create and send the reference request transaction, the user must
have some RUNE in their wallet.  The current cost per transaction is 0.2 RUNE.

Also be aware of the privacy implications.  Swaps can easily be correlated if
their registration transactions spend from the same RUNE address, or from RUNE
addresses that can be linked via chain analysis.

More complete documentation will be provided at a later date.
2026-10-12 10:04:48 +00:00

443 B