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:
jwinterm
2026-01-04 13:12:56 -05:00
parent f2b3534002
commit 3427c60315
35 changed files with 789 additions and 395 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "external/monero"]
path = external/monero
url = https://github.com/monero-project/monero.git
url = https://codeberg.org/wownero/wownero.git

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2020, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -27,7 +28,7 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.5.0)
project(monero-lws)
project(wownero-lws)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
@@ -41,7 +42,7 @@ if (WITH_RMQ)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMLWS_RMQ_ENABLED")
endif()
# If `MONERO_BUILD_DIR` is not specified, monero unit tests will be built with this hack
# If `WOWNERO_BUILD_DIR` is not specified, wownero unit tests will be built with this hack
set (LWS_BUILD_TESTS "${BUILD_TESTS}")
set (BUILD_TESTS "Off")
@@ -64,10 +65,9 @@ if(STATIC)
endif()
endif()
set(MONERO_LIBRARIES
set(WOWNERO_LIBRARIES
daemon_messages
serialization
lmdb_lib
net
cryptonote_core
cryptonote_basic
@@ -80,6 +80,7 @@ set(MONERO_LIBRARIES
blockchain_db
common
lmdb
lmdb_lib
device
cncrypto
randomx
@@ -89,14 +90,15 @@ set(MONERO_LIBRARIES
wallet-crypto
)
set(MONERO_OPTIONAL wallet-crypto)
set(WOWNERO_OPTIONAL wallet-crypto)
if (MONERO_BUILD_DIR)
if (WOWNERO_BUILD_DIR)
set(MONERO_SEARCH_PATHS
set(WOWNERO_SEARCH_PATHS
"/contrib/epee/src"
"/external/db_drivers/liblmdb"
"/external/easylogging++"
"/external/randomwow"
"/src"
"/src/crypto"
"/src/crypto/wallet"
@@ -104,22 +106,42 @@ if (MONERO_BUILD_DIR)
"/src/lmdb"
"/src/ringct"
"/src/rpc"
"/src/common"
"/src/serialization"
"/src/net"
"/src/cryptonote_core"
"/src/multisig"
"/src/hardforks"
"/src/checkpoints"
"/src/blockchain_db"
"/src/device"
"/src/mnemonics"
)
#
# Pull some information from monero build
# Pull some information from wownero build
#
# Needed due to "bug" in monero CMake - the `project` function is used twice!
if (NOT MONERO_SOURCE_DIR)
message(FATAL_ERROR "The argument -DMONERO_SOURCE_DIR must specify a location of a monero source tree")
# Needed due to "bug" in wownero CMake - the `project` function is used twice!
if (NOT WOWNERO_SOURCE_DIR)
message(FATAL_ERROR "The argument -DWOWNERO_SOURCE_DIR must specify a location of a wownero source tree")
endif()
# monero `master` and `release-v0.18` branches use different LIBSODIUM
get_filename_component(WOWNERO_SOURCE_DIR "${WOWNERO_SOURCE_DIR}" ABSOLUTE)
get_filename_component(WOWNERO_BUILD_DIR "${WOWNERO_BUILD_DIR}" ABSOLUTE)
message(STATUS "WOWNERO_SOURCE_DIR: ${WOWNERO_SOURCE_DIR}")
message(STATUS "WOWNERO_BUILD_DIR: ${WOWNERO_BUILD_DIR}")
if (NOT EXISTS "${WOWNERO_BUILD_DIR}/CMakeCache.txt")
message(FATAL_ERROR "Wownero cache not found at ${WOWNERO_BUILD_DIR}/CMakeCache.txt. Please ensure WOWNERO_BUILD_DIR is correct and Wownero has been configured.")
endif()
# wownero `master` and release branches use different LIBSODIUM
# find routines. So the upstream cmake names differ
load_cache(${MONERO_BUILD_DIR} READ_WITH_PREFIX monero_
load_cache(${WOWNERO_BUILD_DIR} READ_WITH_PREFIX wownero_
Boost_THREAD_LIBRARY_RELEASE
CMAKE_CXX_COMPILER
EXTRA_LIBRARIES
@@ -127,13 +149,13 @@ if (MONERO_BUILD_DIR)
usb_LIBRARY
HIDAPI_INCLUDE_DIR
HIDAPI_LIBRARY
libzmq_INCLUDE_DIRS
LMDB_INCLUDE
monero_SOURCE_DIR
wownero_SOURCE_DIR
OPENSSL_INCLUDE_DIR
OPENSSL_CRYPTO_LIBRARY
OPENSSL_SSL_LIBRARY
pkgcfg_lib_libzmq_zmq
ZMQ_LIB
ZMQ_INCLUDE_PATH
sodium_LIBRARY_RELEASE
SODIUM_LIBRARY
UNBOUND_LIBRARIES
@@ -143,67 +165,75 @@ if (MONERO_BUILD_DIR)
PROTOLIB_LIBRARY
)
if (NOT (monero_monero_SOURCE_DIR MATCHES "${MONERO_SOURCE_DIR}"))
message(FATAL_ERROR "Invalid Monero source dir - does not appear to match source used for build directory")
if (wownero_wownero_SOURCE_DIR AND NOT (wownero_wownero_SOURCE_DIR MATCHES "${WOWNERO_SOURCE_DIR}"))
message(WARNING "Mismatch detected: wownero_wownero_SOURCE_DIR='${wownero_wownero_SOURCE_DIR}' vs WOWNERO_SOURCE_DIR='${WOWNERO_SOURCE_DIR}'. Proceeding anyway...")
endif()
if (NOT (CMAKE_CXX_COMPILER STREQUAL monero_CMAKE_CXX_COMPILER))
message(FATAL_ERROR "Compiler for monero build differs from this project")
if (wownero_CMAKE_CXX_COMPILER AND NOT (CMAKE_CXX_COMPILER STREQUAL wownero_CMAKE_CXX_COMPILER))
message(FATAL_ERROR "Compiler for wownero build (${wownero_CMAKE_CXX_COMPILER}) differs from this project (${CMAKE_CXX_COMPILER})")
endif()
if ("${monero_UNBOUND_LIBRARIES}" STREQUAL "UNBOUND_LIBRARIES-NOTFOUND")
unset(monero_UNBOUND_LIBRARIES)
if ("${wownero_UNBOUND_LIBRARIES}" STREQUAL "UNBOUND_LIBRARIES-NOTFOUND")
unset(wownero_UNBOUND_LIBRARIES)
endif()
if ("${monero_HIDAPI_LIBRARY}" STREQUAL "HIDAPI_LIBRARY-NOTFOUND")
unset(monero_HIDAPI_INCLUDE_DIR)
unset(monero_HIDAPI_LIBRARY)
if ("${wownero_HIDAPI_LIBRARY}" STREQUAL "HIDAPI_LIBRARY-NOTFOUND")
unset(wownero_HIDAPI_INCLUDE_DIR)
unset(wownero_HIDAPI_LIBRARY)
endif()
foreach (LIB ${MONERO_LIBRARIES})
find_library(LIB_PATH NAMES "${LIB}" PATHS ${MONERO_BUILD_DIR} PATH_SUFFIXES "/src/${LIB}" "external/${LIB}" ${MONERO_SEARCH_PATHS} NO_DEFAULT_PATH)
set(WOWNERO_LIBRARY_PATHS "")
foreach (PATH ${WOWNERO_SEARCH_PATHS})
list(APPEND WOWNERO_LIBRARY_PATHS "${WOWNERO_BUILD_DIR}${PATH}")
endforeach()
list(FIND MONERO_OPTIONAL "${LIB}" LIB_OPTIONAL)
foreach (LIB ${WOWNERO_LIBRARIES})
find_library(LIB_PATH NAMES "${LIB}" PATHS ${WOWNERO_BUILD_DIR} ${WOWNERO_LIBRARY_PATHS} PATH_SUFFIXES "/src/${LIB}" "external/${LIB}" NO_DEFAULT_PATH)
list(FIND WOWNERO_OPTIONAL "${LIB}" LIB_OPTIONAL)
if (NOT LIB_PATH)
if (LIB_OPTIONAL EQUAL -1)
message(FATAL_ERROR "Unable to find required Monero library ${LIB}")
message(FATAL_ERROR "Unable to find required Wownero library ${LIB}")
endif()
else ()
set(LIB_NAME "monero::${LIB}")
set(LIB_NAME "wownero::${LIB}")
add_library(${LIB_NAME} STATIC IMPORTED)
set_target_properties(${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_PATH})
list(APPEND IMPORTED_MONERO_LIBRARIES "${LIB_NAME}")
list(APPEND IMPORTED_WOWNERO_LIBRARIES "${LIB_NAME}")
endif()
unset(LIB_PATH CACHE)
endforeach()
set(LMDB_INCLUDE "${monero_LMDB_INCLUDE}")
set(LMDB_LIB_PATH "monero::lmdb")
else () # NOT MONERO_BUILD_DIR
if (NOT MONERO_SOURCE_DIR)
set (MONERO_SOURCE_DIR "${monero-lws_SOURCE_DIR}/external/monero")
set(LMDB_INCLUDE "${wownero_LMDB_INCLUDE}")
set(LMDB_LIB_PATH "wownero::lmdb")
else () # NOT WOWNERO_BUILD_DIR
if (NOT WOWNERO_SOURCE_DIR)
set (WOWNERO_SOURCE_DIR "${wownero-lws_SOURCE_DIR}/external/monero")
endif ()
include(FetchContent)
FetchContent_Declare(monero SOURCE_DIR "${MONERO_SOURCE_DIR}" EXCLUDE_FROM_ALL)
FetchContent_Declare(wownero SOURCE_DIR "${WOWNERO_SOURCE_DIR}" EXCLUDE_FROM_ALL)
if (NOT monero_POPULATED)
FetchContent_MakeAvailable(monero)
if (NOT wownero_POPULATED)
FetchContent_MakeAvailable(wownero)
endif ()
set(MONERO_BUILD_DIR "${monero_BINARY_DIR}")
set(IMPORTED_MONERO_LIBRARIES "${MONERO_LIBRARIES}")
set(monero_Boost_THREAD_LIBRARY_RELEASE "${Boost_THREAD_LIBRARY_RELEASE}")
set(monero_pkgcfg_lib_libzmq_zmq "${pkgcfg_lib_libzmq_zmq}")
set(WOWNERO_BUILD_DIR "${wownero_BINARY_DIR}")
set(IMPORTED_WOWNERO_LIBRARIES "${WOWNERO_LIBRARIES}")
set(LMDB_LIB_PATH "lmdb")
set(wownero_Boost_THREAD_LIBRARY_RELEASE "${Boost_THREAD_LIBRARY_RELEASE}")
# Wownero uses ZMQ_LIB directly (via find_library), not pkg-config
set(wownero_ZMQ_LIB "${ZMQ_LIB}")
set(wownero_ZMQ_INCLUDE_PATH "${ZMQ_INCLUDE_PATH}")
if (SODIUM_LIBRARY)
set(monero_SODIUM_LIBRARY "${SODIUM_LIBRARY}")
set(wownero_SODIUM_LIBRARY "${SODIUM_LIBRARY}")
else()
set(monero_SODIUM_LIBRARY "${monero_sodium_LIBRARY_RELEASE}")
set(wownero_SODIUM_LIBRARY "${wownero_sodium_LIBRARY_RELEASE}")
endif()
endif()
#
# Dependencies specific to monero-lws
# Dependencies specific to wownero-lws
#
set(THREADS_PREFER_PTHREAD_FLAG ON)
@@ -211,16 +241,28 @@ find_package(Threads REQUIRED)
# boost
set(Boost_NO_BOOST_CMAKE ON)
# If Wownero was built statically, we should probably do the same
if (WOWNERO_BUILD_DIR AND NOT STATIC)
if (wownero_Boost_THREAD_LIBRARY_RELEASE MATCHES ".*\\.a$")
message(STATUS "Wownero build was static, enabling STATIC for this project")
set(STATIC ON)
endif()
endif()
if(STATIC)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
find_package(Boost 1.70 QUIET REQUIRED COMPONENTS chrono context coroutine filesystem program_options regex serialization thread)
if (NOT (Boost_THREAD_LIBRARY STREQUAL monero_Boost_THREAD_LIBRARY_RELEASE))
message(STATUS "Found Boost_THREAD_LIBRARY: ${Boost_THREAD_LIBRARY}")
message(STATUS "Found monero_Boost_THREAD_LIBRARY_RELEASE: ${monero_Boost_THREAD_LIBRARY_RELEASE}")
message(FATAL_ERROR "Boost libraries for monero build differs from this project")
get_filename_component(REAL_Boost_THREAD_LIBRARY "${Boost_THREAD_LIBRARY}" REALPATH)
get_filename_component(REAL_wownero_Boost_THREAD_LIBRARY "${wownero_Boost_THREAD_LIBRARY_RELEASE}" REALPATH)
if (NOT (REAL_Boost_THREAD_LIBRARY STREQUAL REAL_wownero_Boost_THREAD_LIBRARY))
message(STATUS "Found Boost_THREAD_LIBRARY: ${Boost_THREAD_LIBRARY} (real: ${REAL_Boost_THREAD_LIBRARY})")
message(STATUS "Found wownero_Boost_THREAD_LIBRARY_RELEASE: ${wownero_Boost_THREAD_LIBRARY_RELEASE} (real: ${REAL_wownero_Boost_THREAD_LIBRARY})")
message(FATAL_ERROR "Boost libraries for wownero build differs from this project")
endif()
if (WITH_RMQ)
@@ -231,61 +273,88 @@ else()
set(RMQ_LIBRARY "")
endif()
set(ZMQ_INCLUDE_PATH "${libzmq_INCLUDE_DIRS}")
set(ZMQ_LIB "${monero_pkgcfg_lib_libzmq_zmq}")
if (monero_SODIUM_LIBRARY)
set(SODIUM_LIBRARY "${monero_SODIUM_LIBRARY}")
# Use ZMQ from Wownero build
if (wownero_ZMQ_INCLUDE_PATH)
set(ZMQ_INCLUDE_PATH "${wownero_ZMQ_INCLUDE_PATH}")
endif()
if (wownero_ZMQ_LIB)
set(ZMQ_LIB "${wownero_ZMQ_LIB}")
endif()
if (wownero_SODIUM_LIBRARY)
set(SODIUM_LIBRARY "${wownero_SODIUM_LIBRARY}")
else ()
set(SODIUM_LIBRARY "${monero_sodium_LIBRARY_RELEASE}")
set(SODIUM_LIBRARY "${wownero_sodium_LIBRARY_RELEASE}")
endif ()
if(NOT ZMQ_LIB)
message(FATAL_ERROR "Could not find required libzmq")
endif()
if(monero_PGM_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${monero_PGM_LIBRARY}")
if(wownero_PGM_LIBRARY AND NOT "${wownero_PGM_LIBRARY}" STREQUAL "PGM_LIBRARY-NOTFOUND")
set(ZMQ_LIB "${ZMQ_LIB};${wownero_PGM_LIBRARY}")
endif()
if(monero_NORM_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${monero_NORM_LIBRARY}")
if(wownero_NORM_LIBRARY AND NOT "${wownero_NORM_LIBRARY}" STREQUAL "NORM_LIBRARY-NOTFOUND")
set(ZMQ_LIB "${ZMQ_LIB};${wownero_NORM_LIBRARY}")
if(NOT wownero_PROTOLIB_LIBRARY OR "${wownero_PROTOLIB_LIBRARY}" STREQUAL "PROTOLIB_LIBRARY-NOTFOUND")
find_library(PROTOLIB_LIBRARY NAMES protokit protolib)
if(PROTOLIB_LIBRARY)
set(wownero_PROTOLIB_LIBRARY "${PROTOLIB_LIBRARY}")
endif()
endif()
endif()
if(monero_GSSAPI_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${monero_GSSAPI_LIBRARY}")
if(wownero_GSSAPI_LIBRARY AND NOT "${wownero_GSSAPI_LIBRARY}" STREQUAL "GSSAPI_LIBRARY-NOTFOUND")
set(ZMQ_LIB "${ZMQ_LIB};${wownero_GSSAPI_LIBRARY}")
endif()
if(monero_PROTOLIB_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${monero_PROTOLIB_LIBRARY}")
if(wownero_PROTOLIB_LIBRARY AND NOT "${wownero_PROTOLIB_LIBRARY}" STREQUAL "PROTOLIB_LIBRARY-NOTFOUND")
set(ZMQ_LIB "${ZMQ_LIB};${wownero_PROTOLIB_LIBRARY}")
endif()
if(monero_sodium_LIBRARY_RELEASE)
set(ZMQ_LIB "${ZMQ_LIB};${monero_sodium_LIBRARY_RELEASE}")
if(wownero_sodium_LIBRARY_RELEASE AND NOT "${wownero_sodium_LIBRARY_RELEASE}" STREQUAL "sodium_LIBRARY_RELEASE-NOTFOUND")
set(ZMQ_LIB "${ZMQ_LIB};${wownero_sodium_LIBRARY_RELEASE}")
endif()
if(STATIC AND NOT IOS)
if(UNIX)
set(monero_OPENSSL_LIBRARIES "${monero_OPENSSL_LIBRARIES};${CMAKE_DL_LIBS};${CMAKE_THREAD_LIBS_INIT}")
find_package(ZLIB)
if(ZLIB_FOUND)
set(wownero_OPENSSL_CRYPTO_LIBRARY "${wownero_OPENSSL_CRYPTO_LIBRARY};${ZLIB_LIBRARIES}")
endif()
find_library(ZSTD_LIBRARY NAMES zstd)
if(ZSTD_LIBRARY)
set(wownero_OPENSSL_CRYPTO_LIBRARY "${wownero_OPENSSL_CRYPTO_LIBRARY};${ZSTD_LIBRARY}")
else()
set(wownero_OPENSSL_CRYPTO_LIBRARY "${wownero_OPENSSL_CRYPTO_LIBRARY};zstd")
endif()
find_library(EVENT_LIBRARY NAMES event libevent)
if(EVENT_LIBRARY)
set(wownero_UNBOUND_LIBRARIES "${wownero_UNBOUND_LIBRARIES};${EVENT_LIBRARY}")
else()
set(wownero_UNBOUND_LIBRARIES "${wownero_UNBOUND_LIBRARIES};event")
endif()
set(wownero_OPENSSL_LIBRARIES "${wownero_OPENSSL_LIBRARIES};${CMAKE_DL_LIBS};${CMAKE_THREAD_LIBS_INIT};rt")
endif()
endif()
if(APPLE)
find_library(IOKIT_LIBRARY IOKit)
list(APPEND IMPORTED_MONERO_LIBRARIES ${IOKIT_LIBRARY})
list(APPEND IMPORTED_WOWNERO_LIBRARIES ${IOKIT_LIBRARY})
endif()
add_library(monero::libraries INTERFACE IMPORTED)
set_property(TARGET monero::libraries PROPERTY
add_library(wownero::libraries INTERFACE IMPORTED)
set_property(TARGET wownero::libraries PROPERTY
INTERFACE_INCLUDE_DIRECTORIES
${Boost_INCLUDE_DIR}
${monero_HIDAPI_INCLUDE_DIRS}
${monero_OPENSSL_INCLUDE_DIR}
"${MONERO_BUILD_DIR}/generated_include"
"${MONERO_SOURCE_DIR}/contrib/epee/include"
"${MONERO_SOURCE_DIR}/external/easylogging++"
"${MONERO_SOURCE_DIR}/external/rapidjson/include"
"${MONERO_SOURCE_DIR}/external/supercop/include"
"${MONERO_SOURCE_DIR}/src"
${wownero_HIDAPI_INCLUDE_DIRS}
${wownero_OPENSSL_INCLUDE_DIR}
"${WOWNERO_BUILD_DIR}/generated_include"
"${WOWNERO_SOURCE_DIR}/contrib/epee/include"
"${WOWNERO_SOURCE_DIR}/external/easylogging++"
"${WOWNERO_SOURCE_DIR}/external/rapidjson/include"
"${WOWNERO_SOURCE_DIR}/external/supercop/include"
"${WOWNERO_SOURCE_DIR}/src"
)
set_property(TARGET monero::libraries PROPERTY
set_property(TARGET wownero::libraries PROPERTY
INTERFACE_LINK_LIBRARIES
${IMPORTED_MONERO_LIBRARIES}
${IMPORTED_WOWNERO_LIBRARIES}
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
@@ -293,18 +362,21 @@ set_property(TARGET monero::libraries PROPERTY
${Boost_SERIALIZATION_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${monero_HIDAPI_LIBRARY}
${monero_usb_LIBRARY}
${monero_LIBUDEV_LIBRARY}
${monero_OPENSSL_SSL_LIBRARY}
${monero_OPENSSL_CRYPTO_LIBRARY}
${wownero_HIDAPI_LIBRARY}
${wownero_usb_LIBRARY}
${wownero_LIBUDEV_LIBRARY}
${wownero_OPENSSL_SSL_LIBRARY}
${wownero_OPENSSL_CRYPTO_LIBRARY}
${SODIUM_LIBRARY}
${monero_UNBOUND_LIBRARIES}
${wownero_UNBOUND_LIBRARIES}
${ZMQ_LIB}
${CMAKE_DL_LIBS}
Threads::Threads
rt
)
#
# Build monero-lws code
# Build wownero-lws code
#
add_subdirectory(src)

View File

@@ -1,7 +1,8 @@
# Initial base from https://github.com/sethforprivacy/monero-lws/blob/588c7f1965d3afbda8a65dc870645650e063e897/Dockerfile
# Adapted for Wownero by The Wownero Project
# Set monerod version to install from github
ARG MONERO_COMMIT_HASH=d32b5bfe18e2f5b979fa8dc3a8966c76159ca722
# Set wownerod version to install from codeberg
ARG WOWNERO_COMMIT_HASH=v0.11.4.0
# Select ubuntu:22.04 for the build image base
FROM ubuntu:22.04 as build
@@ -34,9 +35,9 @@ RUN apt-get install --no-install-recommends -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set necessary args and environment variables for building Monero
ARG MONERO_BRANCH
ARG MONERO_COMMIT_HASH
# Set necessary args and environment variables for building Wownero
ARG WOWNERO_BRANCH
ARG WOWNERO_COMMIT_HASH
ARG NPROC
ARG TARGETARCH
ENV CFLAGS='-fPIC'
@@ -88,13 +89,13 @@ RUN set -ex && wget https://archives.boost.io/release/1.89.0/source/boost_1_89_0
--with-chrono --with-context --with-coroutine --with-date_time --with-filesystem --with-locale \
--with-program_options --with-regex --with-serialization --with-serialization install
# Switch to Monero source directory
WORKDIR /monero
# Switch to Wownero source directory
WORKDIR /wownero
# Git pull Monero source at specified tag/branch and compile monerod binary
# Git pull Wownero source at specified tag/branch and compile wownerod binary
RUN git clone --recursive \
https://github.com/monero-project/monero . \
&& git checkout ${MONERO_COMMIT_HASH} \
https://codeberg.org/wownero/wownero.git . \
&& git checkout ${WOWNERO_COMMIT_HASH} \
&& git submodule init && git submodule update \
&& mkdir -p build/release && cd build/release \
# Create make build files manually for release-static-linux-${TARGETARCH}
@@ -103,11 +104,11 @@ RUN git clone --recursive \
"amd64") cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="linux-x64" ../.. ;; \
*) echo "Dockerfile does not support this platform"; exit 1 ;; \
esac \
# Build only monerod binary using number of available threads
&& cd /monero && nice -n 19 ionice -c2 -n7 make -j${NPROC:-$(nproc)} -C build/release daemon lmdb_lib multisig
# Build only wownerod binary using number of available threads
&& cd /wownero && nice -n 19 ionice -c2 -n7 make -j${NPROC:-$(nproc)} -C build/release daemon lmdb_lib multisig
# Switch to monero-lws source directory
WORKDIR /monero-lws
# Switch to wownero-lws source directory
WORKDIR /wownero-lws
COPY . .
@@ -115,27 +116,28 @@ ARG NPROC
RUN set -ex \
&& git submodule init && git submodule update \
&& rm -rf build && mkdir build && cd build \
&& cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_TESTS=ON -D WITH_RMQ=ON -D MONERO_SOURCE_DIR=/monero -D MONERO_BUILD_DIR=/monero/build/release .. \
&& cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_TESTS=ON -D WITH_RMQ=ON -D WOWNERO_SOURCE_DIR=/wownero -D WOWNERO_BUILD_DIR=/wownero/build/release .. \
&& make -j${NPROC:-$(nproc)} \
&& ./tests/unit/monero-lws-unit
&& ./tests/unit/wownero-lws-unit
# Begin final image build
# Select Ubuntu 20.04LTS for the image base
# Select Ubuntu 22.04LTS for the image base
FROM ubuntu:22.04
# Add user and setup directories for monero-lws
RUN useradd -ms /bin/bash monero-lws \
&& mkdir -p /home/monero-lws/.bitmonero/light_wallet_server \
&& chown -R monero-lws:monero-lws /home/monero-lws/.bitmonero
USER monero-lws
# Add user and setup directories for wownero-lws
RUN useradd -ms /bin/bash wownero-lws \
&& mkdir -p /home/wownero-lws/.wownero/light_wallet_server \
&& chown -R wownero-lws:wownero-lws /home/wownero-lws/.wownero
USER wownero-lws
# Switch to home directory and install newly built monero-lws binary
WORKDIR /home/monero-lws
COPY --chown=monero-lws:monero-lws --from=build /monero-lws/build/src/monero-lws-daemon /usr/local/bin/
COPY --chown=monero-lws:monero-lws --from=build /monero-lws/build/src/monero-lws-admin /usr/local/bin/
# Switch to home directory and install newly built wownero-lws binary
WORKDIR /home/wownero-lws
COPY --chown=wownero-lws:wownero-lws --from=build /wownero-lws/build/src/wownero-lws-daemon /usr/local/bin/
COPY --chown=wownero-lws:wownero-lws --from=build /wownero-lws/build/src/wownero-lws-admin /usr/local/bin/
# Expose REST server port
EXPOSE 8443
ENTRYPOINT ["monero-lws-daemon"]
CMD ["--daemon=tcp://monerod:18082", "--sub=tcp://monerod:18083", "--log-level=4"]
ENTRYPOINT ["wownero-lws-daemon"]
# Wownero default RPC port is 34568, ZMQ pub is 34569
CMD ["--daemon=tcp://wownerod:34568", "--sub=tcp://wownerod:34569", "--log-level=4"]

443
README.md
View File

@@ -1,44 +1,74 @@
# monero-lws
# wownero-lws
> This project is **NOT** a part of the official monero "core" code, but will
> hopefully be merged into that project as a new repository seperate from the
> [`monero-project/monero`](https://github.com/monero-project/monero)
> repository.
> This is a fork of [monero-lws](https://github.com/vtnerd/monero-lws) adapted
> for the Wownero cryptocurrency. We aim to stay compatible with upstream
> changes to ease merging of security and feature updates.
## Table of Contents
- [Introduction](#introduction)
- [About this project](#about-this-project)
- [Changes from monero-lws](#changes-from-monero-lws)
- [License](#license)
- [Compiling from source](#compiling-from-source)
- [Running wownero-lws](#running-wownero-lws)
- [Docker](#docker)
- [Compiling Monero-lws from source](#compiling-monero-lws-from-source)
- [Deployment](#deployment)
- [Syncing with upstream monero-lws](#syncing-with-upstream-monero-lws)
- [Contributing](#contributing)
## Introduction
Monero is a private, secure, untraceable, decentralised digital currency. You are your bank, you control your funds, and nobody can trace your transfers unless you allow them to do so.
Wownero is a privacy-focused, CPU-mineable cryptocurrency and a "fun" fork of Monero. It uses the RandomWOW proof-of-work algorithm and shares Monero's commitment to privacy and decentralization.
**Privacy:** Monero uses a cryptographically sound system to allow you to send and receive funds without your transactions being easily revealed on the blockchain (the ledger of transactions that everyone has). This ensures that your purchases, receipts, and all transfers remain absolutely private by default.
**Privacy:** Wownero uses a cryptographically sound system to allow you to send and receive funds without your transactions being easily revealed on the blockchain. This ensures that your purchases, receipts, and all transfers remain absolutely private by default.
**Security:** Using the power of a distributed peer-to-peer consensus network, every transaction on the network is cryptographically secured. Individual wallets have a 25 word mnemonic seed that is only displayed once, and can be written down to backup the wallet. Wallet files are encrypted with a passphrase to ensure they are useless if stolen.
**Security:** Using the power of a distributed peer-to-peer consensus network, every transaction on the network is cryptographically secured. Individual wallets have a 25 word mnemonic seed that is only displayed once, and can be written down to backup the wallet.
**Untraceability:** By taking advantage of ring signatures, a special property of a certain type of cryptography, Monero is able to ensure that transactions are not only untraceable, but have an optional measure of ambiguity that ensures that transactions cannot easily be tied back to an individual user or computer.
**Decentralization:** The utility of monero depends on its decentralised peer-to-peer consensus network - anyone should be able to run the monero software, validate the integrity of the blockchain, and participate in all aspects of the monero network using consumer-grade commodity hardware. Decentralization of the monero network is maintained by software development that minimizes the costs of running the monero software and inhibits the proliferation of specialized, non-commodity hardware.
**Untraceability:** By taking advantage of ring signatures, Wownero ensures that transactions are not only untraceable, but have an optional measure of ambiguity that ensures that transactions cannot easily be tied back to an individual user or computer.
## About this project
This is an implementation of the [Monero light-wallet REST API](https://github.com/monero-project/meta/blob/master/api/lightwallet_rest.md)
(i.e. MyMonero compatible). Clients can submit their Monero viewkey via the REST
API, and the server will scan for incoming Monero blockchain transactions.
This is an implementation of the light-wallet REST API for Wownero, adapted from
[monero-lws](https://github.com/vtnerd/monero-lws). Clients can submit their
Wownero viewkey via the REST API, and the server will scan for incoming Wownero
blockchain transactions.
Differences from [OpenMonero](https://github.com/moneroexamples/openmonero):
- LMDB instead of MySQL
**Features:**
- LMDB database (no MySQL required)
- View keys stored in database - scanning occurs continuously in background
- Uses ZeroMQ interface to `monerod` with chain subscription ("push") support
- Uses amd64 ASM acceleration from Monero project, if available
- Uses ZeroMQ interface to `wownerod` with chain subscription ("push") support
- Supports webhook notifications, including "0-conf" notification
- Compatible with MyMonero-style light wallet clients
## Changes from monero-lws
This fork includes the following modifications to support Wownero:
| Component | Change |
|-----------|--------|
| Submodule | `external/monero` points to `codeberg.org/wownero/wownero` |
| Build system | All CMake targets renamed from `monero-lws-*` to `wownero-lws-*` |
| Libraries | Links against Wownero libraries (includes RandomWOW PoW) |
| Difficulty | Updated `next_difficulty()` calls for Wownero's API signature |
| Default ports | RPC: 34568, ZMQ: 34569 (Wownero defaults) |
| Data directory | Uses `~/.wownero/light_wallet_server` |
| RingCT decryption | BulletproofPlus commitments require `scalarmult8()` (see below) |
### Wownero BulletproofPlus Commitment Format
Wownero stores BulletproofPlus (`RCTTypeBulletproofPlus`, type 8) output commitments
in a "divided by 8" form for efficiency. When verifying decrypted amounts, the
commitment from `outPk` must be multiplied by 8 using `rct::scalarmult8()` before
comparing with the computed commitment `mask*G + amount*H`.
This differs from standard Monero and is the key change required for amount
decryption to work on Wownero's post-HF18 transactions.
The directory structure is kept identical to upstream to simplify rebasing.
## License
@@ -46,127 +76,302 @@ Differences from [OpenMonero](https://github.com/moneroexamples/openmonero):
See [LICENSE](LICENSE).
## Docker
Data is stored at `/home/monero-lws/.bitmonero/light_wallet_server` by default,
and be modified by `--db-path` at runtime.
### Latest Stable Release
Docker image for latest stable release can be fetched via:
* `docker pull ghcr.io/vtnerd/monero-lws`
* `docker pull vtnerd/monero-lws`
Users of this tag should never expect a DB migration issue, provided they never
"downgrade" to a prior major version.
### Supported Releases
Docker images for `0` and `0.3` are provided. The major number refers to
backwards incompatible DB changes, and the minor revision refers to new features
that could cause instability. Stability minded users can use these tags while
they are still listed as officially supported here in the README or on the
Docker overview page.
* `docker pull ghcr.io/vtnerd/monero-lws:0`
* `docker pull vtnerd/monero-lws:0`
* `docker pull ghcr.io/vtnerd/monero-lws:0.3`
* `docker pull vtnerd/monero-lws:0.3`
### Alpha Release
Docker image for the `master` (alpha) branch can be fetched via:
* `docker pull ghcr.io/vtnerd/monero-lws:master`
* `docker pull vtnerd/monero-lws:master`
This branch differs from the `develop` branch in that users should NOT expect
incompatible DB changes; if users never "roll-back" their copy of `master` then
the DB should also be in a valid state for use. However, the `master` version
is considered alpha software so things could break, resulting in complications
if the DB was not saved prior to upgrading.
We need alpha testers, so consider using this where possible!
> The `develop` branch should only be used for development purposes - breaking
> DB changes are expected (but probably rare). No docker image is provided for
> this branch - see compilation section below.
## Compiling Monero-lws from source
## Compiling from source
### Dependencies
The first step, when buiding from source, is installing the [dependencies of the
monero project](https://github.com/monero-project/monero?tab=readme-ov-file#dependencies).
`monero-lws` depends on the monero project for building, so the dependencies of
that project become the dependencies of this project transitively. Only the
"non-vendored" dependencies need to be installed. There are no additional
dependencies that need installing.
Install the [dependencies required by Wownero](https://codeberg.org/wownero/wownero#dependencies).
These are inherited transitively by wownero-lws.
### Beginner Build
**Ubuntu/Debian:**
```bash
sudo apt update && sudo apt install -y \
build-essential cmake git pkg-config \
libboost-all-dev libssl-dev libzmq3-dev \
libunbound-dev libsodium-dev libpgm-dev \
libhidapi-dev libusb-1.0-0-dev libprotobuf-dev \
protobuf-compiler libudev-dev
```
The easiest method for building is to use git submodules to pull in the correct
Monero project dependency:
### Quick Build (Recommended)
This builds using the official Wownero source as a submodule. No custom fork is needed.
```bash
git clone https://github.com/vtnerd/monero-lws.git
mkdir monero-lws/build && cd monero-lws/build
git submodule update --init --recursive
cmake -DCMAKE_BUILD_TYPE=Release ../
git clone --recursive https://codeberg.org/wownero/wownero-lws.git
cd wownero-lws
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
```
* On macOS replace `-j$(nproc)` with `-j8` or the number of cores on your
system.
* Each branch (`master`, and `develop`) should have the correct submodule for
building that particular branch.
* The `submodule` step is being run inside of the `monero-lws` directory, such
that all of vendored dependencies are automatically fetched.
* The instructions above will compile the `master` (beta) release of
`monero-lws`
* The resulting executables can be found in `monero-lws/build/src`
The binaries will be in `build/src/`:
- `wownero-lws-daemon` - Main server daemon
- `wownero-lws-admin` - Administration tool
- `wownero-lws-client` - Client utility
### Advanced Build
### Advanced Build (Separate Wownero tree)
The monero source and build directories can be manually specified, which cuts
the build time in half and potentially re-uses the same source tree for multiple
builds. The process for advanced building is:
If you already have a Wownero source tree built (e.g. you compiled `wownerod` yourself), you should link against it to ensure binary compatibility.
**Important:** Use `WOWNERO_SOURCE_DIR`, not `Monero_DIR`.
```bash
git clone https://github.com/monero-project/monero.git
git clone https://github.com/vtnerd/monero-lws.git
mkdir monero-lws/build
mkdir monero/build && cd monero/build
git submodule update --init --recursive
cmake -DCMAKE_BUILD_TYPE=Release ../
make -j$(nproc) daemon multisig lmdb_lib
cd ../../monero-lws/build
cmake -DCMAKE_BUILD_TYPE=Relase -DMONERO_SOURCE_DIR=../../monero -DMONERO_BUILD_DIR=../../monero/build ../
# Assuming wownero is built at ~/wownero/build
git clone https://codeberg.org/wownero/wownero-lws.git
cd wownero-lws
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DWOWNERO_SOURCE_DIR=~/wownero \
-DWOWNERO_BUILD_DIR=~/wownero/build ..
make -j$(nproc)
```
The `master`/`develop` branches of lws should compile against the `master`
branch of monero. The release branches specify which monero branch to compile
against - `release-v0.3_0.18` indicates that monero `0.18` should be used as
the source directory. The [beginner build process](#beginner-build) handles all
of this with git submodules.
* On macOS replace `-j$(nproc)` with `-j8` or the numebr of cores on your
system.
* Notice that the `submodule` step is only being run in the `monero` project;
`monero-lws` intentionally does not initialize submodules in the advanced
mode of building.
* The instructions above will compile the `master` (beta) release of
`monero-lws`.
* The resulting executables can be found in `build/src`
## Running wownero-lws
## Running monero-lws-daemon
### Prerequisites
The build places the binary in `src/` sub-directory within the build directory
from which cmake was invoked (repository root by default). To run in
foreground:
You need a running `wownerod` with ZMQ enabled:
```bash
./src/monero-lws-daemon
wownerod --zmq-pub tcp://127.0.0.1:34569
```
To list all available options, run `./src/monero-lws-daemon --help`.
### Starting the daemon
```bash
./wownero-lws-daemon \
--daemon=tcp://127.0.0.1:34568 \
--sub=tcp://127.0.0.1:34569 \
--log-level=1
```
### Command-line options
| Option | Description | Default |
|--------|-------------|---------|
| `--daemon` | wownerod RPC address | `tcp://127.0.0.1:34568` |
| `--sub` | wownerod ZMQ pub address | `tcp://127.0.0.1:34569` |
| `--db-path` | LMDB database path | `~/.wownero/light_wallet_server` |
| `--rest-server` | REST API bind address | `https://0.0.0.0:8443` |
| `--rest-ssl-key` | SSL private key file | (required for HTTPS) |
| `--rest-ssl-cert` | SSL certificate file | (required for HTTPS) |
| `--log-level` | Log verbosity (0-4) | `0` |
| `--help` | Show all options | |
### Verify installation
```bash
./wownero-lws-daemon --version
```
### Adding accounts
Use `wownero-lws-admin` to manage wallet accounts:
```bash
# Add a new account
./wownero-lws-admin add_account <primary_address> <view_key>
# List all accounts
./wownero-lws-admin list_accounts
# Check account status
./wownero-lws-admin account_status <primary_address>
# Accept a pending account request
./wownero-lws-admin accept_requests create <primary_address>
# Rescan account from specific height
./wownero-lws-admin rescan <height> <primary_address>
```
## REST API
The REST API is compatible with MyMonero-style light wallet clients.
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/login` | POST | Authenticate with address + view key |
| `/get_address_info` | POST | Get account balance and status |
| `/get_address_txs` | POST | Get transaction history |
| `/get_unspent_outs` | POST | Get spendable outputs |
| `/get_random_outs` | POST | Get decoy outputs for ring signatures |
| `/submit_raw_tx` | POST | Broadcast a signed transaction |
| `/import_request` | POST | Request account import from genesis |
See the [monero-lws documentation](https://github.com/vtnerd/monero-lws#rest-api) for full API details.
## Docker
### Building the image
```bash
git clone https://codeberg.org/wownero/wownero-lws.git
cd wownero-lws
docker build -t wownero-lws .
```
### Running with Docker Compose
Create `docker-compose.yml`:
```yaml
version: '3.8'
services:
wownerod:
image: wownero/wownerod:latest
command: >
--non-interactive
--zmq-pub tcp://0.0.0.0:34569
--rpc-bind-ip 0.0.0.0
--confirm-external-bind
volumes:
- wownerod-data:/home/wownero/.wownero
ports:
- "34567:34567" # P2P
- "34568:34568" # RPC
wownero-lws:
image: wownero-lws:latest
command: >
--daemon=tcp://wownerod:34568
--sub=tcp://wownerod:34569
--log-level=1
volumes:
- wownero-lws-data:/home/wownero-lws/.wownero
ports:
- "8443:8443"
depends_on:
- wownerod
volumes:
wownerod-data:
wownero-lws-data:
```
```bash
docker-compose up -d
```
## Deployment
### Production Checklist
1. **TLS Certificate**: Use Let's Encrypt or similar for the REST API
2. **Firewall**: Only expose port 8443 (REST API) publicly
3. **Reverse Proxy**: Consider nginx/caddy in front for rate limiting
4. **Backups**: Regularly backup `~/.wownero/light_wallet_server/`
5. **Monitoring**: Monitor disk space (LMDB can grow large)
### Example nginx config
```nginx
server {
listen 443 ssl http2;
server_name lws.example.com;
ssl_certificate /etc/letsencrypt/live/lws.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/lws.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
```
Then run wownero-lws with HTTP internally:
```bash
./wownero-lws-daemon --rest-server http://127.0.0.1:8080 ...
```
## Syncing with upstream monero-lws
This project is designed to be rebased on upstream `vtnerd/monero-lws` updates.
### Setup (one-time)
```bash
cd wownero-lws
git remote add upstream https://github.com/vtnerd/monero-lws.git
git fetch upstream
```
### Updating from upstream
```bash
# Fetch latest upstream changes
git fetch upstream
# Rebase our changes on top of upstream master
git checkout main
git rebase upstream/master
# Resolve any conflicts, then:
git rebase --continue
# Force push to update the fork
git push --force-with-lease origin main
```
### Common conflict areas
When rebasing, conflicts typically occur in:
- `CMakeLists.txt` - variable names (MONERO vs WOWNERO)
- `src/scanner.cpp` - API differences (e.g., `next_difficulty` signature)
- `Dockerfile` - paths and image names
The goal is to keep Wownero-specific changes minimal and isolated.
## Troubleshooting
### "Unable to sync blockchain - wrong --network ?"
If you see this error immediately upon starting `wownero-lws-daemon`, it usually indicates a mismatch between the Wownero source code used to build LWS and the `wownerod` daemon you are connecting to.
**Solution:**
1. Ensure you are building `wownero-lws` against the **exact same version** of the Wownero source code that your daemon uses.
2. Use the `Advanced Build` instructions to point CMake to your local Wownero source tree using `-DWOWNERO_SOURCE_DIR=/path/to/wownero`.
3. **Do not** use `-DMonero_DIR`, as this variable is ignored by `wownero-lws`.
4. After rebuilding, you must delete your LWS database (default: `~/.wownero/light_wallet_server`) and let it resync from scratch.
### "Blockchain reorg detected" loop
If the scanner gets stuck in a loop detecting reorgs at a specific block height:
1. Check if your `wownerod` is fully synced and on the correct chain.
2. This can also be caused by the build mismatch described above (LWS calculating different block hashes than the daemon). Follow the rebuild steps above.
## Contributing
1. Fork the repository on Codeberg
2. Create a feature branch: `git checkout -b my-feature`
3. Commit your changes: `git commit -am 'Add feature'`
4. Push to the branch: `git push origin my-feature`
5. Submit a Pull Request
Please ensure your changes don't break the ability to rebase on upstream.
## Links
- **Wownero**: https://wownero.org
- **Wownero Codeberg**: https://codeberg.org/wownero
- **Upstream monero-lws**: https://github.com/vtnerd/monero-lws
- **Wownero Discord**: https://discord.gg/ykZyAzJhDK
- **Wownero Reddit**: https://reddit.com/r/wownero
## Acknowledgments
- [vtnerd](https://github.com/vtnerd) for creating and maintaining monero-lws
- The Monero Project for the core cryptographic libraries
- The Wownero community for testing and feedback

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2018-2020, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -65,25 +66,24 @@ add_subdirectory(rpc)
add_subdirectory(util)
# For both the server and admin utility.
set(monero-lws-common_sources config.cpp error.cpp)
set(monero-lws-common_headers config.h error.h fwd.h)
set(wownero-lws-common_sources config.cpp error.cpp)
set(wownero-lws-common_headers config.h error.h fwd.h)
add_library(monero-lws-common ${monero-lws-common_sources} ${monero-lws-common_headers})
target_link_libraries(monero-lws-common monero::libraries)
add_library(wownero-lws-common ${wownero-lws-common_sources} ${wownero-lws-common_headers})
target_link_libraries(wownero-lws-common wownero::libraries)
add_library(monero-lws-daemon-common rest_server.cpp scanner.cpp)
target_include_directories(monero-lws-daemon-common PUBLIC ${ZMQ_INCLUDE_PATH})
target_link_libraries(monero-lws-daemon-common
add_library(wownero-lws-daemon-common rest_server.cpp scanner.cpp)
target_include_directories(wownero-lws-daemon-common PUBLIC ${ZMQ_INCLUDE_PATH})
target_link_libraries(wownero-lws-daemon-common
PUBLIC
monero::libraries
${MONERO_lmdb}
monero-lws-common
monero-lws-db
monero-lws-net
monero-lws-rpc
monero-lws-rpc-scanner
monero-lws-wire-json
monero-lws-util
${WOWNERO_lmdb}
wownero-lws-common
wownero-lws-db
wownero-lws-net
wownero-lws-rpc
wownero-lws-rpc-scanner
wownero-lws-wire-json
wownero-lws-util
${Boost_CHRONO_LIBRARY}
${Boost_COROUTINE_LIBRARY}
${Boost_CONTEXT_LIBRARY}
@@ -95,42 +95,43 @@ target_link_libraries(monero-lws-daemon-common
${ZMQ_LIB}
${SODIUM_LIBRARY}
Threads::Threads
wownero::libraries
)
add_executable(monero-lws-daemon server_main.cpp)
target_link_libraries(monero-lws-daemon
add_executable(wownero-lws-daemon server_main.cpp)
target_link_libraries(wownero-lws-daemon
PRIVATE
monero::libraries
monero-lws-daemon-common
monero-lws-rpc-scanner
wownero-lws-daemon-common
wownero-lws-rpc-scanner
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
wownero::libraries
)
add_executable(monero-lws-admin admin_main.cpp)
target_link_libraries(monero-lws-admin
add_executable(wownero-lws-admin admin_main.cpp)
target_link_libraries(wownero-lws-admin
PRIVATE
monero::libraries
monero-lws-common
monero-lws-db
monero-lws-rpc
monero-lws-wire-json
wownero-lws-common
wownero-lws-db
wownero-lws-rpc
wownero-lws-wire-json
${Boost_PROGRAM_OPTIONS_LIBRARY}
Threads::Threads
wownero::libraries
)
add_executable(monero-lws-client client_main.cpp)
target_link_libraries(monero-lws-client
add_executable(wownero-lws-client client_main.cpp)
target_link_libraries(wownero-lws-client
PRIVATE
monero::libraries
monero-lws-common
monero-lws-daemon-common
monero-lws-rpc
monero-lws-rpc-scanner
wownero-lws-common
wownero-lws-daemon-common
wownero-lws-rpc
wownero-lws-rpc-scanner
${Boost_PROGRAM_OPTIONS_LIBRARY}
Threads::Threads
wownero::libraries
)
install(TARGETS monero-lws-daemon DESTINATION bin)
install(TARGETS monero-lws-admin DESTINATION bin)
install(TARGETS monero-lws-client DESTINATION bin)
install(TARGETS wownero-lws-daemon DESTINATION bin)
install(TARGETS wownero-lws-admin DESTINATION bin)
install(TARGETS wownero-lws-client DESTINATION bin)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2018-2020, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,9 +27,9 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-db_sources account.cpp data.cpp storage.cpp string.cpp)
set(monero-lws-db_headers account.h data.h fwd.h storage.h string.h)
set(wownero-lws-db_sources account.cpp data.cpp storage.cpp string.cpp)
set(wownero-lws-db_headers account.h data.h fwd.h storage.h string.h)
add_library(monero-lws-db ${monero-lws-db_sources} ${monero-lws-db_headers})
target_include_directories(monero-lws-db PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(monero-lws-db monero::libraries monero-lws-common monero-lws-lmdb monero-lws-wire-msgpack ${LMDB_LIB_PATH})
add_library(wownero-lws-db ${wownero-lws-db_sources} ${wownero-lws-db_headers})
target_include_directories(wownero-lws-db PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(wownero-lws-db wownero-lws-common wownero-lws-lmdb wownero-lws-wire-msgpack ${LMDB_LIB_PATH} wownero::libraries)

View File

@@ -3178,8 +3178,14 @@ namespace db
std::min(lmdb::to_native(last_block.id), last_update);
const std::uint64_t offset = last_same - lmdb::to_native(height);
if (MONERO_UNWRAP(do_get_block_hash(*blocks_cur, block_id(last_same))) != *(chain_copy.begin() + offset))
const crypto::hash stored_hash = MONERO_UNWRAP(do_get_block_hash(*blocks_cur, block_id(last_same)));
const crypto::hash scanner_hash = *(chain_copy.begin() + offset);
if (stored_hash != scanner_hash)
{
MERROR("Hash mismatch at block " << last_same << ": DB has " << stored_hash << ", scanner has " << scanner_hash << ". FORCING ROLLBACK to " << last_same);
MONERO_CHECK(rollback_chain(this->db->tables, txn, *blocks_cur, block_id(last_same)));
return {lws::error::blockchain_reorg};
}
chain_copy.remove_prefix(offset + 1);
MONERO_CHECK(

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,9 +27,9 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-lmdb_sources lws_database.cpp lws_error.cpp)
set(monero-lws-lmdb_headers lws_database.h lws_error.h lws_key_stream.h lws_table.h lws_value_stream.h msgpack_table.h)
set(wownero-lws-lmdb_sources lws_database.cpp lws_error.cpp)
set(wownero-lws-lmdb_headers lws_database.h lws_error.h lws_key_stream.h lws_table.h lws_value_stream.h msgpack_table.h)
add_library(monero-lws-lmdb ${monero-lws-lmdb_sources} ${monero-lws-lmdb_headers})
target_include_directories(monero-lws-lmdb PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(monero-lws-lmdb PRIVATE monero::libraries)
add_library(wownero-lws-lmdb ${wownero-lws-lmdb_sources} ${wownero-lws-lmdb_headers})
target_include_directories(wownero-lws-lmdb PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(wownero-lws-lmdb PRIVATE wownero::libraries)

View File

@@ -69,6 +69,7 @@ namespace lws_lmdb
environment out{obj};
MONERO_LMDB_CHECK(mdb_env_set_maxdbs(out.get(), max_dbs));
MONERO_LMDB_CHECK(mdb_env_set_mapsize(out.get(), 10ull * 1024 * 1024 * 1024));
MONERO_LMDB_CHECK(mdb_env_open(out.get(), path, 0, open_flags));
return {std::move(out)};
}

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2025, The Monero Project
// Copyright (c) 2024-2025, The Wownero Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
@@ -34,7 +35,7 @@ namespace lws { namespace version
constexpr const char commit[] = "@MLWS_COMMIT_HASH@";
constexpr const char date[] = "@MLWS_COMMIT_DATE@";
constexpr const char id[] = "1.0-alpha";
constexpr const char name[] = "monero-lws";
constexpr const char name[] = "wownero-lws";
// openmonero is currently on 1.6 and we have multiple additions since then
namespace api

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -28,8 +29,8 @@
add_subdirectory(http)
set(monero-lws-net_sources zmq_async.cpp)
set(monero-lws-net_headers zmq_async.h)
set(wownero-lws-net_sources zmq_async.cpp)
set(wownero-lws-net_headers zmq_async.h)
add_library(monero-lws-net ${monero-lws-net_sources} ${monero-lws-net_headers})
target_link_libraries(monero-lws-net monero-lws-net-http monero::libraries)
add_library(wownero-lws-net ${wownero-lws-net_sources} ${wownero-lws-net_headers})
target_link_libraries(wownero-lws-net wownero-lws-net-http wownero::libraries)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,8 +27,8 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-net-http_sources client.cpp)
set(monero-lws-net-http_headers client.h slice_body.h)
set(wownero-lws-net-http_sources client.cpp)
set(wownero-lws-net-http_headers client.h slice_body.h)
add_library(monero-lws-net-http ${monero-lws-net-http_sources} ${monero-lws-net-http_headers})
target_link_libraries(monero-lws-net-http ${Boost_SYSTEM_LIBRARY} monero::libraries)
add_library(wownero-lws-net-http ${wownero-lws-net-http_sources} ${wownero-lws-net-http_headers})
target_link_libraries(wownero-lws-net-http ${Boost_SYSTEM_LIBRARY} wownero::libraries)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2020-2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -28,9 +29,9 @@
add_subdirectory(scanner)
set(monero-lws-rpc_sources admin.cpp client.cpp daemon_pub.cpp daemon_zmq.cpp light_wallet.cpp lws_pub.cpp rates.cpp)
set(monero-lws-rpc_headers admin.h client.h daemon_pub.h daemon_zmq.h fwd.h json.h light_wallet.h lws_pub.h rates.h)
set(wownero-lws-rpc_sources admin.cpp client.cpp daemon_pub.cpp daemon_zmq.cpp light_wallet.cpp lws_pub.cpp rates.cpp)
set(wownero-lws-rpc_headers admin.h client.h daemon_pub.h daemon_zmq.h fwd.h json.h light_wallet.h lws_pub.h rates.h)
add_library(monero-lws-rpc ${monero-lws-rpc_sources} ${monero-lws-rpc_headers})
target_include_directories(monero-lws-rpc PRIVATE ${RMQ_INCLUDE_DIR})
target_link_libraries(monero-lws-rpc monero::libraries monero-lws-util monero-lws-wire-json monero-lws-wire-wrapper ${RMQ_LIBRARY})
add_library(wownero-lws-rpc ${wownero-lws-rpc_sources} ${wownero-lws-rpc_headers})
target_include_directories(wownero-lws-rpc PRIVATE ${RMQ_INCLUDE_DIR})
target_link_libraries(wownero-lws-rpc wownero::libraries wownero-lws-util wownero-lws-wire-json wownero-lws-wire-wrapper ${RMQ_LIBRARY})

View File

@@ -71,7 +71,7 @@ namespace rpc
constexpr const char abort_process_signal[] = "PROCESS";
constexpr const char minimal_chain_topic[] = "json-minimal-chain_main";
constexpr const char full_txpool_topic[] = "json-full-txpool_add";
constexpr const int daemon_zmq_linger = 0;
constexpr const int daemon_zmq_linger = 1000;
constexpr const int account_zmq_linger = 0;
constexpr const std::int64_t max_msg_sub = 10 * 1024 * 1024; // 50 MiB
constexpr const std::int64_t max_msg_req = 350 * 1024 * 1024; // 350 MiB

View File

@@ -28,9 +28,12 @@
#include "daemon_zmq.h"
#include <boost/optional/optional.hpp>
#include "misc_log_ex.h"
#include "string_tools.h"
#include "cryptonote_config.h" // monero/src
#include "crypto/crypto.h" // monero/src
#include "rpc/message_data_structs.h" // monero/src
#include "ringct/rctOps.h"
#include "wire/adapted/crypto.h"
#include "wire/json.h"
#include "wire/wrapper/array.h"
@@ -61,15 +64,23 @@ namespace
namespace rct
{
static void read_bytes(wire::json_reader& source, key& self)
{
source.binary(epee::as_mut_byte_span(self.bytes));
}
static void read_bytes(wire::json_reader& source, ctkey& self)
{
self.dest = {};
read_bytes(source, self.mask);
source.binary(epee::as_mut_byte_span(self.mask));
}
static void read_bytes(wire::json_reader& source, ecdhTuple& self)
{
wire::object(source, WIRE_FIELD(mask), WIRE_FIELD(amount));
wire::object(source,
WIRE_FIELD(mask),
WIRE_FIELD(amount)
);
}
static void read_bytes(wire::json_reader& source, clsag& self)
@@ -205,6 +216,11 @@ namespace rct
wire::optional_field("prunable", std::ref(prunable))
);
if (self.type != RCTTypeNull)
{
MDEBUG("Parsed rctSig: type=" << (int)self.type << " encrypted_count=" << self.ecdhInfo.size() << " commitments_count=" << self.outPk.size());
}
self.txnFee = 0;
if (self.type != RCTTypeNull)
{
@@ -213,7 +229,7 @@ namespace rct
self.txnFee = std::move(*txnFee);
}
else if (!self.ecdhInfo.empty() || !self.outPk.empty() || txnFee)
WIRE_DLOG_THROW(wire::error::schema::invalid_key, "Did not expected `encrypted`, `commitments`, or `fee`");
WIRE_DLOG_THROW(wire::error::schema::invalid_key, "Did not expect `encrypted`, `commitments`, or `fee`");
if (prunable)
{
@@ -289,30 +305,47 @@ namespace cryptonote
self.vin.reserve(default_inputs);
self.vout.reserve(default_outputs);
self.extra.reserve(default_txextra_size);
boost::optional<rct::rctSig> ringct;
wire::object(source,
WIRE_FIELD(version),
WIRE_FIELD(unlock_time),
wire::field("inputs", wire::array<max_inputs_per_tx>(std::ref(self.vin))),
wire::field("outputs", wire::array<max_outputs_per_tx>(std::ref(self.vout))),
WIRE_FIELD(extra),
WIRE_FIELD_ARRAY(signatures, max_inputs_per_tx),
wire::field("ringct", std::ref(self.rct_signatures))
wire::optional_field("signatures", wire::array<max_inputs_per_tx>(std::ref(self.signatures))),
wire::optional_field("ringct", std::ref(ringct))
);
if (ringct)
self.rct_signatures = std::move(*ringct);
}
static void read_bytes(wire::json_reader& source, block& self)
{
using min_hash_size = wire::min_element_sizeof<crypto::hash>;
self.tx_hashes.reserve(default_transaction_count);
boost::optional<crypto::signature> signature;
boost::optional<uint16_t> vote;
wire::object(source,
WIRE_FIELD(major_version),
WIRE_FIELD(minor_version),
WIRE_FIELD(timestamp),
WIRE_FIELD(miner_tx),
WIRE_FIELD_ARRAY(tx_hashes, min_hash_size),
WIRE_FIELD(prev_id),
WIRE_FIELD(nonce)
WIRE_FIELD(nonce),
wire::optional_field("signature", std::ref(signature)),
wire::optional_field("vote", std::ref(vote)),
WIRE_FIELD(miner_tx),
WIRE_FIELD_ARRAY(tx_hashes, min_hash_size)
);
if (signature)
self.signature = *signature;
if (vote)
self.vote = *vote;
}
static void read_bytes(wire::json_reader& source, std::vector<transaction>& self)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,12 +27,12 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-rpc-scanner_sources
set(wownero-lws-rpc-scanner_sources
client.cpp commands.cpp connection.cpp queue.cpp server.cpp write_commands.cpp
)
set(monero-lws-rpc-scanner_headers
set(wownero-lws-rpc-scanner_headers
client.h commands.h connection.h fwd.h queue.h read_commands.h server.h write_commands.h
)
add_library(monero-lws-rpc-scanner ${monero-lws-rpc-scanner_sources} ${monero-lws-rpc-scanner_headers})
target_link_libraries(monero-lws-rpc-scanner monero::libraries monero-lws-wire-msgpack)
add_library(wownero-lws-rpc-scanner ${wownero-lws-rpc-scanner_sources} ${wownero-lws-rpc-scanner_headers})
target_link_libraries(wownero-lws-rpc-scanner wownero::libraries wownero-lws-wire-msgpack)

View File

@@ -27,6 +27,7 @@
#include "scanner.h"
#include <algorithm>
#include "string_tools.h"
#include <boost/asio/use_future.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/range/combine.hpp>
@@ -528,7 +529,7 @@ namespace lws
{
const bool bulletproof2 = (rct::RCTTypeBulletproof2 <= tx.rct_signatures.type);
const auto decrypted = lws::decode_amount(
tx.rct_signatures.outPk.at(index).mask, tx.rct_signatures.ecdhInfo.at(index), active_derived, index, bulletproof2
tx.rct_signatures.outPk.at(index).mask, tx.rct_signatures.ecdhInfo.at(index), active_derived, index, bulletproof2, tx.rct_signatures.type
);
if (!decrypted)
{
@@ -743,6 +744,12 @@ namespace lws
if (fetched->blocks.empty())
throw std::runtime_error{"Daemon unexpectedly returned zero blocks"};
MINFO("Processing batch: " << fetched->start_height << " to " << (fetched->start_height + fetched->blocks.size() - 1) << " (" << fetched->blocks.size() << " blocks)");
if (!fetched->blocks.empty())
{
MINFO("First block hash: " << cryptonote::get_block_hash(fetched->blocks.front().block) << ", Last block hash: " << cryptonote::get_block_hash(fetched->blocks.back().block));
}
if (fetched->start_height != req.start_height)
{
MWARNING("Daemon sent wrong blocks, resetting state");
@@ -907,7 +914,7 @@ namespace lws
if (self.stop_)
return false;
diff = cryptonote::next_difficulty(pow_window.pow_timestamps, pow_window.cumulative_diffs, get_target_time(db::block_id(fetched->start_height)));
diff = cryptonote::next_difficulty(pow_window.pow_timestamps, pow_window.cumulative_diffs, get_target_time(db::block_id(fetched->start_height)), std::uint64_t(fetched->start_height), lws::config::network);
// skip POW hashing if done previously
if (disk && last_pow < db::block_id(fetched->start_height))
@@ -963,6 +970,8 @@ namespace lws
reader.reader = std::error_code{common_error::kInvalidArgument}; // cleanup reader before next write
MINFO("Thread " << thread_n << " processed " << blockchain.size() << " blocks(s) @ height " << fetched->start_height << " against " << users.size() << " account(s)");
if (!blockchain.empty())
MINFO("First block hash: " << blockchain.front() << " at height " << (fetched->start_height - blockchain.size() + 1) << ", last block hash: " << blockchain.back() << " at height " << fetched->start_height);
if (!store(self.io_, client, self.webhooks_, epee::to_span(blockchain), epee::to_span(users), epee::to_span(new_pow)))
return false;
@@ -1151,7 +1160,10 @@ namespace lws
for (;;)
{
if (req.known_hashes.empty())
{
MERROR("sync_quick: req.known_hashes is empty");
return {lws::error::bad_blockchain};
}
auto resp = fetch_chain<rpc::get_hashes_fast>(self, client, "get_hashes_fast", req);
if (!resp)
@@ -1163,6 +1175,7 @@ namespace lws
if (resp->hashes.size() <= 1 || resp->hashes.back() == req.known_hashes.front())
return {std::move(client)};
MINFO("Syncing " << resp->hashes.size() << " hashes from height " << resp->start_height);
MONERO_CHECK(disk.sync_chain(db::block_id(resp->start_height), epee::to_span(resp->hashes), regtest));
req.known_hashes.erase(req.known_hashes.begin(), --(req.known_hashes.end()));
@@ -1193,7 +1206,10 @@ namespace lws
for (;;)
{
if (req.block_ids.empty())
{
MERROR("sync_full: req.block_ids is empty");
return {lws::error::bad_blockchain};
}
auto resp = fetch_chain<rpc::get_blocks_fast>(self, client, "get_blocks_fast", req);
if (!resp)
@@ -1204,7 +1220,10 @@ namespace lws
crypto::hash hash{};
if (!cryptonote::get_block_hash(resp->blocks.front().block, hash))
{
MERROR("sync_full: failed to get hash of first block");
return {lws::error::bad_blockchain};
}
//
// exit loop if it appears we have synced to top of chain
@@ -1243,11 +1262,17 @@ namespace lws
// important check, ensure we haven't deviated from chain
if (block.prev_id != hash)
{
MERROR("sync_full: block.prev_id (" << block.prev_id << ") != hash (" << hash << ") at height " << std::uint64_t(height));
return {lws::error::bad_blockchain};
}
// compute block id hash
if (!cryptonote::get_block_hash(block, hash))
{
MERROR("sync_full: failed to get hash of block at height " << std::uint64_t(height));
return {lws::error::bad_blockchain};
}
req.block_ids.push_front(hash);
update_window(pow_window.pow_timestamps);
@@ -1260,7 +1285,7 @@ namespace lws
if (self.has_shutdown())
return {error::signal_abort_process};
diff = cryptonote::next_difficulty(pow_window.pow_timestamps, pow_window.cumulative_diffs, get_target_time(height));
diff = cryptonote::next_difficulty(pow_window.pow_timestamps, pow_window.cumulative_diffs, get_target_time(height), std::uint64_t(height), lws::config::network);
// skip POW hashing when sync is within checkpoint
// storage::sync_pow(...) currently verifies checkpoint hashes

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2020, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,8 +27,8 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-util_sources blocks.cpp gamma_picker.cpp random_outputs.cpp source_location.cpp transactions.cpp)
set(monero-lws-util_headers blocks.h fwd.h gamma_picker.h random_outputs.h source_location.h transactions.h)
set(wownero-lws-util_sources blocks.cpp gamma_picker.cpp random_outputs.cpp source_location.cpp transactions.cpp)
set(wownero-lws-util_headers blocks.h fwd.h gamma_picker.h random_outputs.h source_location.h transactions.h)
add_library(monero-lws-util ${monero-lws-util_sources} ${monero-lws-util_headers})
target_link_libraries(monero-lws-util monero::libraries monero-lws-db)
add_library(wownero-lws-util ${wownero-lws-util_sources} ${wownero-lws-util_headers})
target_link_libraries(wownero-lws-util wownero::libraries wownero-lws-db)

View File

@@ -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;
}

View File

@@ -41,5 +41,5 @@ namespace crypto
namespace lws
{
void decrypt_payment_id(crypto::hash8& out, const crypto::key_derivation& key);
boost::optional<std::pair<std::uint64_t, rct::key>> 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>> 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);
}

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2020-2023, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,12 +27,12 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-wire_sources error.cpp read.cpp write.cpp)
set(monero-lws-wire_headers error.h field.h filters.h fwd.h json.h read.h traits.h vector.h write.h)
set(wownero-lws-wire_sources error.cpp read.cpp write.cpp)
set(wownero-lws-wire_headers error.h field.h filters.h fwd.h json.h read.h traits.h vector.h write.h)
add_library(monero-lws-wire ${monero-lws-wire_sources} ${monero-lws-wire_headers})
target_include_directories(monero-lws-wire PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(monero-lws-wire PRIVATE monero::libraries)
add_library(wownero-lws-wire ${wownero-lws-wire_sources} ${wownero-lws-wire_headers})
target_include_directories(wownero-lws-wire PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(wownero-lws-wire PRIVATE wownero::libraries)
add_subdirectory(json)
add_subdirectory(msgpack)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2020, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,8 +27,8 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws_wire-json_sources error.cpp read.cpp write.cpp)
set(monero-lws_wire-json_headers base.h error.h fwd.h read.h write.h)
set(wownero-lws_wire-json_sources error.cpp read.cpp write.cpp)
set(wownero-lws_wire-json_headers base.h error.h fwd.h read.h write.h)
add_library(monero-lws-wire-json ${monero-lws_wire-json_sources} ${monero-lws-wire-json_headers})
target_link_libraries(monero-lws-wire-json monero::libraries monero-lws-wire)
add_library(wownero-lws-wire-json ${wownero-lws_wire-json_sources} ${wownero-lws-wire-json_headers})
target_link_libraries(wownero-lws-wire-json wownero::libraries wownero-lws-wire)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2023, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,8 +27,8 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws_wire-msgpack_sources error.cpp read.cpp write.cpp)
set(monero-lws_wire-msgpack_headers base.h error.h fwd.h read.h write.h)
set(wownero-lws_wire-msgpack_sources error.cpp read.cpp write.cpp)
set(wownero-lws_wire-msgpack_headers base.h error.h fwd.h read.h write.h)
add_library(monero-lws-wire-msgpack ${monero-lws_wire-msgpack_sources} ${monero-lws-wire-msgpack_headers})
target_link_libraries(monero-lws-wire-msgpack monero::libraries monero-lws-wire)
add_library(wownero-lws-wire-msgpack ${wownero-lws_wire-msgpack_sources} ${wownero-lws-wire-msgpack_headers})
target_link_libraries(wownero-lws-wire-msgpack wownero::libraries wownero-lws-wire)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2020, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,10 +27,10 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(monero-lws-wire_sources variant.cpp)
set(monero-lws-wire_headers variant.h)
set(wownero-lws-wire_sources variant.cpp)
set(wownero-lws-wire_headers variant.h)
add_library(monero-lws-wire-wrapper ${monero-lws-wire_sources} ${monero-lws-wire_headers})
target_include_directories(monero-lws-wire-wrapper PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(monero-lws-wire-wrapper PRIVATE monero::libraries)
add_library(wownero-lws-wire-wrapper ${wownero-lws-wire_sources} ${wownero-lws-wire_headers})
target_include_directories(wownero-lws-wire-wrapper PUBLIC "${LMDB_INCLUDE}")
target_link_libraries(wownero-lws-wire-wrapper PRIVATE wownero::libraries)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2022, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#

21
tests/test_wire_key.cpp Normal file
View File

@@ -0,0 +1,21 @@
#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;
}

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2022, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,31 +27,31 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(monero-lws-unit-framework framework.test.cpp)
target_include_directories(monero-lws-unit-framework PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(monero-lws-unit-framework)
add_library(wownero-lws-unit-framework framework.test.cpp)
target_include_directories(wownero-lws-unit-framework PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(wownero-lws-unit-framework)
add_subdirectory(db)
add_subdirectory(net)
add_subdirectory(rpc)
add_subdirectory(wire)
add_executable(monero-lws-unit main.cpp rest.test.cpp scanner.test.cpp)
target_link_libraries(monero-lws-unit
monero::libraries
monero-lws-daemon-common
monero-lws-unit-db
monero-lws-unit-framework
monero-lws-unit-net
monero-lws-unit-net-http
monero-lws-unit-rpc
monero-lws-unit-wire
monero-lws-unit-wire-json
monero-lws-unit-wire-msgpack
add_executable(wownero-lws-unit main.cpp rest.test.cpp scanner.test.cpp)
target_link_libraries(wownero-lws-unit
wownero::libraries
wownero-lws-daemon-common
wownero-lws-unit-db
wownero-lws-unit-framework
wownero-lws-unit-net
wownero-lws-unit-net-http
wownero-lws-unit-rpc
wownero-lws-unit-wire
wownero-lws-unit-wire-json
wownero-lws-unit-wire-msgpack
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_THREAD_LIBS_INIT}
Threads::Threads
)
add_test(NAME monero-lws-unit COMMAND monero-lws-unit -v)
add_test(NAME wownero-lws-unit COMMAND wownero-lws-unit -v)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2022-2023, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,7 +27,7 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(monero-lws-unit-db OBJECT
add_library(wownero-lws-unit-db OBJECT
account.test.cpp
chain.test.cpp
data.test.cpp
@@ -35,11 +36,11 @@ add_library(monero-lws-unit-db OBJECT
webhook.test.cpp
)
target_link_libraries(
monero-lws-unit-db
monero-lws-unit-framework
monero-lws-common
monero-lws-db
monero::libraries
wownero-lws-unit-db
wownero-lws-unit-framework
wownero-lws-common
wownero-lws-db
wownero::libraries
${Boost_PROGRAM_OPTIONS_LIBRARY}
)
#add_test(monero-lws-unit)
#add_test(wownero-lws-unit)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -28,5 +29,5 @@
add_subdirectory(http)
add_library(monero-lws-unit-net)
target_link_libraries(monero-lws-unit-net monero-lws-unit-net-http)
add_library(wownero-lws-unit-net)
target_link_libraries(wownero-lws-unit-net wownero-lws-unit-net-http)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2024, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,9 +27,9 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(monero-lws-unit-net-http OBJECT client.test.cpp)
add_library(wownero-lws-unit-net-http OBJECT client.test.cpp)
target_link_libraries(
monero-lws-unit-net-http
monero-lws-net-http
monero-lws-unit-framework
monero::libraries)
wownero-lws-unit-net-http
wownero-lws-net-http
wownero-lws-unit-framework
wownero::libraries)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2022-2023, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -26,15 +27,15 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(monero-lws-unit-rpc OBJECT admin.test.cpp)
add_library(wownero-lws-unit-rpc OBJECT admin.test.cpp)
target_link_libraries(
monero-lws-unit-rpc
monero-lws-unit-db
monero-lws-unit-framework
monero-lws-common
monero-lws-db
monero-lws-rpc
monero-lws-wire-json
monero::libraries
wownero-lws-unit-rpc
wownero-lws-unit-db
wownero-lws-unit-framework
wownero-lws-common
wownero-lws-db
wownero-lws-rpc
wownero-lws-wire-json
wownero::libraries
)
#add_test(monero-lws-unit)
#add_test(wownero-lws-unit)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2022-2023, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -30,11 +31,11 @@
add_subdirectory(json)
add_subdirectory(msgpack)
add_library(monero-lws-unit-wire OBJECT read.write.test.cpp read.test.cpp)
add_library(wownero-lws-unit-wire OBJECT read.write.test.cpp read.test.cpp)
target_link_libraries(
monero-lws-unit-wire
monero-lws-unit-framework
monero-lws-wire
monero::libraries
wownero-lws-unit-wire
wownero-lws-unit-framework
wownero-lws-wire
wownero::libraries
)
#add_test(monero-lws-unit)
#add_test(wownero-lws-unit)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2022, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -27,11 +28,11 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(monero-lws-unit-wire-json OBJECT read.write.test.cpp)
add_library(wownero-lws-unit-wire-json OBJECT read.write.test.cpp)
target_link_libraries(
monero-lws-unit-wire-json
monero-lws-unit-framework
monero-lws-wire-json
monero::libraries
wownero-lws-unit-wire-json
wownero-lws-unit-framework
wownero-lws-wire-json
wownero::libraries
)

View File

@@ -1,4 +1,5 @@
# Copyright (c) 2023, The Monero Project
# Copyright (c) 2024-2025, The Wownero Project
#
# All rights reserved.
#
@@ -27,11 +28,11 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(monero-lws-unit-wire-msgpack OBJECT read.write.test.cpp)
add_library(wownero-lws-unit-wire-msgpack OBJECT read.write.test.cpp)
target_link_libraries(
monero-lws-unit-wire-msgpack
monero-lws-unit-framework
monero-lws-wire-msgpack
monero::libraries
wownero-lws-unit-wire-msgpack
wownero-lws-unit-framework
wownero-lws-wire-msgpack
wownero::libraries
)