Skip to content

Conversation

@nabijaczleweli
Copy link

@nabijaczleweli nabijaczleweli commented Dec 19, 2025

Closes #764

Ref: #775:

$ git diff -U0 upstream/master Cargo.lock | grep -FA1 '[[package]]' | paste - - -
-[[package]]    -name = "base58-monero" --
-[[package]]    -name = "fixed-hash"    --
-[[package]]    -name = "hex-literal"   --
-[[package]]    -name = "keccak-hash"   --
-[[package]]    -name = "monero"        --
+[[package]]    +name = "monero-amount" --
-[[package]]    -name = "primitive-types"       --
-[[package]]    -name = "rustc-hex"     --
-[[package]]    -name = "serde-big-array"       --
-[[package]]    -name = "tiny-keccak"

Note

Monero stack migration to monero-oxide

  • Introduces monero-oxide-ext (Amount, PrivateKey/PublicKey, address serde) and adds it to workspace and UI typeshare generation
  • Replaces monero with monero-address/monero-oxide-wallet types across crates (monero-sys, monero-wallet, monero-rpc-pool, swap-*, tests), updating APIs, serde, and network enums
  • Refactors monero-sys FFI and public API to new types; adjusts transaction key handling (map keys now address strings), reserve proof, balances, transfers, and listeners
  • Updates swap logic and compat layers (amount math, scalar conversions, address pools) and fixes tests/log expectations
  • Cleans up Cargo deps/patches and removes obsolete crates from lockfile

Written by Cursor Bugbot for commit 69b2e68. This will update automatically on new commits. Configure here.

@binarybaron
Copy link

Thanks a lot for taking this on!

I'll review this soon. Over the holidays I'll have less time but I'll try to make this a priority.

The general approach looks sound. One nitpick I have is that I'd like to have all the monero-oxide extension types (alternatives to monero-rs) moved into a single crate. Name would probably be monero-oxide-ext.

We should also take a look at how Cuprate handles this.

I'll leave more detailed actionable comments soon.

@nabijaczleweli
Copy link
Author

nabijaczleweli commented Dec 22, 2025

This does do this, I just called it monero-amount here.

@binarybaron
Copy link

In an abundance of caution, we should do a few manual tests to ensure backwards compatibility.

  • Stagenet swap where taker has applied the changes, maker has not
  • Stagenet swap where maker has applied the changes, taker has not
  • Stagenet swap where both have applied the changes

@binarybaron
Copy link

I'm also unsure if we should move the serde stuff in the new monero-oxide-ext into swap-serde or keep it in monero-oxide-ext. I'm leaning towards keeping them in monero-oxide-ext.

@nabijaczleweli
Copy link
Author

All our serde implementations live in the same files as the types they correspond to. swap-serde only exists for types which we haven't defined so they can't live in the same files. So moving this particular our-local-crate's to swap-serde would be inconsistent.

I leave the testing to you, I don't really know how to do those tests since I've never actually used this program for its intended purpose >_<

@binarybaron
Copy link

happy_path integration test fails:

2025-12-28T22:19:28.286826Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Advancing state state=xmr lock transaction sent rate=0.01000000 BTC
2025-12-28T22:19:28.288915Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Locked Monero, waiting for confirmations
2025-12-28T22:19:28.288956Z DEBUG swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Monero lock tx got new confirmation xmr_lock_txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac confirmations=0 target_confirmations=1
2025-12-28T22:19:28.290050Z DEBUG swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Monero lock tx got new confirmation xmr_lock_txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac confirmations=0 target_confirmations=1
2025-12-28T22:19:30.884923Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:30.886917Z  WARN monero_cpp: Received money: 35.175078729878, with tx: <ea79a73f826a920673a4398987a0ca6da187712e5fafe578c24550228475dbe9> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887187Z  WARN monero_cpp: Received money: 35.175011638739, with tx: <8b2d45d76e4aba60fc65b2970e547d0824c25de9f4a64be532dc2afe2adcdeed> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887415Z  WARN monero_cpp: Received money: 35.174944547729, with tx: <9c48377bc1ea3c678ce69f520c2c08236d2126db44fe60ecd60c42ebb0e6d096> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887661Z  WARN monero_cpp: Received money: 35.174877456847, with tx: <804f42107036e99a9b38b4f64eccca6f69786ee33c70fe106054cd6f306f1f1e> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887914Z  WARN monero_cpp: Received money: 35.174810366092, with tx: <b1bea3b80bb9ccd2751e3f26acdd4ed2a3a5f116d900c7de697246c5fe84f83c> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.888230Z  WARN monero_cpp: Received money: 35.174743275466, with tx: <8cbdaa49e0fa044b3802df84e6a4e09b7415a4ae2dcb66735fb8a5d8dc28e654> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.888528Z  WARN monero_cpp: Received money: 35.174676184967, with tx: <111fa1b4a034291ac979526da03b11a4f1bc5e85c059c81dec36fd761691fbd8> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.888766Z  WARN monero_cpp: Received money: 35.177208294597, with tx: <af77c37a6a15df8386e31a74aaeb9fe894fcaa08531a4574bdabc94569041bab> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.889009Z  WARN monero_cpp: Received money: 35.174542004354, with tx: <083ccaf2fc5d4c25e2b2be6ecccd0383195d5ec7d3f7a8c4e14706bd99680321> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.889075Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 5161.380285608418, unlocked: 3085.938920586376 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:31.361722Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:31.654827Z TRACE monero_wallet_ng::scanner::fetcher: Fetched blocks blocks=10 start=139 end=148
2025-12-28T22:19:31.662211Z TRACE monero_wallet_ng::scanner::scanner: Scanned batch of blocks found_outputs=0 batch_size=10
2025-12-28T22:19:35.868128Z  INFO monero_cpp: Refresh done, blocks received: 19, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:38.287074Z  INFO monero_cpp: Refresh done, blocks received: 19, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:38.293094Z  WARN monero_cpp: Received money: 0.997400800000, with tx: <b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:38.293312Z  WARN monero_cpp: Spent money: 1.000000000000, with tx: <b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:38.293381Z  WARN monero_cpp: Spent money: 1.000000000000, with tx: <b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:38.293784Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 8.997400800000, unlocked: 8.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:38.296856Z DEBUG swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Monero lock tx got new confirmation xmr_lock_txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac confirmations=9 target_confirmations=1
2025-12-28T22:19:38.299222Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Advancing state state=xmr is locked rate=0.01000000 BTC
2025-12-28T22:19:38.301337Z TRACE swap::cli::event_loop: Received transfer proof peer=12D3KooWNEbKH3svERi2AM5xAfhhWTMtjao5EZd74vcNexKKubVe msg.swap_id=995bc898-8017-4898-8881-aad29d48dbd2
2025-12-28T22:19:38.301474Z  INFO swap::protocol::bob::swap: Received Monero transfer proof from Alice transfer_proof=TransferProof { tx_hash: b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac, tx_key: PrivateKey { scalar: Scalar([75, 23, 48, 23, 14, 254, 51, 179, 16, 224, 202, 33, 186, 94, 102, 133, 226, 93, 218, 54, 161, 66, 136, 208, 14, 222, 171, 237, 189, 170, 242, 5]) } }
2025-12-28T22:19:38.301853Z TRACE swap::cli::event_loop: Dispatching outgoing transfer proof acknowledgment swap_id=995bc898-8017-4898-8881-aad29d48dbd2
2025-12-28T22:19:38.301870Z  INFO swap::cli::event_loop: Sent acknowledgment to Alice that we have received the transfer proof
2025-12-28T22:19:38.302303Z DEBUG swap::asb::event_loop: Bob acknowledged transfer proof peer=12D3KooWJhoTmVBL7Y9DGwfKjHqYJ54PY85S92awJedGcxtbEB2z
2025-12-28T22:19:38.302657Z DEBUG swap::protocol::bob::swap: Advancing state state=xmr lock transaction candidate found
2025-12-28T22:19:38.302666Z DEBUG swap::protocol::bob::swap: Validating Monero lock transaction candidate transfer_proof=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac
2025-12-28T22:19:38.302715Z DEBUG swap_core::bitcoin::lock: Constructed Bitcoin spending transaction fee=1000
2025-12-28T22:19:38.303502Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Advancing state state=xmr lock transfer proof sent rate=0.01000000 BTC
2025-12-28T22:19:38.308771Z  WARN swap::protocol::bob::swap: Monero lock transaction is invalid. It does not transfer the correct amount of Monero to the correct address. txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac
2025-12-28T22:19:38.309655Z DEBUG swap::protocol::bob::swap: Advancing state state=waiting for cancel timelock expiration
2025-12-28T22:19:38.309667Z  INFO swap::protocol::bob::swap: Waiting for cancel timelock to expire
2025-12-28T22:19:38.309718Z DEBUG swap_core::bitcoin::lock: Constructed Bitcoin spending transaction fee=1000
2025-12-28T22:19:41.671767Z TRACE monero_wallet_ng::scanner::fetcher: Fetched blocks blocks=9 start=149 end=157
2025-12-28T22:19:41.678497Z TRACE monero_wallet_ng::scanner::scanner: Scanned batch of blocks found_outputs=0 batch_size=9
2025-12-28T22:19:45.877845Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"

@binarybaron
Copy link

happy_path integration test fails:

2025-12-28T22:19:28.286826Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Advancing state state=xmr lock transaction sent rate=0.01000000 BTC
2025-12-28T22:19:28.288915Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Locked Monero, waiting for confirmations
2025-12-28T22:19:28.288956Z DEBUG swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Monero lock tx got new confirmation xmr_lock_txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac confirmations=0 target_confirmations=1
2025-12-28T22:19:28.290050Z DEBUG swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Monero lock tx got new confirmation xmr_lock_txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac confirmations=0 target_confirmations=1
2025-12-28T22:19:30.884923Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:30.886917Z  WARN monero_cpp: Received money: 35.175078729878, with tx: <ea79a73f826a920673a4398987a0ca6da187712e5fafe578c24550228475dbe9> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887187Z  WARN monero_cpp: Received money: 35.175011638739, with tx: <8b2d45d76e4aba60fc65b2970e547d0824c25de9f4a64be532dc2afe2adcdeed> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887415Z  WARN monero_cpp: Received money: 35.174944547729, with tx: <9c48377bc1ea3c678ce69f520c2c08236d2126db44fe60ecd60c42ebb0e6d096> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887661Z  WARN monero_cpp: Received money: 35.174877456847, with tx: <804f42107036e99a9b38b4f64eccca6f69786ee33c70fe106054cd6f306f1f1e> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.887914Z  WARN monero_cpp: Received money: 35.174810366092, with tx: <b1bea3b80bb9ccd2751e3f26acdd4ed2a3a5f116d900c7de697246c5fe84f83c> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.888230Z  WARN monero_cpp: Received money: 35.174743275466, with tx: <8cbdaa49e0fa044b3802df84e6a4e09b7415a4ae2dcb66735fb8a5d8dc28e654> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.888528Z  WARN monero_cpp: Received money: 35.174676184967, with tx: <111fa1b4a034291ac979526da03b11a4f1bc5e85c059c81dec36fd761691fbd8> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.888766Z  WARN monero_cpp: Received money: 35.177208294597, with tx: <af77c37a6a15df8386e31a74aaeb9fe894fcaa08531a4574bdabc94569041bab> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.889009Z  WARN monero_cpp: Received money: 35.174542004354, with tx: <083ccaf2fc5d4c25e2b2be6ecccd0383195d5ec7d3f7a8c4e14706bd99680321> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:30.889075Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 5161.380285608418, unlocked: 3085.938920586376 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:31.361722Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:31.654827Z TRACE monero_wallet_ng::scanner::fetcher: Fetched blocks blocks=10 start=139 end=148
2025-12-28T22:19:31.662211Z TRACE monero_wallet_ng::scanner::scanner: Scanned batch of blocks found_outputs=0 batch_size=10
2025-12-28T22:19:35.868128Z  INFO monero_cpp: Refresh done, blocks received: 19, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:38.287074Z  INFO monero_cpp: Refresh done, blocks received: 19, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:38.293094Z  WARN monero_cpp: Received money: 0.997400800000, with tx: <b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:38.293312Z  WARN monero_cpp: Spent money: 1.000000000000, with tx: <b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:38.293381Z  WARN monero_cpp: Spent money: 1.000000000000, with tx: <b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac> wallet=zap9_miner function="void tools::wallet2::process_new_transaction(const crypto::hash &, const cryptonote::transaction &, const std::vector<uint64_t> &, uint64_t, uint8_t, uint64_t, bool, bool, bool, const tx_cache_data &, std::map<std::pair<uint64_t, uint64_t>, size_t> *, bool)"
2025-12-28T22:19:38.293784Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 8.997400800000, unlocked: 8.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"
2025-12-28T22:19:38.296856Z DEBUG swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Monero lock tx got new confirmation xmr_lock_txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac confirmations=9 target_confirmations=1
2025-12-28T22:19:38.299222Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Advancing state state=xmr is locked rate=0.01000000 BTC
2025-12-28T22:19:38.301337Z TRACE swap::cli::event_loop: Received transfer proof peer=12D3KooWNEbKH3svERi2AM5xAfhhWTMtjao5EZd74vcNexKKubVe msg.swap_id=995bc898-8017-4898-8881-aad29d48dbd2
2025-12-28T22:19:38.301474Z  INFO swap::protocol::bob::swap: Received Monero transfer proof from Alice transfer_proof=TransferProof { tx_hash: b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac, tx_key: PrivateKey { scalar: Scalar([75, 23, 48, 23, 14, 254, 51, 179, 16, 224, 202, 33, 186, 94, 102, 133, 226, 93, 218, 54, 161, 66, 136, 208, 14, 222, 171, 237, 189, 170, 242, 5]) } }
2025-12-28T22:19:38.301853Z TRACE swap::cli::event_loop: Dispatching outgoing transfer proof acknowledgment swap_id=995bc898-8017-4898-8881-aad29d48dbd2
2025-12-28T22:19:38.301870Z  INFO swap::cli::event_loop: Sent acknowledgment to Alice that we have received the transfer proof
2025-12-28T22:19:38.302303Z DEBUG swap::asb::event_loop: Bob acknowledged transfer proof peer=12D3KooWJhoTmVBL7Y9DGwfKjHqYJ54PY85S92awJedGcxtbEB2z
2025-12-28T22:19:38.302657Z DEBUG swap::protocol::bob::swap: Advancing state state=xmr lock transaction candidate found
2025-12-28T22:19:38.302666Z DEBUG swap::protocol::bob::swap: Validating Monero lock transaction candidate transfer_proof=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac
2025-12-28T22:19:38.302715Z DEBUG swap_core::bitcoin::lock: Constructed Bitcoin spending transaction fee=1000
2025-12-28T22:19:38.303502Z  INFO swap{id=995bc898-8017-4898-8881-aad29d48dbd2}: swap::protocol::alice::swap: Advancing state state=xmr lock transfer proof sent rate=0.01000000 BTC
2025-12-28T22:19:38.308771Z  WARN swap::protocol::bob::swap: Monero lock transaction is invalid. It does not transfer the correct amount of Monero to the correct address. txid=b91d71c6a546522704eb15d276297f8be770ba730ef3b38ab393ae4e04ae46ac
2025-12-28T22:19:38.309655Z DEBUG swap::protocol::bob::swap: Advancing state state=waiting for cancel timelock expiration
2025-12-28T22:19:38.309667Z  INFO swap::protocol::bob::swap: Waiting for cancel timelock to expire
2025-12-28T22:19:38.309718Z DEBUG swap_core::bitcoin::lock: Constructed Bitcoin spending transaction fee=1000
2025-12-28T22:19:41.671767Z TRACE monero_wallet_ng::scanner::fetcher: Fetched blocks blocks=9 start=149 end=157
2025-12-28T22:19:41.678497Z TRACE monero_wallet_ng::scanner::scanner: Scanned batch of blocks found_outputs=0 batch_size=9
2025-12-28T22:19:45.877845Z  INFO monero_cpp: Refresh done, blocks received: 9, balance (all accounts): 0.000000000000, unlocked: 0.000000000000 wallet=zap9_miner function="void tools::wallet2::refresh(bool, uint64_t, uint64_t &, bool &, bool, bool, uint64_t)"

They pass on master.

@binarybaron
Copy link

binarybaron commented Dec 28, 2025

I believe we may be working with a wrong view key somewhere. Bob is trying to scan a particular Monero transaction and he wants to verify that the correct amount is being transferred. This check fails. Bob also does not detect the transaction on chain but needs Alice to the transfer proof to him. He usually sees it on chain beforehand (especially in integration tests).

@binarybaron
Copy link

I believe we may be working with a wrong view key somewhere. Bob is trying to scan a particular Monero transaction and he wants to verify that the correct amount is being transferred. This check fails. Bob also does not detect the transaction on chain but needs Alice to the transfer proof to him. He usually sees it on chain beforehand (especially in integration tests).

what did you change to fix this? the force push makes it hard to understand

@nabijaczleweli
Copy link
Author

Nothing, just a clean rebase

@binarybaron
Copy link

Compilations fails with:

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `monero`
   --> monero-sys/src/lib.rs:194:18
    |
194 |     pub address: monero::Address,
    |                  ^^^^^^ use of unresolved module or unlinked crate `monero`
    |
    = help: if you wanted to use a crate named `monero`, use `cargo add monero` to add it to your `Cargo.toml`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `monero`
    --> monero-sys/src/lib.rs:1744:73
     |
1744 |     pub fn address_at(&self, account_index: u32, address_index: u32) -> monero::Address {
     |                                                                         ^^^^^^ use of unresolved module or unlinked crate `monero`
     |
     = help: if you wanted to use a crate named `monero`, use `cargo add monero` to add it to your `Cargo.toml`

@nabijaczleweli
Copy link
Author

nabijaczleweli commented Jan 1, 2026

Means it wants another rebase maybe? Those lines are wrong to my checkout...

@nabijaczleweli
Copy link
Author

No, it wants to be built on the latest version of the source branch where this is fixed (444b182).

@binarybaron
Copy link

binarybaron commented Jan 2, 2026

444b182

~/Development/eigenwallet/wallet % git log -n 1
commit 313f715d4440cc1bf8cc65942a6565cdecdf0f70 (HEAD -> monero-rs, polish/monero-rs)
Author: наб <nabijaczleweli@nabijaczleweli.xyz>
Date:   Fri Dec 19 21:58:34 2025 +0100

    refactor(asb): monero-rs -> monero-oxide

    Ref: #764
~/Development/eigenwallet/wallet % git pull
Already up to date.
~/Development/eigenwallet/wallet % git status
On branch monero-rs
Your branch is up to date with 'polish/monero-rs'.

Did you push?

@binarybaron
Copy link

bugbot run

}

pub fn decompress(&self) -> Point {
self.point.decompress().expect("validated in constructor")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we ever construct this type without the constructor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

pub tx_keys: HashMap<monero::Address, monero::PrivateKey>,
///
/// Key is `MoneroAddress::to_string()`. It's not viable to use the address directly.
pub tx_keys: HashMap<String, monero_oxide_ext::PrivateKey>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is not viable? We can implement eq?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And MoneroAddress even implements PartialEq/Eq. But it doesn't implement Hash, and the type system is not good enough to let us work around this (I tried!).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I opened an issue here monero-oxide/monero-oxide#158

@nabijaczleweli
Copy link
Author

Rebased, hopefully fixed?

@binarybaron
Copy link

a44556a fixes it. Did you rebase on that one?

@binarybaron
Copy link

Yeah, needs another rebase...

@binarybaron
Copy link

bugbot run

(cant hurt)

@binarybaron
Copy link

See the failed CI:

error[E0412]: cannot find type `Address` in this scope
   --> monero-harness/src/lib.rs:470:86
    |
470 |     pub async fn address_at(&self, account_index: u32, address_index: u32) -> Result<Address> {
    |                                                                                      ^^^^^^^ not found in this scope
    |
help: consider importing one of these structs
    |
 23 + use monero_address::Address;
    |
 23 + use monero_oxide_ext::Address;
    |

@binarybaron binarybaron merged commit ef5a25d into eigenwallet:master Jan 5, 2026
46 of 56 checks passed
@binarybaron
Copy link

Bounty of 0.6 XMR + 0.18 XMR paid to @nabijaczleweli. Thank you for the contribution.

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.

[0.6 XMR] Switch entirely to monero-oxide

2 participants