mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-11 16:15:16 -08:00
Port monero-lws to wownero-lws
Adapts monero-lws for Wownero cryptocurrency: - Rename all monero-lws-* binaries to wownero-lws-* - Update submodule to point to official Wownero repo - Use Wownero default ports (RPC: 34568, ZMQ: 34569) - Update data directory to ~/.wownero/light_wallet_server - Adapt next_difficulty() calls for Wownero API signature Key technical changes for Wownero compatibility: - BulletproofPlus (RCTTypeBulletproofPlus, type 8) commitment verification: Wownero stores BP+ commitments in 'divided by 8' form. Must call rct::scalarmult8() on outPk commitment before comparing with computed commitment (mask*G + amount*H). This is essential for amount decryption. - Pass rct_type to decode_amount() for proper commitment handling - Handle Wownero's ZMQ JSON format for ecdhTuple (32-byte mask/amount fields) No fork of Wownero is required - uses official codeberg.org/wownero/wownero.
This commit is contained in:
@@ -45,7 +45,7 @@ void lws::decrypt_payment_id(crypto::hash8& out, const crypto::key_derivation& k
|
||||
out.data[b] ^= hash.data[b];
|
||||
}
|
||||
|
||||
boost::optional<std::pair<std::uint64_t, rct::key>> lws::decode_amount(const rct::key& commitment, const rct::ecdhTuple& info, const crypto::key_derivation& sk, std::size_t index, const bool bulletproof2)
|
||||
boost::optional<std::pair<std::uint64_t, rct::key>> lws::decode_amount(const rct::key& commitment, const rct::ecdhTuple& info, const crypto::key_derivation& sk, std::size_t index, const bool bulletproof2, const std::uint8_t rct_type)
|
||||
{
|
||||
crypto::secret_key scalar{};
|
||||
crypto::derivation_to_scalar(sk, index, scalar);
|
||||
@@ -55,7 +55,14 @@ boost::optional<std::pair<std::uint64_t, rct::key>> lws::decode_amount(const rct
|
||||
|
||||
rct::key Ctmp;
|
||||
rct::addKeys2(Ctmp, copy.mask, copy.amount, rct::H);
|
||||
if (rct::equalKeys(commitment, Ctmp))
|
||||
|
||||
// Wownero BulletproofPlus: commitments are stored in "divided by 8" form
|
||||
// Must multiply by 8 (scalarmult8) before comparing
|
||||
rct::key C = commitment;
|
||||
if (rct_type == rct::RCTTypeBulletproofPlus)
|
||||
C = rct::scalarmult8(C);
|
||||
|
||||
if (rct::equalKeys(C, Ctmp))
|
||||
return {{rct::h2d(copy.amount), copy.mask}};
|
||||
return boost::none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user