Cross-chain native asset swaps directly from MMGen Wallet!
Currently supported coins: BTC, LTC, BCH. Work on ETH support is underway.
All supported asset pairs have undergone thorough testing on mainnet.
Sample workflow for a BTC->LTC swap (assumes offline autosigning is set up and
the removable device inserted on the online machine):
$ mmgen-swaptxcreate --autosign BTC LTC
remove device - insert - wait for signing - remove - insert
$ mmgen-txsend --autosign
Note that other command-line options and arguments will likely be required. For
further information, see:
$ mmgen-swaptxcreate --help
Be aware that transactions stuck for a long time in the mempool can potentially
lead to loss of funds, so users should first learn how to create replacement
transactions with ‘mmgen-txbump’ before attempting a swap. In all cases, it’s
advisable to begin with small amounts. Double-checking the vault address on a
block explorer such as thorchain.net or runescan.io before sending the
transaction is also recommended.
Testing:
$ test/modtest.py tx.memo
$ test/cmdtest.py regtest_legacy.main autosign_automount swap
The former behavior permitted only increasing the transaction fee. Now the
replacement TX can contain entirely new outputs.
From mmgen-txbump --help:
If no outputs are specified, the original outputs will be used for the
replacement transaction, otherwise a new transaction will be created with
the outputs listed on the command line. The syntax for the output
arguments is identical to that of ‘mmgen-txcreate’.
Testing:
$ test/cmdtest.py regtest_legacy.main autosign_automount
$ test/cmdtest.py --coin=eth ethdev.main
From mmgen-txcreate --help:
A single DATA_SPEC argument may be given on the command line to create an
OP_RETURN data output with a zero spend amount. This is the preferred way to
embed data in the blockchain. DATA_SPEC may be of the form "data":DATA or
"hexdata":DATA
More info:
$ mmgen-txcreate --help
Testing:
$ test/modtest.py -v tx.op_return_data
$ test/cmdtest.py -ne swap
The following invocations now display a different set of options:
$ mmgen-txcreate --help
$ mmgen-txcreate --help --coin=eth
This feature was formerly available only for global options
Rationale: to enable communication with multiple coin daemons on multiple hosts
in a single program invocation, making possible the implementation of asset
swap functionality, for instance
Coin-specific options are prefixed with a coin symbol, proto-specific options
with a coin symbol plus a network name.
Coin- and protocol-specific options override their non-prefixed counterparts.
They are available via the command line, configuration file and Config API.
Currently available options:
Option Supported Prefixes
tw_name btc ltc bch
rpc_user btc ltc bch
rpc_password btc ltc bch
rpc_host btc ltc bch eth etc
rpc_port btc ltc bch eth etc xmr
ignore_daemon_version btc ltc bch eth etc xmr
max_tx_fee btc ltc bch eth etc
chain_names eth_mainnet eth_testnet etc_mainnet etc_testnet
Example:
$ mmgen-tool --coin=ltc --ltc-tw-name=ltc2 --ltc-ignore-daemon-version twview
Help:
$ mmgen-tool --longhelp
$ view mmgen/data/mmgen.cfg
Testing:
$ test/daemontest.py rpc.btc rpc.geth
$ test/cmdtest.py help opts cfgfile