Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfiles and other files needed to decode attestation quote #358

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Dockerfile.sgx-poster
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ghcr.io/espressosystems/nitro-espresso-integration/nitro-node:20241203-celestia

RUN curl -L -o kzg10-aztec20-srs-1048584.bin https://github.com/EspressoSystems/ark-srs/releases/download/v0.2.0/kzg10-aztec20-srs-1048584.bin


EXPOSE 8547
EXPOSE 8548

ENV AZTEC_SRS_PATH=/home/user/kzg10-aztec20-srs-1048584.bin
ENV HOME=/home/user

COPY --chown=user:user entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

USER user

ENTRYPOINT ["/entrypoint.sh"]
12 changes: 12 additions & 0 deletions decode_report_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Read the binary file and convert to hex using xxd
xxd -p report.bin | tr -d '\n' > report.hex

# Extract the desired byte ranges (64:96 and 128:160)
mr_enclave=$(cut -c 129-192 report.hex) # Extract bytes 64:96 (1-based index)
mr_signer=$(cut -c 257-320 report.hex) # Extract bytes 128:160 (1-based index)

# Print the hex values
echo "MRENCLAVE: $mr_enclave"
echo "MRSIGNER: $mr_signer"
33 changes: 33 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Define dummy data
DUMMY_DATA="some-dummy-data"

# Create the user_report_data structure with dummy data
REPORT_DATA=$(printf "%-64s" "$DUMMY_DATA")

# Write to /dev/attestation/user_report_data
echo -n "$REPORT_DATA" > /dev/attestation/user_report_data
if [ $? -ne 0 ]; then
echo "Failed to write to /dev/attestation/user_report_data"
exit 1
fi
echo "Successfully wrote user report data."

# Attempt to read and print the report as a hex dump
if ! dd if=/dev/attestation/report bs=1 | xxd -p; then
echo "Failed to read from /dev/attestation/report"
exit 1
fi

echo "Successfully read attestation report."

# Adjust ownership for the .arbitrum folder to the 'user' inside the container
if [ -d "/home/user/.arbitrum" ]; then
sudo chown -R user:user /home/user/.arbitrum
fi

# Start Nitro process
exec /usr/local/bin/nitro \
--validation.wasm.enable-wasmroots-check=false \
--conf.file /config/poster_config.json
Loading