{"id":13846144,"url":"https://github.com/Tuditi/dPACE","last_synced_at":"2025-07-12T04:31:16.905Z","repository":{"id":39052326,"uuid":"211660142","full_name":"Tuditi/dPACE","owner":"Tuditi","description":"dPACE, a decentralized Privacy-preserving, yet Accountable Car-sharing Environment","archived":false,"fork":false,"pushed_at":"2023-08-10T19:20:21.000Z","size":1465,"stargazers_count":7,"open_issues_count":13,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-14T19:47:11.858Z","etag":null,"topics":["blockchain","privacy","smart-contracts"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tuditi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-29T12:32:41.000Z","updated_at":"2024-04-25T12:45:41.000Z","dependencies_parsed_at":"2024-02-21T10:58:44.653Z","dependency_job_id":null,"html_url":"https://github.com/Tuditi/dPACE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tuditi%2FdPACE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tuditi%2FdPACE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tuditi%2FdPACE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tuditi%2FdPACE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tuditi","download_url":"https://codeload.github.com/Tuditi/dPACE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225791556,"owners_count":17524806,"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":["blockchain","privacy","smart-contracts"],"created_at":"2024-08-04T17:04:30.282Z","updated_at":"2024-11-21T19:31:14.994Z","avatar_url":"https://github.com/Tuditi.png","language":"Solidity","funding_links":[],"categories":["Solidity"],"sub_categories":[],"readme":"# Thesis\nMaster's Thesis on the design of a privacy-preserving car sharing protocol implemented on the Ethereum blockchain for the department Electrical Engineering of the KU Leuven.\n\nSmart Contract Address on the Rinkeby testnet: 0x85f8e621548c9c2114Edca97FBd4D9B64Eb6820c\n\nPrerequisites:\n- zkay v. 0.1 (https://github.com/eth-sri/zkay/tree/ccs2019).\nThis module is used to generate zk-proofs by following the instructions provided on their github repository. This boils down to configuring the scenario.py file according to the specific needs of the program and running the scenario generator of zkay.\n\nSteps to reproduce with additional data in data.txt:\n\nStep 1)\n\nDeploy all smart contracts on the blockchain:\n\n- PKI: Contains the Public Key Infrastructure necessary to support zk-proofs and ring signatures. (gas = 324 046)\n- Signature: Contains the functions to generate and verify ring signatures. (gas = 1 578 566)\n- Verify_deployRenter: Contains the verification circuit of the zk-proof that is used to deploy a renter. It checks whether the encrypted value of the inital balance \u003e= Deposit. (gas = 1 306 091)\n- Verify_renterBooking: Contains the verification circuit for the zk-proof used to book a car by the renter. It checks whether the encrypted balance \u003e= necessary deposit. (gas = 1 306 079)\n- Verify_renterPayment: Contains the verification circuit for the zk-proof that is supplied when the renter pays the fee. It checks whether the encrypted new balance equals the encrypted current balance minus the encrypted fee. (gas = 1 305 647)\n- dPACE: handles the functions related to booking and payment of a smart contract. This is the interface with which the actors (Car Owner,Car Renter and Car interact with). Upon deployment the constructor expects the addresses of the previously defined smart contracts. (gas = 4 731 498)\n\nTogether with the deployment of the Verify smart contracts, the library that performs elliptic curve operations (BN256G2) and pairings (Pairing) is deployed. The linking of the verification smart contracts and the libraries happen automatically in Remix. (gas = 1 271 585 + 912 773)\n\nStep 2)\n\nAnnounce public key of the renter in the PKI-contract -\u003e This used for the zero-knowledge proofs and the encryption of the balance of the renter. Warning: this is done through dummy encryption enc(msg,pk) = msg+pk!  \n\nStep 3) \n\nGenerate alt_bn 128 keys in Sage, which are used to generate ring signatures.  \n\nScript: \n\nF = FiniteField(0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47)  \nC = EllipticCurve(F,[0,3])  \nG = C.point((1,2))  \nPrivateKey = getrandbits(256)  \nPublicKey = PrivateKey*G  \n\nStep 4) \n\nAnnounce compressed public keys of car and renter in PKI. These can be used by anyone as mix-in keys. The renter can use the private key corresponding to their public key once to mitigate replay attacks. (An adversary could otherwise impersonate someone by using previously published key material.)\n\nStep 5) \n\nDeploy Car (by car owner)\nThe following parameters are included as the transaction parameters:\nAddress: the Ethereum address of the car's on-board unit.  \nDetails: Hash of a file containing the exact details of the car.  \nPrice: The price of the car per second.\n(gas = 86 560):\n\nStep 6) \n\nValidate Car (by car)\nThe following parameters are included as the transaction parameters:\ntoken: This is used by the renter for accountability purposes.\nlocation: The location of the car.\n(gas = 49 149)  \n\nStep 7) \n\nDeploy Renter\nThe following parameters are included as the transaction parameters:\nPPC: A privacy-preserving credential.  \nR,S,V: The signature of the Registration Service Provider.  \nverify_deployRenterProof: a zk-SNARK that the encrypted value of the balance equals the sent deposit.  \ngenParam: The encrypted balance of the renter.  \n(gas = 541 610)\n\nStep 8) \n\nThe car generates a hashlock for the renter and a ring signature that it sends to the renter through an off-chain communication channel.\n\nStep 9) \n\nrenterBooking\nThe following parameters are included as the transaction parameters:  \nCars: The addresses that belong to the entities inside the ring.  \nSecretLink: the token of the car encrypted with the renter's private key and the car's public key.  \nSignature: The ring signature generated by Signature.sol.  \nmessage: The message that contains the hashlock.  \nVerify_renterBooking: The zk-SNARK that testifies that the balance of the renter is enough to cover the deposit.  \nGenParam: The parameter that signifies true/false on the question above (equals to [1] in case renter has enough balance.\n\nStep 10) \n\nThe renter generates a hashlock for the car and a ring signature that it sends to the car through an off-chain communication channel.\n(gas = 1 058 655)\n\nStep 11) \n\nCar Booking\nThe following parameters are included as the transaction parameters:  \nRenters: The addresses that belong to the entities inside the ring.   \nSignature: The ring signature generated by Signature.sol.   \nMessage: The message that contains the hashlock.  \n(gas =  673 825)\n\nStep 12)  \n\nCar signs the encrypted fee through a ring signature with the same members as the ring signature of the hashlock of the renter.\n\nStep 13) \n\nThe renter generates a ring signature on the timestamp provided by the car. The same identitities should be used as in the ring of the ring signature at the booking phase. The timestamp is measured in unix time and used for calculating the fee of the rental. The signature and the preimage are sent to the car\n\nStep 14) \n\nCar Payment\n\nThe following parameters are included as the transaction parameters:\nPreimage: This is used to open the hashlock.  \nEncryptedPreimage: Contains the renter's preimage encrypted with the renter's public key and the car's private key.\nNewToken: The newly generated token.\nLocation: The updated location of the car.\nMessage: The message containing the timestamp.\nSignature: The ring signature on the timestamp.   \n\n\n(gas = 610 567)\n\nStep 15) \n\nRenter Payment\nThe following parameters are included as the transaction parameters:\nPreimage: This is used to open the hashlock.  \nMessage: The message containing the encrypted fee.\nSignature: The ring signature on the encrypted fee.   \nVerify_renterPayment: The zk-SNARK that the encrypted new balance equals the previous balance minus the encrypted fee.\nGenParam: The encrypted updated balance.\n\n(gas = 1 038 611)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTuditi%2FdPACE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTuditi%2FdPACE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTuditi%2FdPACE/lists"}