verify
Verify the release and the escrow
This page asks you to check it rather than believe it. Below are the exact commands to compare the escrow you would send money to with the bytecode the published source builds, to read that source, and to check the site itself.
What a check can and cannot prove
moos asks you to trust an escrow with money, so it should be possible to test the escrow without trusting this website. A bytecode check answers one narrow question: is the contract deployed at this address byte-for-byte the contract the published source builds? If the answer is yes, then the code holding your ETH is the code you can read. If it is no, nothing else on this page matters and you should not trade.
That question is worth asking, but it is not a safety guarantee. Matching bytecode says nothing about whether the source is correct, whether the escrow has a bug, or whether anyone competent has reviewed it. It only removes one specific failure: a deployment that differs from the published build, whether by accident or on purpose.
The escrow source and bytecode have not been independently audited. A matching hash proves the deployed contract is the pinned build. It does not prove the pinned build is safe to use with money you cannot afford to lose.
Check the deployed contract
The client refuses to start or trade unless the code at the configured address matches the pinned
runtime hash. The check runs twice: once in the launcher's pre-flight gate, and again on every swap
in the NotifyETHLocked path. You can run the same check yourself, independently of the
client.
- Choose an endpoint. Read the code from an Ethereum JSON-RPC endpoint you run
yourself, or from one you are willing to rely on for this single query. The mainnet address is
0xb39074e5f5bb5fd3a5fd48df867115d5c8b97e71. - Fetch the code. Call
eth_getCodewith that address and thelatestblock tag. The result is a0x-prefixed hex string. - Decode and hash. Decode the hex to bytes, then take the sha256 of those bytes. The hash is over the decoded runtime, never over the hex text, so a newline or a case change in the hex must not affect it.
- Compare. The decoded runtime must be exactly 5978 bytes and its sha256 must equal the pinned hash below. Anything else is a mismatch: do not trade.
| Mainnet address | 0xb39074e5f5bb5fd3a5fd48df867115d5c8b97e71 |
|---|---|
| Runtime length | 5978 bytes, decoded |
| Pinned sha256 | 856a21474d81dc6ef0473d9e5e61027978762b97168233f33cb058ea9cc07444 |
| Pinned hex in the repo | engine/crates/moos-core/src/swapcreator_runtime_code.hex |
| Contract spec | docs/CONTRACT.md |
The script below uses only the Python standard library. Save it as
verify-escrow.py, pass the RPC URL as the first argument, and it prints the address,
the byte length, the sha256 it computed and the pinned value. It exits 0 on a match and 1 on a
mismatch or an RPC error.
#!/usr/bin/env python3
# Check the deployed SwapCreator runtime against the pinned sha256.
import hashlib
import json
import sys
import urllib.request
PINNED = "856a21474d81dc6ef0473d9e5e61027978762b97168233f33cb058ea9cc07444"
ADDRESS = "0xb39074e5f5bb5fd3a5fd48df867115d5c8b97e71"
LENGTH = 5978
def main():
if len(sys.argv) != 2:
print("usage: verify-escrow.py <ethereum-json-rpc-url>", file=sys.stderr)
return 2
body = json.dumps({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getCode",
"params": [ADDRESS, "latest"],
}).encode("utf-8")
request = urllib.request.Request(
sys.argv[1],
data=body,
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(request, timeout=30) as response:
reply = json.load(response)
if "result" not in reply:
print("rpc error: %s" % (reply.get("error"),), file=sys.stderr)
return 1
code = reply["result"]
raw = bytes.fromhex(code[2:] if code.startswith("0x") else code)
digest = hashlib.sha256(raw).hexdigest()
print("address: %s" % ADDRESS)
print("bytes: %d" % len(raw))
print("sha256: %s" % digest)
print("pinned: %s" % PINNED)
if len(raw) != LENGTH:
print("FAIL: expected %d bytes" % LENGTH)
return 1
if digest != PINNED:
print("FAIL: runtime does not match the pinned hash")
return 1
print("OK: runtime matches the pinned hash")
return 0
if __name__ == "__main__":
sys.exit(main())
Run it against a mainnet endpoint:
python3 verify-escrow.py https://your-rpc.example
Any RPC you do not run yourself can lie. A single endpoint could return code that matches the pinned hash while the chain holds something else, or refuse to answer at all. Run the check on a second independent endpoint, or against your own node, and treat a disagreement as a failure. On mainnet the client reaches non-loopback endpoints through Tor, so a local node is the simplest endpoint to trust.
The pinned hash is also why the default address is safe to hard-code: mainnet builds bake in
0xb39074e5f5bb5fd3a5fd48df867115d5c8b97e71, and --contract-address or
MOOS_CONTRACT_ADDRESS can point the client elsewhere. With an override the same hash
check still applies, so a custom address is accepted only if it carries the same runtime. Stagenet
has no default address at all and always needs an explicit one.
Check the source
The client's source is public. Clone it, checkout nothing in particular, and read the contract and the code that pins it:
git clone https://git.moos.st/moos/moos.git
cd moos
Browse the tree at
git.moos.st/moos/moos/src/main; the history is
under commits and tagged builds under
releases. If you run a Radicle node, the
canonical copy is rad:z3vS8s9mTztnMwo1gK6pmatiFeBBc:
rad clone rad:z3vS8s9mTztnMwo1gK6pmatiFeBBc moos. Compare the two if you want; they
should agree, and a divergence is worth understanding before you trade.
The escrow spec is
docs/CONTRACT.md. The runtime
that the hash covers is
engine/crates/moos-core/src/swapcreator_runtime_code.hex, and the deploy code that
carries it is pinned next to it in
engine/crates/moos-chain/src/bin/swapcreator_deploy_code.hex.
To go further, rebuild the pinned hex from the Solidity source. The build script requires solc 0.8.20 and writes the runtime and deploy hex back into the crates that pin them:
SOLC=/path/to/solc-0.8.20 contracts/build.sh
The script optimises with 200 runs, checks that the runtime is a suffix of the deploy code, and
prints the runtime byte count and sha256. Build, then compare the decoded runtime bytes against the
pinned hash: 5978 bytes and
856a21474d81dc6ef0473d9e5e61027978762b97168233f33cb058ea9cc07444. A different solc
build, or different optimiser settings, can produce different bytes even from identical source, so
match the compiler version before drawing a conclusion from a mismatch.
Check this page
This website is GPL-3.0 and its source lives in its own repository,
rad:z3GuExZAM5oYAG7Kxxbvxx2sAdgVm. The site is plain HTML and CSS with no build step
that rewrites the prose, and deploy is a plain rsync of the static files to the server. That means
what you read in the repository is what was deployed, without a templating or generation layer in
between that could differ from the source.
The release is signed, but this page is not. A 38 MB tarball, SHA256SUMS and an
RSA signature over that checksum file are published together; install.sh verifies both
before unpacking. That proves the bytes you downloaded came from the release key. It does not prove
the source, the escrow or this page. The site's source is the repository above, so it can be read and
compared rather than cryptographically verified.
What none of this fixes
None of the checks above make the escrow audited, and none of them make the client finished. What they give you is a way to confirm that the contract, the source and the site agree, which is a different and smaller claim than safety.
- The escrow is unaudited. The source and the bytecode have not been independently reviewed. A matching hash confirms provenance, not correctness.
- It is alpha software. Version 0.1.3. Use amounts you can afford to lose.
- The ETH leg is locked first. That ordering is what gives the XMR side a claim path back to it. If neither side ever claims or refunds, the XMR stays at the swap address until one does.
- The keys are yours to back up. The Ethereum key and Monero wallet live under
<state>/identity, and--check-runtimeprints the resolved state directory. Nobody else can recover them.
Read the FAQ for the risks in plain terms and the technical docs for the protocol, the fee split and the failure modes.