Moeda.casa + Zincretik : Peer-to-Peer trades over Dark Pools

Applicant background

We are ΚΣ Team, hands-on researchers & developers with an interdisciplinary vision, believing that the new economic system being built can promote big social changes in South America. Putting into practice the evidences that blockchain can provide new techno-social forms of collective ownership and participation.

Description of Problem or Opportunity

Moeda.Casa Platform was possible by a ZOMG grant on 23-jan-2021 for a 8 weeks Proof-of-Concept to be implemented over the Brazilian Central Bank new System (starting November’21) called PIX. We elaborated a smart solution described here allowing Brazilians with any Bank account to acquire a multitude of cryptos in the most private way, having Zcash as a bridge;

Moeda implements the constant-quest for a safe system (also accessible by Tor) allowing Brazilians with any Bank account to acquire a multitude of cryptocurrencies/tokens in the most private way.

  • No KYC from buyers: no trackers and no analytics, no IDs, no registrations, and zero logs.
  • No worries with order books, liquidity, and complex fees arithmetic.
  • The Liquidity Agent has no information about the user’s requested token and wallet.

[/sequence diagram]

While the first unknown user did a full process to acquire some unknown crypto on 2021-03-16 from our Liquidity Providers, having it swapped directly from the ZEC Pool, much more work had to be done involving calculating slipages, Pix Refunds, UX, DevOps, running a full Zcash node and Tor. We also started to developed a message-oriented architecture using the ZEC MEMO fields to control the Dark Pool we call Zinkretik, but funds went over a long time ago to keep working on it.

You can find a 40m Deep Dive video here.

Proposed Solution + Technical approach

We described here a list of things to be finished and a better approach to enhance the security of our Liquidity Providers using Zinkretik;

Solution Format

  • a Docker image with a Zcash node and Zinkretik, so it can easily be deployed and adapted into other projects.
  • a Twitter bot controlled by it, as an anonymous proof-of-concept.
  • Moeda.casa v1, making the ztep from a working proof-of-concept to a product, beyond the small telegram community using it today.
  • A cointelegraph.com.br article about this work done, enabled by ZOMG.

How big of a problem would it be to not solve this problem?

Every time a new Zecpages, Zpublish, Moeda or projects willing to use Zcash technology wants to prototype a message-oriented system, they have to build their infrastructure from scratch and/or trust untrustable third-parties nodes to operate. We are open-sourcing our small smart solution for future projects fast prototyping and experimentation.

About Moeda, as we shared before, we believe Zcash can take the role in Brazil of opening the discussions and providing solutions on Privacy and Security as a whole, while we are crossing the big financial revolutions we are seeing.

Execution risks

Doing Software is lots about managing complexity. Last time we expected to work for 2 months and could not forehand the amount of work for a well done prototype, sharing very small resources with UX Dev and collaborators, not counting the many tests paying miners and transfers, while first expecting to focus mostly on the Dark Pool backend. Now, most of the risks are well known, and not having to work 12h/day to do it in 8 weeks. We also have requested a simple $5 server just for the web app, but with all the nodes and Tor we are paying 4 times more from our pockets since then.

Unintended Consequences

Our main worry is the unexpected usages of Moeda, as a Peer-to-Peer DarkPool, having legal consequences for the Liquidity Providers. Time will tell.

Schedule for a 5 months Project

August:

  • We really wanna go back to work ASAP on our TODO list of open tasks at Moeda!
  • Websockets and MessageQueues!

September:

  • Dev & Tests, Test & Dev!
  • Prepare for the masses!

October:

  • Zincretik as a docker image!
  • Twitter bot!

November:

  • Publish at cointelegraph!
  • Analyse, fix and enhance.

December:

  • Experiment a Treasury Tax for self-funding and stop depending on ZOMG

Budget

  • an one-time payment for 3-years a robust server at ssdnodes for 240
  • 2 full stack devs working for 5 months (+paying collaborators like the UX Dev) : 4200 * 2 * 5 = 42000

= $42240

9 Likes

It is also important to remember, as @zooko says here at 51:23

if you start with Shielded Zcash and a Shielded Pool, then you already start with no linkage between your assets and the rest of your life on the blockchain.

that we also have realized and proposed it before. With what we already have now - beyond all the bridge with Brazilian banks, that might sound too far from the US community - Moeda can ultimately became a hub of swap services in between Zcash and hundreds of other cryptos. (why not have it in English as well?)

We are here, with a committed team full of ideas, open to questions and feedback.

Hi,
One question : In your system, ZEC only use-case is to be sold to other cryptocurrency. Is this correct ?

Hey joris!

  • Zcash is able to be directly purchased by any brazilian bank with our system, of course.
    • Through swaps, it makes the anonymous bridge in between other +200 cryptos.
  • The (now limited) Liquidity Providers are feeding the Pool with ZEC-only and getting 0.01 ZECs (~$1.5 today) per anonymous transaction it provides to the unknown users.
  • The buyer’s part is going well, but the Pool went out of funds 17 times last two month for lack of Liquidity and a proper interface (& tests) to have more LPs > this is where we would like to grant resources and time to focus more work.
    • It is gonna be two months now the development is off (having your previous suggestions of having normal jobs), but we could definitely see it becoming the default hybrid-exchange for millions of people willing to have privacy in Brazil.

3 Likes

Hi @extrapo, I finally got some time to read through your design and I’ve got some questions for you:

Making complex simple: our platform allows a limited number of Agents to provide liquidity to a ZEC Pool , which is a Shielded Z-Addr observed and controlled by our own Zcashd node. Those agents are rewarded with a fixed (adjustable) 0.01 ZEC every time their liquidity are used. 100 transactions would award 1 ZEC.

Since the transactions are anonymous, would there be a risk of having agents create 100s of fake accounts in order to earn the fee? Basically, they introduce liquidity and take it out themselves.

Moeda lists and maintains updated a previously-chosen list of +200 Tokens based on the Swap services we implemented for a few decentralized and centralized Exchanges. We call Oracle our methods to average their prices, taking in account some Risk factors such as average price change, learning the slippages, and also parse and present to the user some meta-information from distinct public APIs, such as average market capitalization and all-time-highs.

The diagram describes the logic that is coded inside your system? I’m asking because it seems that the Liquidity Pool would be at risk of bugs/attacks on your system as it controls payments (“Moeda manages” arrow).

Probably, the most important design choice for this solution is based on a new Brazilian Fintech digital Bank which has an unprecedented Open Banking API that enables Moeda to observe when a payment is done to our Agents, detecting a valid UUID:order paid on their BRL Bank history over an API.

Could you give more details about this API? A link to some documentation would be great. Historically, banks were rather hostile towards crypto. Is this relation operational at this moment?

  • The Central Bank “knows” a transfer happened from Buyer to Agent, when and the BRL amount
  • However, there is absolutely no other track in between the paid Agent and the Buyer.
  • Nor that this transfer was crypto-related.
  • The paid Agent has NO information on both the wallet and the token amount sent to the Buyer.

Basically, the lack of customer information seems to go against AML regulations that Brazilian banks must follow.

Do you intend to have a mechanism in place to address this concern?

I just want to make sure you have considered the regulatory risks. (I just worked in banks but I’m not an expert at all.)

Hi hanh! Thank you once more to take some time to the community efforts.

Since the transactions are anonymous, would there be a risk of having agents create 100s of fake accounts in order to earn the fee? Basically, they introduce liquidity and take it out themselves.

This is an interesting observation, but if I introduce 1 ZEC in the Pool as an LP Agent, and by myself request 1 ZEC (or any other crypto), I would have to pay a little % more as the probably_slipage (the time the buyer has to pay the QR code) defined by our Oracle, plus the 0.01 fee in itself (I could get back if I am the Agent from this specific “contract”), plus the network transfers fees. So, I’m losing money.

Other point to clarify is that the generated QR Code uses a basic FIFO logic for the LPs; first-in-first-out, and there is a rotation while each has funds. For example, with today’s 16 active LPs, and 10 successful transactions, there are 6 LPs who didn’t get their fees yet - since their Liquidity were still not used. If we have 160 transfers, each would get 10 x 0.01 ZECs. Also happened that only 2 LPs have enough funds, so the others become inactive. LPs like me go through central exchanges and get new ZECs with our BRLs, shield it and send to the Pool expecting a profit.

The diagram describes the logic that is coded inside your system? I’m asking because it seems that the Liquidity Pool would be at risk of bugs/attacks on your system as it controls payments (“Moeda manages” arrow).

We did our best, and are still learning, on how to keep the system protected. But you are right that having access to the server or exploiting some bug would compromise the Pool, the LPs are aware it is an experimental system. Any system can have an Achilles’ heel.

Could you give more details about this API? A link to some documentation would be great. Historically, banks were rather hostile towards crypto. Is this relation operational at this moment?

The Brazilian Central Bank System is having a big revolution, enabling this instant-payments PIX, working on its own Digital Currency and forcing all Banks to implement it’s Open Banking APIs. There are four phases, from 01/02 (when I requested the first grant for the prototype) and 15/12 (when all banks should have open APIs) > Official announcement in english: Banco Central do Brasil. Our solution uses this endpoints.

Basically, the lack of customer information seems to go against AML regulations that Brazilian banks must follow.

“every operation and transaction (regarding, without limitations, every product and service offered by the entity) shall be registered in a manner that allows the institution to identify: (1) the parties involved in the operation; and (2) the origin and recipient of resources; in the case of payment transactions, the receipt and transfer of funds.”

First, we are not an entity or company. Second, PIX is substituting money usage for simple things as buying bread. No one in shops asks your ID while selling you bread or a guitar, while you pay with your phone over PIX. Second, the transfer in itself agregates the KYC for the Central Bank, since the transfer happens in between two official BRL accounts. The person is paying for a token in a legal way and no law forces us to record which one or to which address it was sent. We dont even store it.

About Helix: we don’t offer this kind of service.

“The nature of cryptocurrency is to allow law enforcement to have unique visibility on financial flow where they never had before,” comparing it to government-issued fiat currency, said Mr. Redbord, who is now head of legal and government affairs at TRM Labs Inc., a digital currency tracing firm.

This is a big debate in which we are in the Zcach side, willing to promote privacy and security against Totalitarianism.

Tbh, the notion of a pool is a bit confusing to me. You describe a pool under management by your system. In this case, I don’t see why you don’t use a traditional order book / order matching mechanism. LP are great for decentralized / smart contract situations but otherwise they introduce more slippage and aren’t as fair.

This way you could avoid the risk of custody by letting the order maker stash some coins at an address, provide you with a viewkey for monitoring and you just collect a deposit / broker fee.

Good luck!

Since the system is experimental, many words we use like “contracts”, “smart pools”, “oracle”, or “swaps” are a way to represent some concepts that might not go 1:1 to more common DeFi ways, though it influenced us back on our hybrid methods.

Having a fixed price in forehand, for example, is a system requirement since we first start to draw it, when gathering comments from the Telegram group with 90k users for acquiring cryptos in Brazil. Since the PIX payment can take seconds, or a minute, people - in general - preferred to have a fixed price (even paying slightly more) rather than getting frustrated they could get a smaller token amount . :upside_down_face:

Anyhow, some swap services we’ve integrated, as zkswap, are already abstracting a traditional AMM orderbook for us.

We are talking about thousands of potential users who dont put more than $200 in a order and are already paying ~30% more in shit WordPress pseudo-exchanges with young boys in the back doing manual transfers - just to get it “instantaneously” without having to register, and paying using PIX. The abstraction Moeda proposes makes it much easier and fair for many newbies willing to acquire cryptos with privacy.

This way you could avoid the risk of custody by letting the order maker stash some coins at an address, provide you with a viewkey for monitoring and you just collect a deposit / broker fee.

The LPs strategies need more work! I see what you mean; That is how we believe the proposed work on Zincretik coordinating ZEC/MEMO messages can lead us to fully decentralize each LP running its own moeda-agent while keeping their custody, yes!

This paper from Privacy Enhancing Technologies 2021, on privacy-preserving blockchain auctions and (less efficiently) order books, might have some useful techniques for the proposal:

Gage MPC: Bypassing Residual Function Leakage for Non-Interactive MPC

(Also available in 20min presentation form, and as action figures.)

3 Likes

Hello,

ZOMG is declining to provide funding for this application. After discussions and evaluating the community reaction on the forums, we feel that it is an overly complicated system that would likely not lead to enough value to justify the ~$42k you are proposing we provide for the grant. We are skeptical that much value was generated from the system built by the first grant provided to your team or that the system built has liquidity. Thank you for your application!

2 Likes

This is very sad news.

Well, let’s be honest that the initial 6k for four people working for 6 months to have that first POC working became servers, rents and food, not surplus, liquidity or “much value”; otherwise we would be working on it, not asking a fund to be able to work.

It took 8 weeks, after the published video, to have any ZOMG Member comment on the project - and this is it.

No questions? No reevaluations? No interest?

We can’t follow the logic in giving 55k to https://zeme.team/ and “feel that [Moeda] is an overly complicated system that would likely not lead to enough value to justify the ~$42k”, when Zcash could work as the default protocol for privacy in a country with 88 million people just moving to Digital Banks, while it’s Central Bank is implementing an innovative Open Banking system that we have been researching and developing bridges for a year, since we joined this forum with an idea. :frowning:

[…]

We should have heard people a year ago who suggested us to implement a basic zkSNARKs with Solana because they were fearless funding an ecosystem with more than 400 projects from all over the world.

We’ve tried hard to find support here… time to move on.

1 Like