{"id":21170230,"url":"https://github.com/dcarpintero/dapp-real-state","last_synced_at":"2025-09-10T17:40:14.104Z","repository":{"id":142421247,"uuid":"291345306","full_name":"dcarpintero/dapp-real-state","owner":"dcarpintero","description":"Decentralized Digital Marketplace w/ Smart Contracts and ZKPs.","archived":false,"fork":false,"pushed_at":"2023-10-30T09:03:43.000Z","size":35629,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T10:51:00.222Z","etag":null,"topics":["decentralized-application","ethereum","solidity","truffle-framework","web3js","zero-knowledge-proofs"],"latest_commit_sha":null,"homepage":"https://github.com/dcarpintero/dapp-real-state","language":"Solidity","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcarpintero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-08-29T20:36:58.000Z","updated_at":"2025-01-08T10:49:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"30576a57-3a39-474f-ab1e-caab3005dfe6","html_url":"https://github.com/dcarpintero/dapp-real-state","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-real-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-real-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-real-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcarpintero%2Fdapp-real-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcarpintero","download_url":"https://codeload.github.com/dcarpintero/dapp-real-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243616755,"owners_count":20319952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decentralized-application","ethereum","solidity","truffle-framework","web3js","zero-knowledge-proofs"],"created_at":"2024-11-20T15:57:13.021Z","updated_at":"2025-03-14T17:24:47.862Z","avatar_url":"https://github.com/dcarpintero.png","language":"Solidity","readme":"# Decentralized Real State Marketplace\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/doc/logo.jpg\"\u003e\n\u003c/p\u003e\n\n## Project Description\n\n- Decentralized [digital marketplace](https://rinkeby.opensea.io/storefront/kryptorealstate) for real-state properties.\n\n[![Build Status](https://travis-ci.com/dcarpintero/dapp-real-state.svg?branch=master)](https://travis-ci.com/github/dcarpintero/dapp-real-state)\n[![License](https://img.shields.io/github/license/dcarpintero/dapp-real-state)](https://github.com/dcarpintero/dapp-real-state/blob/master/LICENSE)\n\n### Asset Tokenization (ERC721)\n\n- Real-state assets are represented as non-fungible tokens, and implement the [ERC721 standard](https://eips.ethereum.org/EIPS/eip-721).\n\n### Minting and Zero Knowledge Proofs (ZKPs)\n\n- In order to mint a new real-state token, a party (the prover) is required to prove to another (the verifier) knowledge of a secret. The application relies on a zero-knowledge Succinct Non-interactive ARguments of Knowledge (ZK-SNARK) scheme, which allows a prover to demonstrate beyond any reasonable doubt to a verifier, that the prover meets said requirement and knows a secret, without revealing what the secret is. As a non-interactive construction, the proof consists of a single message sent from the prover to the verifier.\n\n- Zero-knowledge proofs (ZKPs) are a family of probabilistic protocols, first described by [Goldwasser, Micali and Rackoff](http://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf) in 1985.\n\n#### Generating ZKPs\n\n- A naive proof-of-concept implementation in form of [square](https://github.com/dcarpintero/dapp-real-state/blob/master/contracts/zokrates/code/square/square.zok) knowledge is provided, whereas a more realistic [proof-of-preimage](https://github.com/dcarpintero/dapp-real-state/blob/master/contracts/zokrates/code/preimage/preimage.zok) scheme has also been implemented for proving preimage knowledge of a given hash digest, without revealing what the preimage is.\n\n- ZK-SNARKs consist of three algorithms G, P, V. In a trusted off-chain setup phase, the key generator G takes a secret parameter lambda and a program C in order to generate two publicly available keys, namely a proving key pk and a verification key vk. These keys are public parameters that only need to be generated once for a given program C.\n\n- Compilation of program C into an [aritmetic circuit](https://medium.com/@VitalikButerin/quadratic-arithmetic-programs-from-zero-to-hero-f6d558cea649), and generation of the proving and verification key from the resulting aritmetic circuit has been carried out by [ZoKrates](https://github.com/Zokrates/ZoKrates):\n\n```\nzokrates compile -i square.zok\nzokrates setup\n```\n\n- As a next step, the prover P takes as input the proving key pk, a public input x and a private witness w. The algorithm generates a proof prf = P(pk, x, w) that the prover knows a witness w and that the witness satisfies the program condition(s):\n\n```\nzokrates compute-witness -a \u003cx\u003e \u003cw\u003e -output witness\n```\n\n- Each resulting proof consists of the three elliptic curve points that make up the zkSNARKs proof:\n\n```\nzokrates generate-proof -w witness -j proof\n```\n\n- The verifyTx function in the contract accepts these three values, along with an array of public inputs. The contract further computes V(vk, x, prf) which returns true if the proof is correct, and allows to infer that the prover knows a witness w satisfying C(x,w) == true.\n\n```\nzokrates export-verifier\n```\n\n### Unit and system tests\n\n- TestKryptoRealState.js\n- TestPausable.js\n- TestPreimageVerifier.js\n- TestSquareVerifier.js\n- TestProofVerifier.js\n\n### Continuous Integration (TravisCI)\n\n- .travis.yml\n\n### Dependencies\n\n- Solidity v0.6.2 (solc-js)\n- Node v12.17.0\n- Web3.js v1.2.1\n- Zokrates v0.6.1\n\n- Truffle v5.1.30 (core: 5.1.30) - Development framework\n- @truffle/hdwallet-provider v1.0.36 - HD Wallet-enabled Web3 provider\n- truffle-assertions v0.9.2 - Additional assertions for Truffle tests\n- chai v4.2.0 - Assertion library\n\n## Getting Started\n\nInstall dependencies\n\n```\nnpm install\n```\n\nCreate infura_key file, and define mnemonic in .secret file\n\n```\n.secret\n.infura_key\ntruffle-config.js\n```\n\nLaunch Ganache with the same mnemonic and initialize 10 accounts with 100 ETH each\n\n```\nganache-cli -m \u003cmnemonic\u003e -a 10 -e 100\n```\n\nCompile, test and migrate\n\n```\ntruffle compile\ntruffle test\ntruffle migrate --reset\n```\n\nDeployment to Rinkeby\n\n```\ntruffle migrate --reset --network=rinkeby\n```\n\n## Rinkeby Contract Addresses\n\n### ProofVerifierKRS.sol\n\n- Deployment TX: [0x9c7f76f30e27c52511a7d49953533c28369b91ef7a6f8bfc1fd7300937aba487](https://rinkeby.etherscan.io/tx/0x9c7f76f30e27c52511a7d49953533c28369b91ef7a6f8bfc1fd7300937aba487)\n- Contract Address: [0x45ba1aBB6D689347888A199986FDC89aEd19eC00](https://rinkeby.etherscan.io/address/0x45ba1aBB6D689347888A199986FDC89aEd19eC00)\n- [ABI](/abis/ProofVerifierKRS.json)\n\n### SquareVerifier.sol\n\n- Deployment TX: [0x44ebf1fd04004b737949dc1f0b5982ab73f2a553f25563420a45e84ab66c0eac](https://rinkeby.etherscan.io/tx/0x44ebf1fd04004b737949dc1f0b5982ab73f2a553f25563420a45e84ab66c0eac)\n- Contract Address: [0xf1eBb6ED9482d2086bd55f8c227cF1f06655ea05](https://rinkeby.etherscan.io/address/0xf1eBb6ED9482d2086bd55f8c227cF1f06655ea05)\n- [ABI](/abis/SquareVerifier.json)\n\n## OpenSea MarketPlace\n\n- [Storefront](https://rinkeby.opensea.io/storefront/kryptorealstate)\n- [KRS Token Transactions](https://rinkeby.etherscan.io/token/0x45ba1abb6d689347888a199986fdc89aed19ec00)\n\n## Token Holders\n\n- [0x627306090abab3a6e1400e9345bc60c78a8bef57](https://rinkeby.etherscan.io/token/0x45ba1abb6d689347888a199986fdc89aed19ec00?a=0x627306090abab3a6e1400e9345bc60c78a8bef57)\n- [0xf17f52151ebef6c7334fad080c5704d77216b732](https://rinkeby.etherscan.io/token/0x45ba1abb6d689347888a199986fdc89aed19ec00?a=0xf17f52151ebef6c7334fad080c5704d77216b732)\n\n## About Zero Knowledge Proofs (ZKPs)\n\n- [The Knowledge Complexity of Interactive Proof Systems, Goldwasser et al. 1985](http://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf)\n- [Building Identity-linked zkSNARKs with ZoKrates, Eberhardt 2019](https://medium.com/zokrates/building-identity-linked-zksnarks-with-zokrates-a36085cdd40)\n- [zkSNARKs in a nutshell, C. Reitwiessner 2016](https://blog.ethereum.org/2016/12/05/zksnarks-in-a-nutshell/)\n\n## Credits\n\n- Storefront image has been designed using resources from Freepik.com.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcarpintero%2Fdapp-real-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcarpintero%2Fdapp-real-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcarpintero%2Fdapp-real-state/lists"}