Zama 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 21쪽

echnology you need to be granted Zama’s patent license. Please contact us at <hello@zama.ai> for more information. **Do you file IP on your technology?** > Yes, all Zama’s technologies are patented. **Can you customize a solution for my specific use case?** > We are open to collaborating and advancing the FHE space with our partners. If you have specific needs, please email us at <hello@zama.ai>. ### Support 🌟 If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development. <p align="right"><a href="#about">↑ Back to top</a></p> # Contributor Covenant Code of Conduct ## Our pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting us anonymously through [this form](https://forms.gle/569j3cZqGRFgrR3u9). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). For answers to common questions about this code of conduct, see the FAQ at <https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>. # Security ## Reporting a Vulnerability If you find a security related bug in fhevm projects, we kindly ask you for responsible disclosure and for giving us appropriate time to react, analyze and develop a fix to mitigate the found security vulnerability. To report the vulnerability, please open a draft [GitHub security advisory report](https://github.com/zama-ai/fhevm/security/advisories/new) # coprocessor ### Introduction **FHEVM Coprocessor** provides the execution service for FHE computations. It includes a **Coprocessor** service [FHEVM-coprocessor](/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/fhevm/coprocessor/coprocessor_backend). The Coprocessor itself consists of multiple microservices, e.g. for FHE compute, input verify, transaction sending, listenting to events, etc. ### Main features * An **Executor** service for [FHEVM-native](/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/fhevm/native/executor) * A **Coprocessor** service for [FHEVM-coprocessor](/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/fhevm/coprocessor/coprocessor_backend) *Learn more about FHEVM Coprocessor features in the* [*documentation*](/protocol/solidity-guides/v0.10/coprocessor/docs)*.*\ <br> ### Table of Contents * [Introduction](#introduction) * [Main Features](#main-features) * [Getting Started](#getting-started) * [Generating Keys](#generating-keys) * [Coprocessor](#coprocessor) * [Dependencies](#dependences) * [Installation](#installation) * [Services Configuration](#services-configuration) * [tfhe-worker](#tfhe-worker) * [cli](#cli) * [host-listener](#host-listener) * [gw-listener](#gw-listener) * [sns-worker](#sns-worker) * [zkproof-worker](#zkproof-worker) * [transaction-sender](#transaction-sender) * [Resources](#resources) * [Documentation](#documentation) * [FHEVM Demo](#fhevm-demo) * [Support](#support) ### Getting started #### Generating keys For testing purposes a set of keys can be generated as follows: ``` $ cd fhevm-engine/fhevm-engine-common $ cargo run generate-keys ``` The keys are stored by default in `fhevm-engine/fhevm-keys`. #### Coprocessor **Dependences** * `docker-compose` * `rust` * `sqlx-cli` (install with `cargo install sqlx-cli`) * `anvil` (for testing, installation manual <https://book.getfoundry.sh/getting-started/installation>) **Installation** ``` $ cd fhevm-engine/coprocessor $ cargo install --path . ``` **Services Configuration** **tfhe-worker** ```bash $ tfhe_worker --help Usage: tfhe_worker [OPTIONS] Options: --run-server Run the API server --run-bg-worker Run the background worker --generate-fhe-keys Generate fhe keys and exit --server-maximum-ciphertexts-to-schedule <SERVER_MAXIMUM_CIPHERTEXTS_TO_SCHEDULE> Server maximum ciphertexts to schedule per batch [default: 5000] --server-maximum-ciphertexts-to-get <SERVER_MAXIMUM_CIPHERTEXTS_TO_GET> Server maximum ciphertexts to serve on get_cihpertexts endpoint [default: 5000] --work-items-batch-size <WORK_ITEMS_BATCH_SIZE> Work items batch size [default: 10] --tenant-key-cache-size <TENANT_KEY_CACHE_SIZE> Tenant key cache size [default: 32] --maximimum-compact-inputs-upload <MAXIMIMUM_COMPACT_INPUTS_UPLOAD> Maximum compact inputs to upload [default: 10] --maximum-handles-per-input <MAXIMUM_HANDLES_PER_INPUT> Maximum compact inputs to upload [default: 255] --coprocessor-fhe-threads <COPROCESSOR_FHE_THREADS> Coprocessor FHE processing threads [default: 8] --tokio-threads <TOKIO_THREADS> Tokio Async IO threads [default: 4] --pg-pool-max-connections <PG_POOL_MAX_CONNECTIONS> Postgres pool max connections [default: 10] --server-addr <SERVER_ADDR> Server socket address [default: 127.0.0.1:50051] --metrics-addr <METRICS_ADDR> Prometheus metrics server address [default: 0.0.0.0:9100] --database-url <DATABASE_URL> Postgres database url. If unspecified DATABASE_URL environment variable is used --coprocessor-private-key <COPROCESSOR_PRIVATE_KEY> Coprocessor private key file path. Private key is in plain text 0x1234.. format [default: ./coprocessor.key] ``` ```bash $ cli --help Usage: cli <COMMAND> Commands: insert-tenant Inserts tenant into specified database smoke-test Coprocessor smoke test help Print this message or the help of the given subcommand(s) Options: -h, --help Print help -V, --version Print version ``` For more details on configuration, please check [Coprocessor Configuration](/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/fhevm/coprocessor/configuration) **host-listener** ```bash $ host_listener --help Usage: host_listener [OPTIONS] Options: --url <URL> [default: ws://0.0.0.0:8746] --ignore-tfhe-events --ignore-acl-events --acl-contract-address <ACL_CONTRACT_ADDRESS> --tfhe-contract-address <TFHE_CONTRACT_ADDRESS> --database-url <DATABASE_URL> --start-at-block <START_AT_BLOCK> Can be negative from last block --end-at-block <END_AT_BLOCK> -h, --help Print help -V, --version Print version ``` **gw-listener** ```bash $ gw_listener --help Usage: gw_listener [OPTIONS] --gw-url <GW_URL> --input-verification-address <INPUT_VERIFICATION_ADDRESS> --kms-generation-address <KMS_GENERATION_ADDRESS> Options: --database-url <DATABASE_URL> --database-pool-size <DATABASE_POOL_SIZE> [default: 16] --verify-proof-req-database-channel <VERIFY_PROOF_REQ_DATABASE_CHANNEL> [default: event_zkpok_new_work] --gw-url <GW_URL> -i, --input-verification-address <INPUT_VERIFICATION_ADDRESS> --kms-generation-address <KMS_GENERATION_ADDRESS> --error-sleep-initial-secs <ERROR_SLEEP_INITIAL_SECS> [default: 1] --error-sleep-max-secs <ERROR_SLEEP_MAX_SECS> [default: 10] --health-check-port <HEALTH_CHECK_PORT> [default: 8080] --metrics-addr <METRICS_ADDR> Prometheus metrics server address [default: 0.0.0.0:9100] --health-check-timeout <HEALTH_CHECK_TIMEOUT> [default: 4s] --provider-max-retries <PROVIDER_MAX_RETRIES> [default: 4294967295] --provider-retry-interval <PROVIDER_RETRY_INTERVAL> [default: 4s] --log-level <LOG_LEVEL> [default: INFO] --host-chain-id <HOST_CHAIN_ID> --get-logs-poll-interval <GET_LOGS_POLL_INTERVAL> [default: 1s] --get-logs-block-batch-size <GET_LOGS_BLOCK_BATCH_SIZE> [default: 100] --service-name <SERVICE_NAME> gw-listener service name in OTLP traces [default: gw-listener] --catchup-kms-generation-from-block <CATCHUP_KMS_GENERATION_FROM_BLOCK> Can be negative from last processed block -h, --help Print help -V, --version Print version ``` **transaction-sender** ```bash $ transaction_sender --help Usage: transaction_sender [OPTIONS] --input-verification-address <INPUT_VERIFICATION_ADDRESS> --ciphertext-commits-address <CIPHERTEXT_COMMITS_ADDRESS> --multichain-acl-address <MULTICHAIN_ACL_ADDRESS> --gateway-url <GATEWAY_URL> Options: -i, --input-verification-address <INPUT_VERIFICATION_ADDRESS> -c, --ciphertext-commits-address <CIPHERTEXT_COMMITS_ADDRESS> -m, --multichain-acl-address <MULTICHAIN_ACL_ADDRESS> -g, --gateway-url <GATEWAY_URL> -s, --signer-type <SIGNER_TYPE> [default: private-key] [possible values: private-key, aws-kms] -p, --private-key <PRIVATE_KEY> -d, --database-url <DATABASE_URL> --database-pool-size <DATABASE_POOL_SIZE> [default: 10] --database-polling-interval-secs <DATABASE_POLLING_INTERVAL_SECS> [default: 1] --verify-proof-resp-database-channel <VERIFY_PROOF_RESP_DATABASE_CHANNEL> [default: event_zkpok_computed] --add-ciphertexts-database-channel <ADD_CIPHERTEXTS_DATABASE_CHANNEL> [default: event_ciphertexts_uploaded] --allow-handle-database-channel <ALLOW_HANDLE_DATABASE_CHANNEL> [default: event_allowed_handle] --verify-proof-resp-batch-limit <VERIFY_PROOF_RESP_BATCH_LIMIT> [default: 128] --verify-proof-resp-max-retries <VERIFY_PROOF_RESP_MAX_RETRIES> [default: 6] --verify-proof-remove-after-max-retries --add-ciphertexts-batch-limit <ADD_CIPHERTEXTS_BATCH_LIMIT> [default: 10] --allow-handle-batch-limit <ALLOW_HANDLE_BATCH_LIMIT> [default: 10] --allow-handle-max-retries <ALLOW_HANDLE_MAX_RETRIES> [default: 2147483647] --add-ciphertexts-max-retries <ADD_CIPHERTEXTS_MAX_RETRIES> [default: 2147483647] --error-sleep-initial-secs <ERROR_SLEEP_INITIAL_SECS> [default: 1] --error-sleep-max-secs <ERROR_SLEEP_MAX_SECS> [default: 300] --txn-receipt-timeout-secs <TXN_RECEIPT_TIMEOUT_SECS> [default: 10] --required-txn-confirmations <REQUIRED_TXN_CONFIRMATIONS> [default: 0] --review-after-unlimited-retries <REVIEW_AFTER_UNLIMITED_RETRIES> [default: 30] --provider-max-retries <PROVIDER_MAX_RETRIES> [default: 4294967295] --provider-retry-interval <PROVIDER_RETRY_INTERVAL> [default: 4s] --health-check-port <HEALTH_CHECK_PORT> [default: 8080] --metrics-addr <METRICS_ADDR> Prometheus metrics server address [default: 0.0.0.0:9100] --health-check-timeout <HEALTH_CHECK_TIMEOUT> [default: 4s] --log-level <LOG_LEVEL> [default: INFO] --gas-limit-overprovision-percent <GAS_LIMIT_OVERPROVISION_PERCENT> [default: 120] --graceful-shutdown-timeout <GRACEFUL_SHUTDOWN_TIMEOUT> [default: 8s] --service-name <SERVICE_NAME> service name in OTLP traces [default: txn-sender] --metric-host-txn-latency <METRIC_HOST_TXN_LATENCY> Prometheus metrics: coprocessor_host_txn_latency_seconds [default: 0.1:60.0:0.1] --metric-zkproof-txn-latency <METRIC_ZKPROOF_TXN_LATENCY> Prometheus metrics: coprocessor_zkproof_txn_latency_seconds [default: 0.1:60.0:0.1] -h, --help Print help -V, --version Print version ``` When using the `private-key` signer type, the `-p, --private-key <PRIVATE_KEY>` option becomes mandatory. When using the `aws-kms` signer type, standard `AWS_*` environment variables are supported, e.g.: * **AWS\_REGION** * **AWS\_ACCESS\_KEY\_ID** (i.e. username) * **AWS\_SECRET\_ACCESS\_KEY** (i.e. password) * etc. ### Resources #### Documentation Full, comprehensive documentation is available here: <https://docs.zama.ai/fhevm>. #### FHEVM Demo A complete demo showcasing an integrated FHEVM blockchain and KMS (Key Management System) is available here: <https://github.com/zama-ai/fhevm-test-suite/>. ### Support 🌟 If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development. [![GitHub stars](https://img.shields.io/github/stars/zama-ai/fhevm?style=social)](https://github.com/zama-ai/fhevm/) # Welcome to FHEVM backend The FHEVM backend allows users to run their own L1 or coprocessor with FHEVM technology. It enables confidential smart contracts on the EVM using FHE. ## Get started Learn the basics of FHEVM backend, set it up, and make it run with ease. <table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Quick start</strong></td><td>Understand the basic concepts of FHEVM library.</td><td><a href="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-ef8d6303f852601e203cdfd9fa6bbdd4a47d8c96%2Fstart1.png?alt=media">start1.png</a></td><td><a href="/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/quick_start">Quick start</a></td></tr><tr><td><strong>geth FHEVM-native integration</strong></td><td>Use FHEVM-native with go-ethereum</td><td><a href="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-2398466c2caf6bc932ee2b607ce742ff2c5275b2%2Fstart4.png?alt=media">start4.png</a></td><td><a href="/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/fhevm/native/geth">Integration</a></td></tr><tr><td><strong>geth FHEVM-coprocessor integration</strong></td><td>Use FHEVM-coprocessor with go-ethereum</td><td><a href="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-2398466c2caf6bc932ee2b607ce742ff2c5275b2%2Fstart4.png?alt=media">start4.png</a></td><td><a href="https://github.com/zama-ai/fhevm/blob/release/0.10.x/coprocessor/docs/getting_started/fhevm/coprocessor/geth.md">https://github.com/zama-ai/fhevm/blob/release/0.10.x/coprocessor/docs/getting_started/fhevm/coprocessor/geth.md</a></td></tr><tr><td><strong>Setup a Gateway</strong></td><td>Configure a Gateway to handle decryption and reencryption</td><td><a href="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-794ee2f6e7160affe67c2b1aca1caae1559c9537%2Fstart2.png?alt=media">start2.png</a></td><td><a href="/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/gateway/configuration">Configuration</a></td></tr><tr><td><strong>Use TKMS</strong></td><td>Use Zama's TKMS with FHEVM</td><td><a href="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-c5bc387a4467dacbcd0ec5f9a381ba765128cd15%2Fstart5.png?alt=media">start5.png</a></td><td><a href="/protocol/solidity-guides/v0.10/coprocessor/docs/getting_started/tkms/zama">Use Zama's TKMS</a></td></tr></tbody></table> ### References Refer to the API and access additional resources for in-depth explanations while working with FHEVM. * [FHEVM API specifications](/protocol/solidity-guides/v0.10/coprocessor/docs/references/fhevm_api) * [Gateway API specifications](/protocol/solidity-guides/v0.10/coprocessor/docs/references/gateway_api) ### Supports Ask technical questions and discuss with the community. Our team of experts usually answers within 24 hours in working days. * [Community forum](https://community.zama.ai/c/fhevm/15) * [Discord channel](https://discord.com/invite/zama) * [Telegram](https://t.me/+Ojt5y-I7oR42MTkx) ### Developers Collaborate with us to advance the FHE spaces and drive innovation together. * [Contribute to FHEVM](/protocol/solidity-guides/v0.10/coprocessor/docs/developer/contribute) * [Follow the development roadmap](/protocol/soli
프로젝트로 돌아가기