Architecture
PureFi Smart Contract SDK
PureFi Protocol allows within-smart-contract validation of the incoming funds by enforcing Users (a.k.a. Provers) to provide extra information along with their transactions.
This keeps end-to-end transactions between a User and smart contracts and doesn't break them with intermediate transactions like Oracles.
Verifiers can integrate PureFi within their smart contracts in two ways:
- Using Smart Contract SDK as a library and integrating it into their smart contracts. This way, Users will send transactions directly to the Verifier Smart Contracts.
- Using pre-configured PureFi Intermediate Smart Contract working as a filter discarding transactions with invalid or non-existent proofs. This way, Users will first send transactions to the address of Intermediate Smart Contract, and after it passes validation, the funds get transferred to the Destination Smart Contract.
Both options require Users (a.k.a. Provers) to first collect and obtain verification data and issue on-chain transactions afterward.
PureFi Smart Contract SDK allows for two types of transaction validation:
Interactive validation expects that the User will first communicate with the Issuer via traditional web2 protocols, obtain a proof signed by the Issuer, and then provide it to the Verifying Smart Contract.
Non-Interactive validation expects that the Verifier generates and publishes the verification algorithm (e.g., in the form of ZKSnark Circuit and Proof generation algorithm). User generates the Proof and uses this Proof as a part of the transaction payload in the address of the Verifier Smart Contract. When the smart contract receives such Proof, it validates it on-chain and accepts the funds if the proof is valid.
As of July 1st 2022, only Interactive Mode is available.