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

S3 store vault #213

Merged
merged 66 commits into from
Mar 13, 2025
Merged

S3 store vault #213

merged 66 commits into from
Mar 13, 2025

Conversation

kbizikav
Copy link
Collaborator

@kbizikav kbizikav commented Mar 12, 2025

This PR includes multiple breaking changes that require a complete network reset, contract redeployment, full database reset, and migration from initial state.

Major Changes

Migration File Consolidation:

Merged migration files for store-vault-server and withdrawal-server to improve readability during this database reset.

UUID Replacement:

Eliminated UUIDs in store-vault-server in favor of encrypted data hash values.

Purpose: Enables future local file data management without dependency on store-vault-server UUIDs.
Security: Data typically contains user-selected random salt, making collisions possible only through intentional action. Submissions with duplicate hash values will be rejected, maintaining security.

S3 Integration:

Created s3-store-vault to store data directly in AWS S3.

  • Clients save data directly to S3
  • Data retrieval occurs via CloudFront

Signature Implementation:

Added signatures to encrypted data that should only be stored/retrieved by private key holders, reducing reliance on store-vault-server trust.

Data Storage Abstraction:

Reorganized store-vault/s3-vault storage into:

  • Snapshot data: Stores only latest data (mutable)
  • Historical data: Stores all data (immutable)
    Both implemented as immutable objects in S3 to ensure update consistency

Required Configuration

s3-store-vault

The following environment variables must be specified:

BUCKET_NAME: S3 bucket name
CLOUDFRONT_DOMAIN: CloudFront domain
CLOUDFRONT_KEY_PAIR_ID: Key-pair ID for CloudFront presigned URLs
CLOUDFRONT_PRIVATE_KEY_BASE64: Base64 string of CloudFront private key
S3_UPLOAD_TIMEOUT=20: Expiry timeout for S3 uploads
S3_DOWNLOAD_TIMEOUT=40: Expiry timeout for CloudFront downloads

Block Builder and withdrawal-server

When using s3 store vault server:

  • Set STORE_VAULT_SERVER_BASE_URL to the s3 store vault server URL
  • Set USE_S3=true

Private zkp server

Requires update due to encryption method changes. I will submit a separate PR.

Frontend

When using s3 server:

  • Set store_vault_server_url to the s3 server URL
  • Set use_s3=true

@kbizikav kbizikav merged commit 3bec4eb into dev Mar 13, 2025
5 checks passed
@kbizikav kbizikav deleted the encryption-with-signature branch March 13, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant