forked from such-gitea/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.
22 lines
632 B
C++
22 lines
632 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "wire/json.h"
|
|
#include "wire/adapted/crypto.h"
|
|
#include "ringct/rctTypes.h"
|
|
|
|
int main() {
|
|
std::string json = "\"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20\"";
|
|
rct::key key;
|
|
try {
|
|
wire::json_reader reader{epee::as_byte_span(json)};
|
|
wire::read_bytes(reader, key);
|
|
std::cout << "Parsed key: ";
|
|
for (int i = 0; i < 32; ++i) printf("%02x", key.bytes[i]);
|
|
std::cout << std::endl;
|
|
} catch (const std::exception& e) {
|
|
std::cerr << "Error: " << e.what() << std::endl;
|
|
}
|
|
return 0;
|
|
}
|