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 97877eda27
35 changed files with 809 additions and 396 deletions

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"]