On this page

latest contributor to this doc

Last Edit:

@gcharang

Change Log

This release introduces a range of significant features designed to enhance the framework’s capabilities. The trading protocol has been upgraded to boost the security and reliability of swaps. HD Wallets have been integrated to enhance privacy and streamline address management for both UTXO and EVM chains. Event Streaming has been implemented to provide clients with real-time balance updates, with more real-time events planned for future updates. Seed Management has been enhanced to ensure robust seed generation and storage. These features are complemented by advancements in the NFT feature, expanded chain support for Trezor, fee improvements, ARRR/Pirate support in browser environments, and updates to the Tendermint protocol that facilitate integration with external wallets.

  • Trading Protocol Upgrade:

    • A major upgrade to the trading protocol (enabled with "use_trading_proto_v2": true) was implemented by @artemii235 in several PRs. This upgrade is currently available only for UTXO/UTXO swaps. All other swap types are not yet supported with this new protocol.

    • This upgrade introduces significant enhancements:

      • Immediate refund handling for taker payments, including DEX fee refunds, and subsequent immediate maker payment refunds, effectively solving maker/taker backout issues.
      • New RPCs: my_swap_status, my_recent_swaps, and active_swaps V2.
      • Upgraded swap data is also accessible through V1 RPCs.
      • Important note: Seednodes must be updated to support and rebroadcast new swap protocol messages.
    • Relevant PRs: #1927, #1958, #1980, #2015, #2046.

  • HD Wallet:

    • HD wallet functionalities were fully implemented by @shamardy for UTXO and EVM coins, allowing users to enable the feature with "enable_hd": true. For Tendermint and Pirate coins, only a single address is supported, following the BIP32/39/44 standards.

    • This implementation simplifies the process of importing mnemonics from other wallets into the Komodo DeFi Framework (KDF), enabling users to retain their balances, transaction history, and more.

    • Users can now manage multiple addresses for UTXO and EVM coins, enhancing flexibility and control. The path_to_address parameter was added to coin activation requests to set the default account'/change/address_index path used for swaps. If not provided, the default path will be 0'/0/0.

    • HD withdrawals from any account'/change/address_index path were added for UTXO, EVM, Tendermint, and ARRR coins.

    • Address scanning for balances is supported through the scan_for_new_addresses RPC, and users can manage their HD wallet with new RPCs such as account_balance, get_new_address, and create_new_account.

    • These RPCs (scan_for_new_addresses, account_balance, get_new_address, and create_new_account) can be managed through the task manager using task::<rpc-name>::(init, cancel, status).

    • For full HD wallet functionalities, including balance scanning and withdrawals, use task manager-enabled methods like task::enable_eth::init, task::enable_qtum::init, task::enable_utxo::init, task::enable_erc20::init, and manage tasks through task::<rpc-name>::(init, cancel, status).

    • Task manager withdrawals are also supported using task::withdraw::init.

    • Relevant PRs: #1933, #1962.

  • Event Streaming:

    • Streaming channels using Server-Sent Events (SSE) to continuously send data to clients were implemented by @onur-ozkan in several PRs. This feature supports various event types, including P2P network events, coin balance events, error events, and heartbeat events.

    • P2P network events: Streaming real-time updates about the network status.

    • Coin balance events: For UTXOs, EVM, ARRR/Pirate by @borngraced, and Tendermint Protocols, providing continuous balance updates.

    • Error events: Emitted when there's an error in generating an event, ensuring robust monitoring.

    • Heartbeat events: Periodic notifications about the health of the streaming channel.

    • For WebAssembly (Wasm), event streaming uses Shared Workers instead of SSE, enabling a more flexible and efficient event handling mechanism.

      • SharedWorker support was added, allowing any worker path in event_stream_configuration, with a default to event_streaming_worker.js.
      • To handle broadcasted messages from the client side, an event listener must be implemented within the client browser environment to capture and process these events as they are streamed.
    • To utilize this feature, the event_stream_configuration needs to be added to the KDF config before starting.

    • Relevant PRs: #1945, #1978, #2013, #2041, #2058, #2076, #2080.

  • Seed Management:

    • Seed generation, encryption, and storage were implemented by @shamardy, introducing secure methods for seed handling, including strong encryption and key derivation techniques.

    • Introduced a new get_mnemonic API for retrieving mnemonics as plaintext or encrypted.

    • Added support for a wallet_name parameter in the configuration, enabling KDF to handle seed management.

      • If wallet_name is used, wallet_password must be provided, allowing for encrypted storage and retrieval of mnemonics.
      • If no mnemonic is provided, a new one is generated, encrypted, and stored.
      • Existing mnemonics can be imported and encrypted, or mnemonics can be imported in an encrypted format.
    • Introduced a global database for storing encrypted mnemonics and wallet names, separate from individual wallet-specific databases.

    • Seed management is fully integrated within KDF when wallet_name config parameter is used, bypassing the need for external mnemonic handling.

    • Relevant PRs: #2014, #1939.

  • The mm2 binaries have been renamed to kdf, with backward-compatible copies provided for mm2 naming. However, WASM binaries use the kdf naming only, which is a breaking change. #2126 by @shamardy

Full Changelog: https://github.com/KomodoPlatform/komodo-defi-framework/compare/v2.0.0-beta...v2.1.0-beta

  • KMD Burn:
    • KMD dex fee burn for upgraded swaps was added. #2046 by @artemii235
  • Network Enhancements:
    • A new sign_raw_transaction RPC was added for UTXO and EVM coins, facilitating future air-gapped wallet implementations. #1930 by @dimxy
  • Hardware Wallet:
    • Trezor now supports SegWit for withdrawals. #1984 by @dimxy
    • Trezor support was added for EVM coins/tokens using task manager activation methods. #1962 by @dimxy
    • Support for unsigned Tendermint transactions using Ledger's Keplr extension was added, excluding HTLC transactions and swap operations. #2148 by @onur-ozkan
  • NFT Integration:
    • A new clear_nft_db RPC for NFT data management was added, enabling selective or complete NFT DB data clearance. #2039 by @laruh
    • NFT can now be enabled using enable_eth_with_tokens or enable_nft, similar to enable_erc20. #2049 by @laruh
  • Simple Maker Bot:
    • Maker bot was updated to support multiple price URLs. #2027 by @shamardy
    • testcoin was added to provider options, allowing testing of the maker bot using test chain assets. #2161 by @shamardy
  • Swap Stats DB:
    • stats_swaps table now includes GUI and KDF version data used for a swap. #2061 by @mariocynicys
  • P2P Layer:
    • Added max_concurrent_connections to KDF config to control the maximum number of concurrent connections for Gossipsub. #2063 by @onur-ozkan
  • ARRR/Pirate:
    • ARRR/Pirate wallet and Dex operations now work in browser environments/WASM. #1957, #2077 by @borngraced
    • Syncing and activation improvements were made, including stopping sync status after main sync and refining first_sync_block handling. #2089 by @borngraced
  • EVM Transport:
    • ETH websocket transport was introduced, and komodo-defi-proxy signed messages were supported for websocket transport. #2058 by @onur-ozkan
  • Tendermint Integration:
    • Nucleus chain support was introduced as an alternative HTLC backend to Iris. #2079 by @onur-ozkan
    • Pubkey-only mode for Tendermint protocol was introduced, allowing use of any external wallet for wallet and swap operations. #2088 by @onur-ozkan
    • ibc_withdraw RPC was removed, and withdraw was refactored to support IBC transfers by automatically finding IBC channels. #2088 by @onur-ozkan
  • Fees Improvements:
    • EIP-1559 gas fee estimator and RPCs were added for ETH, including priority fee support for withdrawals and swaps, and improved gas limits for swap transactions. #2051 by @dimxy
    • gas_limit parameter can be used in coin configs to override default gas limit values. #2137 by @dimxy
  • Rust Toolchain:
    • Toolchain was upgraded to Rust toolchain version 1.72 nightly (nightly-2023-06-01). #2149 by @onur-ozkan
    • rust-analyzer was added into the workspace toolchain. #2179 by @onur-ozkan
  • CI Builds:
    • MacOS builds for Apple Silicon are now provided through the CI pipeline. #2163 by @CharlVS
  • Implemented root application directory .kdf under $HOME to consolidate all runtime files, enhancing user experience by following standard UNIX practices. #2102 by @onur-ozkan
  • Swaps and orders file handling was enhanced to use .tmp files to avoid concurrent reading/writing issues. #2118 by @dimxy
  • UTXO P2PK balance is now shown as part of the P2PKH/Legacy address balance and can be spent in withdrawals and swaps. #2053 by @mariocynicys

  • Additional checks were added for malicious token_uri links. #2100 by @laruh
  • Improved environment detection to ensure the correct method is used for accessing the IndexedDB factory, accommodating both window and worker contexts. #1953, #2131 by @onur-ozkan @borngraced
  • Cursor implementation was fixed, ensuring stable iteration over items. #2028 by @borngraced
  • Tendermint Integration:
    • Tendermint fee calculation was fixed to use get_receiver_trade_fee in platform coins. #2106 by @onur-ozkan
    • Transaction history handling was enhanced to support base64 encoded transaction values for Cosmos-based networks, preventing missing transactions in the history table. #2133 by @onur-ozkan
    • The precision of max amount handling was improved for Tendermint withdraw operations by simulating the transaction and removing the estimated fee. #2155 by @onur-ozkan
    • Account sequence numbers are now resolved locally, avoiding incorrect sequence numbers from cached responses. #2164 by @onur-ozkan
  • Swap Watchers:
    • UTXO swaps were fixed to apply events that occurred while the taker was offline, such as maker spending or watcher refunding the taker payment. #2114 by @dimxy
  • BCH block header deserialization was fixed to match BTC's handling of KAWPOW version headers. #2099 by @shamardy
  • wallet-only restriction was removed from max_maker_vol RPC, enabling its use for wallet-only mode assets. #2153 by @onur-ozkan

Introducing pivotal network enhancements to pave the way for an evolved DEX P2P network, Komodo DeFi Framework 2.0.0-beta marks a strategic step forward. This release not only streamlines network performance but also introduces a deflationary aspect to KMD, underscoring its utility and value in Komodo Platform's expanding ecosystem.

Features:

  • KMD Burn:
    • Burning 25% of the taker fee when paid in KMD was implemented by @onur-ozkan #2006
  • Swap watcher nodes (only for UTXO/UTXO swaps):
    • For UTXO/UTXO swaps, watcher nodes will either complete the swap for taker or refund the taker payment if the taker goes offline after sending their payment. This was implemented by @caglaryucekaya in #1457 #1496 #1523 #1552
    • Using watcher nodes for swaps were enabled by default for UTXO/UTXO swaps by @caglaryucekaya. All nodes doing a swap will broadcast a watcher message after the taker payment is sent if both coins swapped are supported by watchers (currently only UTXO) #1859

Enhancements:

  • Network Enhancements:
    • P2P layer was upgraded to use the latest stable libp2p version by @onur-ozkan #1878
    • 7777 network was deprecated by @onur-ozkan #2020.
    • Seednodes for netid 8762 were updated by @smk762 #2024
    • libp2p-yamux was updated by @onur-ozkan to use yamux v0.13 (new version) by default and to fall back to yamux v0.12 (old version) when setting any configuration options #2030
    • The backpressure buffer cap was increased from 25 to 256 by @onur-ozkan #2030
    • New protocol version (Version2) was added by @onur-ozkan to be used for peer exchange and request-response behaviours in #2030
    • Network information is now written to stdout so users can find mm2 ports easily @onur-ozkan #2034
  • NFT feature was released in v1.0.6-beta, this release adds significant enhancements to this feature:
    • exclude_spam and exclude_phishing params were added for get_nft_list and get_nft_transfers RPCs by @laruh #1959
    • Spam transfers with empty meta was fixed by @laruh to no longer update #1989
  • version method was added to PUBLIC_METHODS that require no login by @smk762 #2001
  • An additional PRICE_ENDPOINTS url which is a cached copy of https://prices.komodian.info/api/v2/tickers and is updated every minute was added by @smk762 #2032

Bug Fixes:

  • ARRR/Pirate:
    • ARRR infrastructure for lightwallet servers uses a fork of lightwalletd, the grpc service was renamed by @smk762 from cash.z.wallet.sdk.rpc to pirate.wallet.sdk.rpc to use the lightwalletd fork #1963
    • Previous blocks/wallet sync was fixed by @borngraced to be resumed if sync_params are not provided after restart #1967
  • EVM web3 requests timeout was reduced to 20s by @shamardy #1973
  • Fixed 0.0001 min threshold for TakerFee was removed by @shamardy #1971
  • The minimum trading volume for evm and tendermint was changed to be the smallest possible amount of the coin by @shamardy #1971
  • Minimum trading price was reduced by @shamardy to be any value above 0 #1971
  • Cryptocondition script type was added to utxo transactions by @shamardy #1991
  • On response error the next web3 node is now tried @shamardy #1998
  • Watchtower taker-side restart bug was fixed by @caglaryucekaya #1908
  • rpcport value can now accept a string @shamardy #2026

  • 7777 Network deprecation and the upgrade to a new p2p layer breaks compatibility with previous versions of Komodo DeFi Framework. Connections between nodes/clients running an older version of Komodo DeFi Framework and nodes/clients running this version will not be possible. To avoid this, all nodes/clients must be upgraded to the latest version of Komodo DeFi Framework.
  • Because of KMD burn of a part of the taker fee, the taker fee outputs for any coin/KMD swap are changed and makers running older versions will not be able to validate the taker fee, this will cause the swap to fail. This case will never happen anyway because older versions will not be able to connect to this latest version due to the network upgrade.
  • Because of the removal of the fixed 0.0001 min threshold for TakerFee, taker fee validation will also fail for these cases. Again, this case will never happen as the previous case.

Enhancements:

  • Using a specific start date for Pirate/ARRR synchronization was added by @borngraced. This allows users to specify a specific date as the starting point for synchronization as a substitute for the checkpoint block from config or syncing from the first block #1922

Bug Fixes:

  • PoSV coins withdrawal was fixed by @reddink. The issue was a missing n_time field in the generated transaction. The fix now correctly considers when n_time is required, and the rawtransaction can be broadcasted #1925
  • Tendermint tests were fixed by @onur-ozkan by using latest relayer channel #1929
  • Price service urls were updated by @smk762 #1928
  • NFT transactions that transfer multiple NFT tokens were fixed in db by @shamardy. log_index is now used as part of the transfers history table primary key #1926
  • A fix was introduced by @shamardy to use kmd rewards for fees if change + interest is below dust threshold #1944
  • Debug info was removed from release binary by @onur-ozkan to reduce the file size #1954
  • Failing tests due to BCHD were ignored by @shamardy #1955

New Features:

  • NFT Wallet APIs for ERC721/ERC1155 tokens using Moralis Web3 was added by @laruh for multiple EVM chains to enable developers to access real-time NFT data and metadata from various blockchains without building their own backend services in #1652 #1704 #1775 #1817 #1823 #1833 #1877

Enhancements:

  • HTTPS support was added for the RPC server by @shamardy in #1861
  • Infrastructure DNS rotation for default seed nodes was done by @ca333 in #1868
  • Price endpoints were updated by @laruh in #1869
  • IBC and standard withdrawals for Cosmos now allow users to specify the gas price and gas limit for each transaction @ozkanonur #1894
  • CI enhancements by @ozkanonur
    • The time needed for CI completion was reduced by caching the downloaded dependencies in #1880
    • Label validation on PRs was added. This validation will only succeed if one of the following labels is used but not both: under review or in progress #1881
    • A CI job was added to check if mm2 version was bumped before merging any pull request to main in #1899
    • All CI tests now run with the --no-fail-fast flag, allowing other tests to proceed despite any failures #1907

Bug Fixes:

  • Some RUSTSEC advisories were fixed by @ozkanonur in #1853
  • Orderbook response now returns the right age for the age field, this was fixed by @rozhkovdmitrii in #1851
  • A bug that caused best_orders rpc to return is_mine: false for the user's orders was fixed by @rozhkovdmitrii in #1849
    • An optional parameter exclude_mine was also added to the best_orders request that allows users to exclude their own orders from the response.
    • exclude_mine defaults to false to maintain the same behaviour before the PR.
  • A fix removed the passed config string from the error logs during mm2 initialization if there was a deserialization error was done by @shamardy in #1872
  • Index out of bounds errors in the tx_details_by_hash functions was fixed by @shamardy in #1915

  • Deprecated wasm-timer dependency was removed from atomicDEX-API tree by @ozkanonur in #1836
  • log, getrandom and wasm-bindgen dependencies were updated to more recent versions that are inline with the latest libp2p upstream by @ozkanonur in #1837
  • A CI lint pipeline was added that validates pull request titles to ensure that they comply with the conventional commit specifications by @ozkanonur in #1839
  • KMD AUR were reduced from 5% to 0.01% starting at nS7HardforkHeight to comply with KIP-0001 by @shamardy in #1841

  • Some enhancements were done for enable_bch_with_tokens, enable_eth_with_tokens, enable_tendermint_with_assets RPCs by @shamardy in #1762
    • A new parameter get_balances was added to the above methods requests, when this parameter is set to false, balances will not be returned in the response. The default value for this parameter is true to ensure backward compatibility.
    • Token balances requests are now performed concurrently for the above methods.
  • Passive parent coin state for keeping tokens active when platform is disabled was added by @ozkanonur in #1763
  • Detection of a chain reorganization for SPV was added by @borngraced @shamardy. If a chain reorg occurs, the new best chain headers are re-downloaded and re-validated #1728
  • Optimization of release compilation profile for mm2 was done by @ozkanonur in #1821
  • PoSV support for UTXO coins was added by @reddink in #1815

  • adex tool was introduced #1729
  • bump mm2 to v1.0.2-beta #1743
  • bump mm2 to v1.0.3-beta #1769
  • [release] v1.0.3 #1771

  • adex-cli command line utility was introduced that supplies commands: init, start, stop, status #1729
  • CI/CD workflow logics are improved #1736
  • Project root is simplified/refactored #1738
  • Created base image to provide more glibc compatible pre-built binaries for linux #1741
  • Set default log level as "info" #1747

  • 2 Update pirate & zombie domains for tests #1705
  • 2 lock free avoid on account sequence problems #1694
  • sec fixes, build-time optimizations, dependency optimizations, CI migration, etc #1699
  • [release] 1.0.1-beta #1721

  • 2 spv storage optimization #1 #1585
  • [doc] update mobile build instructions #1661
  • 2 disable_coin should fail if there are tokens dependent on the platform #1651
  • 2 fix vulnerable dependencies #1666
  • Bugfix pubkey keepalive overflow and "forever orders" #1668
  • 2 Hardware Wallet enhancements #1672
  • 2 Complete MetaMask #1674
  • Add workflow for VirusTotal results #1676
  • 2 refactor version handling #1686
  • [release] 1.0.0-beta #1576

  • Don't respond to GetKnownPeers p2p msg if the number of peers requested exceeds the default number by @shamardy in #1445
  • [r2r] Avoid deadlock on DuplexMutex by @sergeyboyko0791 in #1453
  • [r2r] Mobile libs code fixes, build instructions and CI. by @artemii235 in #1463
  • [r2r] hotfix: disallow withdraw to taproot addresses by @shamardy in #1503
  • update cc and cmake dependencies to be compatible with Visual Studio … by @DeckerSU in #1532
  • [r2r] Don't return an error if a UTXO coin is enabled with trezor_coin field by @sergeyboyko0791 in #1541

  • Target-branch added for dependabot in mm2.1 by @laruh in #1426
  • Skip orders not existing in orders_set instead of using expect. by @artemii235 in #1430
  • Fix ARRR activation. More info to activation statuses. Check point block by @artemii235 in #1439