Zama 백서

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

mstances. * **Recommendation**: alarm on any failures over a 1 minute period, i.e. `increase(counter[1m]) > 0`. #### Metric Name: `coprocessor_gw_listener_activate_key_success_counter` * **Type**: Counter * **Description**: Counts the number of successful activate key requests in GW listener. * **Alarm**: N/A - no alarm needed as activate key is an infrequent event. #### Metric Name: `coprocessor_gw_listener_activate_key_fail_counter` * **Type**: Counter * **Description**: Counts the number of failed activate key requests in GW listener. * **Alarm**: If the counter increases from 0. Activate key is an important event that should not fail. * **Recommendation**: alarm on any failures over a 1 minute period, i.e. `increase(counter[1m]) > 0`. #### Metric Name: `coprocessor_gw_listener_key_digest_mismatch_counter` * **Type**: Counter * **Description**: Counts the number of key digest mismatches in GW listener. * **Alarm**: If the counter increases from 0. Key digest mismatch is not something that is supposed to happen in normal circumstances. * **Recommendation**: alarm on any failures over a 1 minute period, i.e. `increase(counter[1m]) > 0`. ### zkproof-worker Metrics for zkproof-worker are to be added in future releases, if/when needed. Currently, the transaction-sender handles ZK proof related metrics, please see its section. ### sns-worker #### Metric Name: `coprocessor_sns_worker_task_execute_success_counter` * **Type**: Counter * **Description**: Counts tasks executed by sns-worker successfully. * **Alarm**: If the counter is a flat line over a period of time. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter[1m]) == 0`. #### Metric Name: `coprocessor_sns_worker_task_execute_failure_counter` * **Type**: Counter * **Description**: Counts tasks errors in sns-worker. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 240 failures in 1 minute, i.e. `increase(counter[1m]) > 240`. #### Metric Name: `coprocessor_sns_worker_aws_upload_success_counter` * **Type**: Counter * **Description**: Counts AWS uploads by sns-worker. * **Alarm**: If the counter is a flat line over a period of time. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter[1m]) == 0`. #### Metric Name: `coprocessor_sns_worker_aws_upload_failure_counter` * **Type**: Counter * **Description**: Counts AWS upload errors in sns-worker. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 240 failures in 1 minute, i.e. `increase(counter[1m]) > 240`. #### Metric Name: `coprocessor_sns_worker_uncomplete_tasks_gauge` * **Type**: Gauge * **Description**: Tracks the number of uncomplete tasks in sns-worker. * **Alarm**: If the gauge value exceeds a predefined threshold. * **Recommendation**: more than 100 uncomplete over 2 minutes, i.e. `min_over_time(gauge[2m]) > 100`. #### Metric Name: `coprocessor_sns_worker_uncomplete_aws_uploads_gauge` * **Type**: Gauge * **Description**: Tracks the number of uncomplete AWS uploads in sns-worker. * **Alarm**: If the gauge value exceeds a predefined threshold. * **Recommendation**: more than 100 uncomplete over 2 minutes, i.e. `min_over_time(gauge[2m]) > 100`. ### tfhe-worker #### Metric Name: `coprocessor_worker_errors` * **Type**: Counter * **Description**: Counts TFHE worker errors. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 240 failures in 1 minute, i.e. `increase(counter[1m]) > 240`. #### Metric Name: `coprocessor_work_items_polls` * **Type**: Counter * **Description**: Counts work items polled from the database. * **Alarm**: N/A - if work usually arrives via notifications, polling is expected to be low. #### Metric Name: `coprocessor_work_items_notifications` * **Type**: Counter * **Description**: Counts the number of instant notifications for work items received from the DB. * **Alarm**: If the counter is a flat line over a period of time. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter[1m]) == 0`. #### Metric Name: `coprocessor_work_items_found` * **Type**: Counter * **Description**: Counts of work items queried from the DB. * **Alarm**: If the counter is a flat line over a period of time. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter[1m]) == 0`. #### Metric Name: `coprocessor_work_items_processed` * **Type**: Counter * **Description**: Counts of work items successfully processed and stored in the DB. * **Alarm**: If the counter is a flat line over a period of time. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter[1m]) == 0`. ## kms-connector ### gw-listener #### Metric Name: `kms_connector_gw_listener_event_received_counter` * **Type**: Counter * **Labels**: * `event_type`: can be used to filter by event type (public\_decryption\_request, user\_decryption\_request, crsgen\_request, ...). * **Description**: Counts the number of events received by the GW listener. * **Alarm**: If the counter is a flat line over a period of time, only for `event_type` `public_decryption_request` and `user_decryption_request`. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter{event_type="..."}[1m]) == 0`. #### Metric Name: `kms_connector_gw_listener_event_received_errors` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Counts the number of errors encountered by the GW listener while receiving events. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. ### kms-worker #### Metric Name: `kms_connector_worker_event_received_counter` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Counts the number of events received by the KMS worker. * **Alarm**: If the counter is a flat line over a period of time, only for `event_type` `public_decryption_request` and `user_decryption_request`. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter{event_type="..."}[1m]) == 0`. #### Metric Name: `kms_connector_worker_event_received_errors` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Counts the number of errors encountered while listening for events in the KMS worker. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. #### Metric Name: `kms_connector_worker_grpc_request_sent_counter` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Number of successful GRPC requests sent by the KMS worker to the KMS Core, * **Alarm**: If the counter is a flat line over a period of time, only for `event_type` `public_decryption_request` and `user_decryption_request`. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter{event_type="..."}[1m]) == 0`. #### Metric Name: `kms_connector_worker_grpc_request_sent_errors` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Counts the number of errors encountered by the KMS worker while sending grpc requests to the KMS Core. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. #### Metric Name: `kms_connector_worker_grpc_response_polled_counter` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Counts the number of responses successfully polled from the KMS Core via GRPC. * **Alarm**: If the counter is a flat line over a period of time, only for `event_type` `public_decryption_request` and `user_decryption_request`. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter{event_type="..."}[1m]) == 0`. #### Metric Name: `kms_connector_worker_grpc_response_polled_errors` * **Type**: Counter * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) * **Description**: Counts the number of errors encountered by the KMS worker while polling responses from the KMS Core. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. #### Metric Name: `kms_connector_worker_s3_ciphertext_retrieval_counter` * **Type**: Counter * **Description**: Counts the number of ciphertexts retrieved by the KMS worker from S3. * **Alarm**: If the counter is a flat line over a period of time. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter[1m]) == 0`. #### Metric Name: `kms_connector_worker_s3_ciphertext_retrieval_errors` * **Type**: Counter * **Description**: Counts the number of errors encountered by the KMS worker while retrieving ciphertexts from S3. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. ### tx-sender #### Metric Name: `kms_connector_tx_sender_response_received_counter` * **Type**: Counter * **Labels**: * `response_type`: can be used to filter by response type (public\_decryption\_response, user\_decryption\_response, crsgen\_response, ...). * **Description**: Counts the number of responses received by the TX sender. * **Alarm**: If the counter is a flat line over a period of time, only for `response_type` `public_decryption_response` and `user_decryption_response`. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter{response_type = "..."}[1m]) == 0`. #### Metric Name: `kms_connector_tx_sender_response_received_errors` * **Type**: Counter * **Labels**: * `response_type`: see [description](#metric-name-kms_connector_tx_sender_response_received_counter) * **Description**: Counts the number of errors encountered by the TX sender while listening for responses. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. #### Metric Name: `kms_connector_tx_sender_gateway_tx_sent_counter` * **Type**: Counter * **Labels**: * `response_type`: see [description](#metric-name-kms_connector_tx_sender_response_received_counter) * **Description**: Counts the number of transactions sent to the Gateway by the TX sender. * **Alarm**: If the counter is a flat line over a period of time, only for `response_type` `public_decryption_response` and `user_decryption_response`. * **Recommendation**: 0 for more than 1 minute, i.e. `increase(counter{response_type = "..."}[1m]) == 0`. #### Metric Name: `kms_connector_tx_sender_gateway_tx_sent_errors` * **Type**: Counter * **Labels**: * `response_type`: see [description](#metric-name-kms_connector_tx_sender_response_received_counter) * **Description**: Counts the number of errors encountered by the TX sender while sending transactions to the Gateway. * **Alarm**: If the counter increases over a period of time. * **Recommendation**: more than 60 failures in 1 minute, i.e. `sum(increase(counter[1m])) > 60`. #### Metric Name: `kms_connector_pending_events` * **Type**: Gauge * **Labels**: * `event_type`: see [description](#metric-name-kms_connector_gw_listener_event_received_counter) (only available for decryption right now!) * **Description**: Tracks the number of Gateway events not yet processed in the kms-connector's DB. * **Alarm**: Need more experience with this metric first. #### Metric Name: `kms_connector_pending_responses` * **Type**: Gauge * **Labels**: * `response_type`: see [description](#metric-name-kms_connector_tx_sender_response_received_counter) (only available for decryption right now!) * **Description**: Tracks the number of KMS responses not yet sent to the Gateway in the kms-connector's DB. * **Alarm**: Need more experience with this metric first. # operators # operators-overview Add an overview for this tab Example: <https://docs.starknet.io/> # Welcome **Welcome to the Zama Confidential Blockchain Protocol Docs.**\ The docs aim to guide you to build confidential dApps on top of any L1 or L2 using Fully Homomorphic Encryption (FHE). ## Where to go next If you're completely new to FHE or the Zama Protocol, we suggest first checking out the [Litepaper](https://docs.zama.ai/protocol/zama-protocol-litepaper), which offers a thorough overview of the protocol. Otherwise: 🟨 Go to [**Quick Start**](https://docs.zama.ai/protocol/solidity-guides/getting-started/quick-start-tutorial) to learn how to write your first confidential smart contract using FHEVM. 🟨 Go to [**Solidity Guides**](https://docs.zama.ai/protocol/solidity-guides) to explore how encrypted types, operations, ACLs, and other core features work in practice. 🟨 Go to [**Relayer SDK Guides**](https://docs.zama.ai/protocol/relayer-sdk-guides) to build a frontend that can encrypt, decrypt, and interact securely with the blockchain. 🟨 Go to [**FHE on Blockchain**](/protocol/solidity-guides/v0.10/docs/protocol/architecture/overview) to learn the architecture in depth and understand how encrypted computation flows through both on-chain and off-chain components. 🟨 Go to [**Examples**](https://docs.zama.ai/protocol/examples) to find reference and inspiration from smart contract examples and dApp examples. {% hint style="warning" %} The Zama Protocol Testnet is not audited and is not intended for production use. **Do not publish any critical or sensitive data**. For production workloads, please wait for the Mainnet release. {% endhint %} ## Help center Ask technical questions and discuss with the community. * [Community forum](https://community.zama.ai/c/fhevm/15) * [Discord channel](https://discord.com/invite/zama) # Table of contents * [Welcome](/protocol/solidity-guides/v0.10/docs/protocol) ## Protocol * [FHE on blockchain](/protocol/solidity-guides/v0.10/docs/protocol/architecture/overview) * [FHE library](/protocol/solidity-guides/v0.10/docs/protocol/architecture/library) * [Host contracts](/protocol/solidity-guides/v0.10/docs/protocol/architecture/hostchain) * [Coprocessor](/protocol/solidity-guides/v0.10/docs/protocol/architecture/coprocessor) * [Gateway](/protocol/solidity-guides/v0.10/docs/protocol/architecture/gateway) * [KMS](/protocol/solidity-guides/v0.10/docs/protocol/architecture/kms) * [Relayer & Oracle](/protocol/solidity-guides/v0.10/docs/protocol/architecture/relayer_oracle) * [Roadmap](/protocol/solidity-guides/v0.10/docs/protocol/roadmap) ## Developer * [Change Log](https://docs.zama.ai/change-log) * [Confidential contracts by OpenZeppelin](https://docs.zama.ai/protocol/examples/openzeppelin-confidential-contracts/) * [Feature request](https://github.com/zama-ai/fhevm/issues/new?assignees=\&labels=enhancement\&projects=\&template=feature-request.md\&title=) * [Bug report](https://github.com/zama-ai/fhevm/issues/new?assignees=\&labels=bug\&projects=\&template=bug_report_fhevm.md\&title=) * [Status](https://status.zama.ai/) * [White paper](https://github.com/zama-ai/fhevm/blob/main/fhevm-whitepaper.pdf) * [Release note](https://github.com/zama-ai/fhevm/releases) * [Previous docs (v0.6)](https://docs.zama.ai/fhevm/0.6) * [Contributing](/protocol/solidity-guides/v0.10/docs/protocol/contribute) # Contributing There are two ways to contribute to FHEVM: * [Open issues](https://github.com/zama-ai/fhevm/issues/new/choose) to report bugs and typos, or to suggest new ideas * Request to become an official contributor by emailing <hello@zama.ai>. Becoming an approved contributor involves signing our Contributor License Agreement (CLA). Only approved contributors can send pull requests, so please make sure to get in touch before you do! ## Zama Bounty Program Solve challenges and earn rewards: * [bounty-program](https://github.com/zama-ai/bounty-program) - Zama's FHE Bounty Program # Encryption, decryption, and computation This section introduces the core cryptographic operations in the FHEVM system, covering how data is encrypted, processed, and decrypted — while ensuring complete confidentiality through Fully Homomorphic Encryption (FHE). The architecture enforces end-to-end encryption, coordinating key flows across the frontend, smart contracts, coprocessors, and a secure Key Management System (KMS) operated via threshold MPC. ## **FHE keys and their locations** 1. **Public Key**: * **Location**: Exposed via frontend SDK. * **Role**: Encrypts user inputs before any interaction with the blockchain. 2. **Private Key**: * **Location**: Secured in the Key Management System (KMS) using threshold MPC. * **Role**: Used to decrypt data when necessary — such as to reveal plaintext to users or smart contracts. 3. **Evaluation Key**: * **Location**: Hosted on coprocessors. * **Role**: Usage: Enables encrypted computation without decrypting any data. <figure><img src="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-4ea10430a9e117c89e129620a77db4bebdc478ba%2Farchitecture.png?alt=media" alt="FHE Keys Overview"><figcaption><p>High level overview of the FHEVM Architecture</p></figcaption></figure> ## **Workflow: encryption, decryption, and processing** ### **Encryption** Encryption is the starting point for any interaction with the FHEVM system, ensuring that data is protected before it is transmitted or processed. * **How It Works**: 1. The frontend or client application uses the public key to encrypt user-provided plaintext inputs and generates a proof of knowledge of the underlying plaintexts. 2. The resulting ciphertext and proof are submitted to the Gateway for verification. 3. Coprocessors validate the proof and store the ciphertext off-chain, returning handles and signature that can be used as on-chain parameters. * **Data Flow**: * **Source**: Frontend. * **Destination**: Coprocessor (for processing). <figure><img src="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-88b4d1a675821ee6a0edc0c19d73da3e17e39dca%2Fencrypt.png?alt=media" alt="decryption" width="600"><figcaption></figcaption></figure> You can read about the implementation details in [our encryption guide](https://github.com/zama-ai/fhevm/blob/release/0.10.x/docs/protocol/solidity-guides/inputs.md). ### **Computation** Encrypted computations are performed using the **evaluation key** on the coprocessor. * **How it works**: 1. The smart contract emits FHE operation events as symbolic instructions. 2. These events are picked up by the coprocessor, which evaluates each operation individually using the evaluation key, without ever decrypting the data. 3. The resulting ciphertext is persisted in the coprocessor database, while only a handle is returned on-chain. * **Data flow**: * **Source**: Blockchain smart contracts (via symbolic execution). * **Processing**: Coprocessor (using the evaluation key). * **Destination**: Blockchain (updated ciphertexts). <figure><img src="https://2354183879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSoe8yNdsakWMG6E3ITL%2Fuploads%2Fgit-blob-47df1f612cde5bd0b7c5505c4eb6dcfc17b2c6d9%2Fcomputation.png?alt=media" alt="computation"><figcaption></figcaption></figure> ### **Decryption** There are two kinds of decryption supported in the FHEVM system: 1. Public Decryption used when plaintext is needed on-chain. 1. The con
프로젝트로 돌아가기