# Analog Ergo#

This project aims to use cryptographic primitives (well established, low level algorithms) as the basis for a cross-chain peer-to-peer marketplace. It will enable users to set and agree to listing prices and other parameters in a private and fungible manner, without the involvement of intermediaries.

## ScalarLock#

Successfully tested a Scalar Lock contract, this allows you to lock funds to a scalar value like a random 256bit number that you can test by comparing it with an Elliptic curve multiplication operation against the Secp256k1 Generator. A key component of how values are checked when verifying cryptographic signatures and will enable the final step to Atomic Swaps!. ErgoScript makes this quite easy (Once the constants and registers are figured out):

 val scalarLockScript: String = {
s"""
{
val xBYTES = OUTPUTS(0).R4[Coll[Byte]].get
val x = byteArrayToBigInt(xBYTES)
val G = decodePoint(generator)
sigmaProp(