xone-xdcx-precompiles: XDCx privacy precompile verifiers (0x1e, 0x28)
=======================================================================

This crate is a SEPARATELY LICENSED COMPONENT of xOneRS. It is licensed under
the GNU Lesser General Public License, version 3 or (at your option) any later
version (LGPL-3.0-or-later). The full texts are in COPYING.LESSER and COPYING
(the GPL-3.0 text that the LGPL incorporates). It is NOT part of the
AGPL-3.0-or-later / commercial dual license that applies to the rest of xOneRS:
a commercial license from xOneSH does not change the terms of this crate.

Origin
------
The ring-signature verifier (src/ring.rs), the aggregated bulletproof range-proof
verifier (src/bulletproof.rs), the curve arithmetic they rely on (src/curve.rs) and
the precompile wrappers (src/lib.rs) are a port of XinFinOrg/XDPoSChain
  core/vm/privacy/ringct.go
  core/vm/privacy/bulletproof.go
  core/vm/contracts.go (ringSignatureVerifier, bulletproofVerifier)
at commit cb1ef79073c05f50b9df75b1e740387b9d72af99.
XDPoSChain is a fork of go-ethereum; its source is
  Copyright The go-ethereum Authors and the XDPoSChain / XinFin contributors,
and licensed under LGPL-3.0-or-later (library code).

The test vectors in src/testdata/ were produced by running that commit's Go code
(src/testdata/gen/main.go).

Changes from the original: translated from Go to Rust; panics in the original are
returned as verification failures. The behaviour (accepted/rejected inputs and gas)
is otherwise unchanged.

Why it is linked into xone
--------------------------
XDC Network (chain 50) has these precompiles active from the Byzantium block (4)
until TIPXDCXMinerDisable (80,370,000); Apothem and net2040 have them in their
own ranges. A node that executes blocks in those ranges needs them to compute the
same state root as the network, so the default xone build links this crate.

LGPL obligations when distributing an xone binary that includes this crate
------------------------------------------------------------------------------
- Ship this NOTICE, COPYING.LESSER and COPYING with the binary.
- Make the complete corresponding source of this crate (including any
  modifications) available under LGPL-3.0-or-later.
- Rust links statically, so under LGPL-3.0 section 4(d) recipients must be able to relink the xone
  binary with a modified version of this crate.
    * Under AGPL-3.0-or-later the complete corresponding source of xone, including this crate, is
      public, so a recipient can rebuild xone with a modified copy of this crate. That meets
      section 4(d) for xone binaries distributed under the AGPL.
    * A binary distributed under a commercial license, without the rest of the source, must still
      meet section 4(d) for this crate: its distributor provides this crate's source and a relink
      kit (the compiled object or rlib form of the rest of xone, the exact rustc and cargo
      versions, the Cargo.lock and the relink commands), or builds without this crate (below).

Building xone without this component
------------------------------------
  RUSTFLAGS="--cfg xone_no_xdcx_privacy" cargo build -p xone
leaves this crate out of the build entirely. 0x1e and 0x28 then stop block
processing with a fatal error. Such a build is suitable for Ethereum networks and
for XDC nodes that never execute blocks below TIPXDCXMinerDisable (for example a
snap sync with a pivot above it); it cannot validate the full XDC history.
