// Path: src/main/java/edu/stanford/crypto/ECConstants.java
// public final class ECConstants {
//     static {
//         SecP256K1Curve curve = new SecP256K1Curve();
//         BigInteger hash = BigInteger.ZERO;
//         try {
//             MessageDigest sha256 = sha256 = MessageDigest.getInstance("SHA-256");
//             sha256.update("PROVISIONS".getBytes());
//             hash = new BigInteger(sha256.digest());
// 
//         } catch (NoSuchAlgorithmException e) {
//             e.printStackTrace();
//         }
//         ECFieldElement x = new SecP256K1FieldElement(hash.mod(curve.getQ()));
//         ECFieldElement rhs = x.square().multiply(x.add(curve.getA())).add(curve.getB());
//         ECFieldElement y = rhs.sqrt();
// 
// 
//         H = curve.validatePoint(x.toBigInteger(), y.toBigInteger());
// 
// 
//     }
// 
//     public static final ECCurve BITCOIN_CURVE = new SecP256K1Curve();
//     public static final ECPoint INFINITY = BITCOIN_CURVE.getInfinity();
//     public static final int STANDARD_SECURITY = 256;
//     public static final int CHALLENGE_LENGTH = 256;
//     public static final ECPoint G = CustomNamedCurves.getByName("secp256k1").getG();
//     public static final ECPoint H;
//     public static final BigInteger Q = BITCOIN_CURVE.getOrder();
//     public static final BigInteger CHALLENGE_Q = Q.min(BigInteger.ONE.shiftLeft(256));
// 
//     private ECConstants() {
//     }
// }
// 
// Path: src/main/java/edu/stanford/crypto/proof/MemoryProof.java
// public interface MemoryProof
// extends Proof {
//     byte[] serialize();
// }


import edu.stanford.crypto.ECConstants;
import edu.stanford.crypto.proof.MemoryProof;
import org.bouncycastle.math.ec.ECPoint;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
        this.commitmentXHat = ECConstants.BITCOIN_CURVE.decodePoint(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.challengeZero = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.challengeOne = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseS = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseT = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseV = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseXHat = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseZero = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseOne = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
    }

    @Override
    public byte[] serialize() {
        byte[] commitmentBalanceEncoded = this.commitmentBalance.getEncoded(true);
// Path: src/main/java/edu/stanford/crypto/ECConstants.java
// public final class ECConstants {
//     static {
//         SecP256K1Curve curve = new SecP256K1Curve();
//         BigInteger hash = BigInteger.ZERO;
//         try {
//             MessageDigest sha256 = sha256 = MessageDigest.getInstance("SHA-256");
//             sha256.update("PROVISIONS".getBytes());
//             hash = new BigInteger(sha256.digest());
// 
//         } catch (NoSuchAlgorithmException e) {
//             e.printStackTrace();
//         }
//         ECFieldElement x = new SecP256K1FieldElement(hash.mod(curve.getQ()));
//         ECFieldElement rhs = x.square().multiply(x.add(curve.getA())).add(curve.getB());
//         ECFieldElement y = rhs.sqrt();
// 
// 
//         H = curve.validatePoint(x.toBigInteger(), y.toBigInteger());
// 
// 
//     }
// 
//     public static final ECCurve BITCOIN_CURVE = new SecP256K1Curve();
//     public static final ECPoint INFINITY = BITCOIN_CURVE.getInfinity();
//     public static final int STANDARD_SECURITY = 256;
//     public static final int CHALLENGE_LENGTH = 256;
//     public static final ECPoint G = CustomNamedCurves.getByName("secp256k1").getG();
//     public static final ECPoint H;
//     public static final BigInteger Q = BITCOIN_CURVE.getOrder();
//     public static final BigInteger CHALLENGE_Q = Q.min(BigInteger.ONE.shiftLeft(256));
// 
//     private ECConstants() {
//     }
// }
// 
// Path: src/main/java/edu/stanford/crypto/proof/MemoryProof.java
// public interface MemoryProof
// extends Proof {
//     byte[] serialize();
// }


// Path: src/main/java/edu/stanford/crypto/proof/assets/AddressProof.java
import edu.stanford.crypto.ECConstants;
import edu.stanford.crypto.proof.MemoryProof;
import org.bouncycastle.math.ec.ECPoint;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;

        this.commitmentXHat = ECConstants.BITCOIN_CURVE.decodePoint(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.challengeZero = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.challengeOne = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseS = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseT = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseV = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseXHat = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseZero = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
        index += statementLength;
        statementLength = array[index++];
        this.responseOne = new BigInteger(Arrays.copyOfRange(array, index, statementLength + index));
    }

    @Override
    public byte[] serialize() {
        byte[] commitmentBalanceEncoded = this.commitmentBalance.getEncoded(true);
        byte[] commitmentXHatEncoded = this.commitmentXHat.getEncoded(true);