Mecenate v2.0.0
#100builders #backdrop #sismo #scaffold-eth #buildguild
We are thrilled to announce version 2 of Mecenate with the following enhancements:
enjoy the beta on : https://mecenate.vercel.app/ Join the beta tester here: https://backdropbeta.com/mecenate-monorepo/join/I4mh3AZL
SUMMARY
NEW IN V2
Smart Contract
UI
Documentation: https://scobru.gitbook.io/mecenatedocs/
WHAT'S THIS?
Mecenate is a protocol composed by a set of smart contracts that assicure the user's privacy and the integrity of the data. The protocol would to be open source and decentralized. All the fees are distributed to the Mecenate users.
Mecenate consists of several applications, including:
📄Mecenate Feed: Mecenate Feeds Mecenate Feeds allows anyone to publish data and stake capital behind the accuracy of that information. Users can build a verifiable track record and stake their predictions with ETH. By staking ETH, the seller of a prediction puts value at risk if the prediction goes wrong. When a seller stakes behind their prediction they choose a "griefing factor". Griefing factor = degree (e.g. 1:10) to which the buyer is able to destroy their stake. If the seller stakes ETH, the buyer can destroy both their stakes for ETH .
📣Mecenate Bay: A marketplace build on top of Mecenate Feeds for sourcing ANY kind of information (secrets, predictions etc). Requests for information are matched with a stake by "fulfillers" who get paid if the information meets the set parameters. ETH is used for staking. Ethers from punished fulfillers are sent to the Mecenate treasury and distributed between users protocol.
HOW IT WORKS?
QUESTION Enter a short explanation of what you're looking for. This can include links, Twitter handles and hastags. Make your descriptions as clear as possible.
REWARD An amount of ETH cryptocurrency you are locking up as a reward. This will be transferred into an escrow when you make the request, you make sure you have this in your wallet. Like this fulfillers can see you really have the money and will take your request seriously. (Once someone fulfills your request it is added to their stake and you will not get it back, you can only punish it.)
FULLFILLER stake This is what makes Mecenate Bay powerful. This is how much ETH cryptocurrency someone will need to deposit when fulfilling your request. You can destroy a fraction or all of their staked money if you are dissatisfied with what they provide. This will stop people responding with spam or bad information. It usually makes sense to have this be roughly 10% - 50% of the reward.
PUNISH RATIO How many ETH it will cost you to destroy one dollar of the fulfiller's stake. For example; if you set the ratio to 0.1 and punish a fulfiller who staked 100 ETH, it will cost you 10 ETH to destroy their entire stake. This protects the fulfiller from reckless punishment. The default value is good for most requests.
PUNISH PERIOD How many days after your request is fulfilled you have to verify the quality of the information provided. Within this window, you may punish the fulfiller. After this time their stake and reward are released. You may decide to release it early if you are satisfied with the submission. The default value is good for most requests.
WORKFLOW IDENTITY
New User Registration
Initial Connection: New user connects to
MecenateClient
orMecenateUI
.Key Generation:
MecenateClient
generates asymmetric encryption keysPubKey, PrivKey
.Identity Verification: User verifies their identity through Sismo zk-proof.
Key Storage: User sign a tx to create his unique Key Pair stored encrypted on IPFS.
Registration:
MecenateClient
callsregisterUser(evmAccount, vaultID, pubKey)
.
WORKFLOW FEEDS
Creating a Post
Feed Creation: Seller creates a Feed using
Feed_Factory.buildFeed()
.Data Upload: Seller uploads
rawdata
toMecenateClient_Seller
.Symmetric Key:
MecenateClient_Seller
generates symmetric encryption keySymKey
.Data Encryption:
MecenateClient_Seller
computesencryptedData = SymKey.encrypt(rawdata)
.Hash Computations:
keyhash = sha256(SymKey)
datahash = sha256(rawdata)
encryptedDatahash = sha256(encryptedData)
JSON and Proof:
json_proofhash_v120 = JSON(address_seller, multihashformat(datahash), multihashformat(keyhash), multihashformat(encryptedDatahash))
proofhash = sha256(json_proofhash_v120)
Blockchain Interaction:
Submits
proofhash
to their Feed contractUploads
json_proofhash_v120
to IPFS atmultihashformat(proofhash)
Uploads
encryptedData
to IPFS atmultihashformat(encryptedDatahash)
Post Submission: Creates a Post using
Feed.submitHash(proofhash)
.
Selling a Post
Payment: Buyer deposits the required payment using
Feed.accept()
.Key Retrieval:
MecenateClient_Seller
retrievesPubKey_Buyer
fromMecenate_Users
contract.Encryption:
MecenateClient_Seller
computesencryptedSymKey_Buyer = PubKey_Buyer.encrypt(SymKey)
.Sell Data:
json_selldata_v120 = JSON(encryptedSymKey_Buyer, multihashformat(proofhash))
Uploads
json_selldata_v120
to IPFS atmultihashformat(sha256(json_selldata_v120))
Submission: Submits
json_selldata_v120
to buyer usingFeed.submitHash(multihashformat(sha256(json_selldata_v120)))
.
Revealing a Post
SymKey Upload:
MecenateClient_Seller
uploadsSymKey
to IPFS atmultihashformat(keyhash)
.Raw Data Upload:
MecenateClient_Seller
uploadsrawdata
to IPFS atmultihashformat(datahash)
.
WORKFLOW SEND
Send a Payment
Set the transaction: The user selects the recipient and the amount to send. The recipient must be registered to the protocol.
Stealth Address Generation: The user generates a
Stealth_Address
derived from thePubKey_Receiver
fetched from theMecenateUser
contract, and arandom_string
SubmitHash: The user encrypts the
random_string
with thePubKey_Receiver
, generate the json_payData_v100 and uploads it to IPFS:
After upload we get an ipfs_hash
. User Encode paramaters into a encoded
structure like this:
Subsequently, the user will call submitHash(encoded)
to store this information in the MecenateSend contract. 4. Send funds to stealth Address: MecenateSend
sends the funds to the Stealth_Address
generated by the user, and stores in a mapping the encoded
corresponding to the PubKey_Receiver
.
Receive a Payment
Select the receiver: The user selects a
Receiver_Address
for their withdrawal and calls thegetHash()
function to check if there areencoded
data associated with theirPubKey_Receiver
.Decrypt and generate the PK: If the encrypted data exists, the user decrypts it, obtaining the
random_string
that multiplies by theirPubKey_Receiver
, thus obtaining theStealth_Address_PrivateKey
of theStealth_Address
.Withdraw: Having
Stealth_Address_PrivateKey
, the user sends the funds from the frontend to theReceiver_Address
selected at the beginning.
STANDARDS
This standard outlines how to encode data for transfering access to an mecenate data proof. Transfering access occurs when the creator of the proof allows an other party to access the data.
more infos here
PACKAGES
packages/nextjs - package for the UI build in nextJS
packages/hardhat - package with smart contracts build with Hardhat
packages/client - SDK and command line interface, usefull to interact with the protocol.
QUICK START
Clone this repo & install dependencies
Example .env file for Base Goerli
On a third terminal, start your NextJS app:
Contribution
Other developers who share a passion for decentralized data exchange are invited to join this project and help it reach its full potential. Thank you for taking the time to read about Mecenate, and we look forward to sharing more updates soon.
Last updated