With Sibyl, we can fetch arbitrary private data and process them in an end-to-end private environment with the enclave. Sibyl provides a unified interface to support the development of any data pipeline that you want to build. Each data pipeline is structured as a custom data connector in Sibyl. In this section, we will primarily present three examples:
Plaid: query the balance from the user's bank account and generate zero-knowledge range proofs for it
zk GitHub: query stats from the user's GitHub account and generate zero-knowledge range proofs for a specific data slot
ChatGPT: chat completion through calling ChatGPT APIs (by OpenAI) in a privacy-preserving environment
The input of the Sibyl API should be in JSON format with query_type
and query_param
:
Copy {
"query_type": "chatgpt_chat",
"query_param": {
"chat": "What the lifetime in Rust?",
"bearer": "sk-xpPk35xxxxxx"
}
}
query_type
specifics which data connector and which task you want to use. query_param
is a set of key-value pairs representing parameters for this query_type
. Each query_type
has a different set of query_param
.
The response is also in JSON format with the fields status
, result
, and attestation
. For example,
Copy {
"status": "success",
"result": "{\"userIdHash\":\"0x335b4b80f393df0229e3443c45fa22c6ef210b7ef8a2960a3939b61d45ccaaab\",\"zk_claim\":{\"encryptedClaim\":\"aNg8nE9hsKzlYxP4pQeq+r458z1FB7Q6K21eUfnp+cP6YPMMiHdE/gzMaRGYZiXmyYrW8+RCH/M3KN6bLsxUfk3ynQzLUaTSuWbL+kc5UdUrPTtTXKzG+i4uy+qn8Y+2TpsxjUMwLUYm185Pv2Z3nVSTjQ/8gsD7mN7d1rG2KYA=,pOrAo+t4JTrOP5sjdZAV08WfStNinz80JcA/1yVkskKgb/iBi4YJIDMUJ2I8s0kwS+/DI43r5N5oFJdU1vKJmQ2XGaa8YEZ4W79b6evXE3CphGNa7JB2GK24iIf+2I9euXIdjigur71Usx8DaVnfBNfX8WylzhwJfuMk8F34kYs=\",\"signature\":\"14272951555693684539242114834119896852236915619948746083204642436072376840546,8768332475319102537914508146713081179953322023933496880607458522217026729525,121833752050264021846028565115039479771097518029776289382904936068374855504\",\"signatureHash\":\"0x7ee5da60136b4e4697fd53ae0fa74cc5689615c0867d53a558e658450ce90331\"}}",
"attestation": "{\"id\":\"6b7e7db688b74c23a60d2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Vs4AzXVlscmpOQEQ9S5ghlarFLdCmLYWkAosuJFDXpV5eC2seaCUGWlQ5StgFxBRtWKelY7ejQcl30O4nNyv3GLAzD/RyYFPV/fYze7KP/EZJ8F9iDrb1nvnYi7Gphlpwg3MvAWJzyiVfEinYz+gDSc6DtATC0lVjh+3bP/kozTGd7KRP6axA9bvA8+sE/IOuys1oNzZ8VyMgbZkDI/gwlbUKSDszxdny/F7Pwt5SNxuH13+2pkgIfVDUiEnaNwAXdsdQB1aiHkrkfChBVXIdJClUPy8VbnPEezEGqP3+jA1RJ5706sIAWengOA02tBNv/UGAUxa5SGFbkbKvltQ982LGzOqN40j+Y0r33eEF0qK7Sb6hslHDLoXu3DvEG+Om0/5RplQYn3J9vgAUTd6w+6oZZGLfqfRXqq86kXzbhNY73f3EFhy4jqyW0="
}
If the status
code is not success
, then error
will be returned in result
. The attestation
is used to prove that Sibyl is running in a secure environment. It's a string with the format <att>|<sig>|<cert>
. <att>
is an escaped JSON containing the fields id
, isvEnclaveQuoteBody
, isvEnclaveQuoteStatus
, and timestamp
. <sig>
is a based64 signature signed with <cert>
. <cert>
is the base64 certificate. The result
is a string of escaped JSON like the following: "result": "{\"public_token\":\"public-sandbox-932322e9-3aec-4138-98da-0099b90f72f4\",\"request_id\":\"MKd6hWIAZcjMrQ0\"}"
. But in different APIs, the result will be different and not necessari a string of escaped JSON.
Last updated 6 months ago