diff --git a/basicswap/interface/xmr.py b/basicswap/interface/xmr.py index 636b90a..31d349e 100644 --- a/basicswap/interface/xmr.py +++ b/basicswap/interface/xmr.py @@ -181,7 +181,10 @@ class XMRInterface(CoinInterface): return edf.scalarmult_B(key) def encodeKey(self, vk): - return vk.hex() + return vk[::-1].hex() + + def decodeKey(self, k_hex): + return bytes.fromhex(k_hex)[::-1] def encodePubkey(self, pk): return edu.encodepoint(pk) @@ -216,9 +219,6 @@ class XMRInterface(CoinInterface): def lengthDLEAG(self): return dleag_proof_len() - def decodeKey(self, k_hex): - return bytes.fromhex(k_hex) - def sumKeys(self, ka, kb): return ed25519_scalar_add(ka, kb) diff --git a/basicswap/templates/bid_xmr.html b/basicswap/templates/bid_xmr.html index 59b2f2b..ebeb04b 100644 --- a/basicswap/templates/bid_xmr.html +++ b/basicswap/templates/bid_xmr.html @@ -94,6 +94,9 @@ {% if data.xmr_b_shared_address %}

Shared Address: {{ data.xmr_b_shared_address }}

{% endif %} +{% if data.xmr_b_shared_viewkey %} +

Shared View Key: {{ data.xmr_b_shared_viewkey }}

+{% endif %} {% if data.xmr_b_half_privatekey %}

Key Half: {{ data.xmr_b_half_privatekey }}

{% endif %} diff --git a/basicswap/ui/util.py b/basicswap/ui/util.py index daf02b3..4d4f3db 100644 --- a/basicswap/ui/util.py +++ b/basicswap/ui/util.py @@ -297,6 +297,7 @@ def describeBid(swap_client, bid, xmr_swap, offer, xmr_offer, bid_events, edit_b data['txns'] = txns data['xmr_b_shared_address'] = ci_to.encodeSharedAddress(xmr_swap.pkbv, xmr_swap.pkbs) if xmr_swap.pkbs else None + data['xmr_b_shared_viewkey'] = ci_to.encodeKey(xmr_swap.vkbv) if xmr_swap.vkbv else None if swap_client.debug_ui: try: