Through a fully peer-to-peer stack, we can confidently say that PintSwap will remain censorship-resistant with increased security compared to other exchanges.
How it works
PintSwap makes use of the same p2p libraries that power IPFS, but configured in a way where it can work entirely in a web browser. The configuration of libp2p and build packaged in @pintswap/sdk is codenamed pintp2p, and facilitates network connectivity between two traders or daemon processes in realtime, without the use of an intermediary to relay or decrypt transmission. In this way trades can occur p2p in private, if they are not broadcast to the public orderbook.
The pintp2p network stack also has facilities for publicly routable limit orders, which will be visible from the webapp and also consumable by the OPPS matching engine maintained by PintDAO. All that is required is that an OTC offer is marked to be published, and then it is picked up automatically by the OPPS or otherwise visible to be taken by users of the web frontend.
PintSwap trade negotiation happens entirely over p2p, and the final transaction script constructed within that channel is signed using a 2p-ecdsa compatible sMPC scheme, which is a method of performing a joint signature between two entities, in a way where neither party can recover the shared key. The transaction script is a one-time use EVM contract, assembled within the runtime of the application from the most minimal and efficient set of opcodes, solely responsible for transferring each side of the trade to the counterparty.
There is no concept of frontrunning possible in the trading system used by PintSwap. The channel established between two traders over pintp2p is encrypted using NOISE. The shared key generated by the two traders is created using 2p-ecdsa sMPC, which is a 2-of-2 threshold ECDSA scheme. The contract address created by the trade transaction is the only address approved to spend either party's funds. Since both traders assemble the same bytecode for the contract deployment, this contract can never exist unless it is the exact code that performs the agreed trade.