Skip to main content

Step 3: Interact verifiably using a program

Step 3.1: Interact with llama3.2 on Oyster

You can interact with the llama3.2 enclave using HTTP and specifying a prompt. Here is an example using curl:

curl http://{{instance-ip}}:5000/api/generate -d '{
"model": "llama3.2",
"prompt":"What is Ethereum?"
}'

The response should look something like

{"model":"llama3.2","created_at":"2025-03-10T15:21:23.562040132Z","response":"Ethereum is an open-source, decentralized, blockchain-based platform that enables the creation of smart contracts and decentralized applications (dApps). It was founded in 2014 by Vitalik Buterin and has since become one of the largest and most widely-used blockchain platforms in the world.\n\nEthereum's core innovation is its use of a programming language called Solidity, which allows developers to write and deploy self-executing contracts with specific rules and logic. These smart contracts can automate various processes, such as the transfer of assets or the execution of specific actions, without the need for intermediaries.\n\nThe Ethereum network uses a consensus mechanism called proof-of-work (PoW), which requires miners to solve complex mathematical puzzles to validate transactions and create new blocks. This process is energy-intensive and requires significant computational power.\n\nEthereum has several key components:\n\n1. **Smart contracts**: These are self-executing contracts with specific rules and logic, which can automate various processes.\n2. **Tokens**: Ethereum allows developers to create their own tokens, which can be used for various purposes, such as investing or payment systems.\n3. **Decentralized applications (dApps)**: dApps run on the Ethereum network and are built using smart contracts. They can be used for a wide range of purposes, such as gaming, finance, or social media.\n\nSome of the key benefits of Ethereum include:\n\n1. **Decentralization**: Ethereum operates on a decentralized network, which means that it is resistant to censorship and can operate without the need for intermediaries.\n2. **Security**: Ethereum's use of cryptography and smart contracts provides a high level of security and transparency.\n3. **Programmability**: Ethereum allows developers to create complex and customizable programs, which enables the creation of innovative applications.\n\nHowever, Ethereum also has some limitations and challenges, such as:\n\n1. **Scalability**: The current Ethereum network can be slow and congested, making it difficult to process a large number of transactions.\n2. **Gas fees**: The cost of processing transactions on Ethereum is based on gas fees, which can be high and unpredictable.\n3. **Security risks**: While Ethereum's use of smart contracts provides security benefits, it also introduces new security risks, such as contract vulnerabilities.\n\nOverall, Ethereum has the potential to revolutionize the way we think about blockchain technology and its applications.","done":true,"done_reason":"stop","context":[128006,9125,128007,271,38766,1303,33025,2696,25,6790,220,2366,18,271,128009,128006,882,128007,271,3923,374,35046,30,128009,128006,78191,128007,271,36,19041,372,374,459,1825,31874,11,49063,11,18428,6108,5452,430,20682,279,9886,315,7941,17517,323,49063,8522,320,67,54702,570,1102,574,18538,304,220,679,19,555,55371,1609,2030,85509,323,706,2533,3719,832,315,279,7928,323,1455,13882,69621,18428,15771,304,279,1917,382,36,19041,372,596,6332,19297,374,1202,1005,315,264,15840,4221,2663,22925,488,11,902,6276,13707,311,3350,323,10739,659,71821,10831,17517,449,3230,5718,323,12496,13,4314,7941,17517,649,69711,5370,11618,11,1778,439,279,8481,315,12032,477,279,11572,315,3230,6299,11,2085,279,1205,369,55275,5548,382,791,35046,4009,5829,264,24811,17383,2663,11311,8838,29721,320,34004,54,705,902,7612,43243,311,11886,6485,37072,47623,311,9788,14463,323,1893,502,10215,13,1115,1920,374,4907,88092,323,7612,5199,55580,2410,382,36,19041,372,706,3892,1401,6956,1473,16,13,3146,34917,17517,96618,4314,527,659,71821,10831,17517,449,3230,5718,323,12496,11,902,649,69711,5370,11618,627,17,13,3146,30400,96618,35046,6276,13707,311,1893,872,1866,11460,11,902,649,387,1511,369,5370,10096,11,1778,439,26012,477,8323,6067,627,18,13,3146,5005,46186,1534,8522,320,67,54702,33395,25,294,54702,1629,389,279,35046,4009,323,527,5918,1701,7941,17517,13,2435,649,387,1511,369,264,7029,2134,315,10096,11,1778,439,16211,11,17452,11,477,3674,3772,382,8538,315,279,1401,7720,315,35046,2997,1473,16,13,3146,5005,46186,2065,96618,35046,27149,389,264,49063,4009,11,902,3445,430,433,374,31785,311,52988,323,649,14816,2085,279,1205,369,55275,5548,627,17,13,3146,15712,96618,35046,596,1005,315,87937,323,7941,17517,5825,264,1579,2237,315,4868,323,28330,627,18,13,3146,10920,76,2968,96618,35046,6276,13707,311,1893,6485,323,63174,7620,11,902,20682,279,9886,315,18699,8522,382,11458,11,35046,1101,706,1063,9669,323,11774,11,1778,439,1473,16,13,3146,3407,278,2968,96618,578,1510,35046,4009,649,387,6435,323,44385,291,11,3339,433,5107,311,1920,264,3544,1396,315,14463,627,17,13,3146,59828,12718,96618,578,2853,315,8863,14463,389,35046,374,3196,389,6962,12718,11,902,649,387,1579,323,50235,627,18,13,3146,15712,15635,96618,6104,35046,596,1005,315,7941,17517,5825,4868,7720,11,433,1101,40019,502,4868,15635,11,1778,439,5226,52227,382,28589,11,35046,706,279,4754,311,14110,553,279,1648,584,1781,922,18428,5557,323,1202,8522,13],"total_duration":37304872059,"load_duration":2341238708,"prompt_eval_count":29,"prompt_eval_duration":1451000000,"eval_count":475,"eval_duration":33510000000}
tip

Since we sign the response to aid verifiability, the response is first fully collected unlike the usual streaming interface you might find in e.g. ChatGPT. Hence, you can expect it to take ~2 minutes for the full response.

Step 3.2: Verify the response

Running the curl command above with -v option shows us two important headers:

x-oyster-timestamp: 1741620242
x-oyster-signature: 8781e472b0f8e3693c1c6cec60b1ae0f5fed4c574d24e3bfcc6cc23f02a918a8785709ceb8a464a7d1dbbb8809ba73047acaa3ff5f1918ba565d82d177e123801b

The public key for the signature can be obtained by running

curl <ip>:1301/attestation/raw -vs | curl -H "Content-Type: application/octet-stream" --data-binary @- 13.201.207.60:1400/verify/raw -vs

Step 3.3: Verify Remote Attestation

To verify the enclave, replace <ip> with the IP from the deployment:

oyster-cvm verify --enclave-ip <ip>

If successful, you will see Verification successful along with attestation details.