[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-LatticeX-Foundation--Rosetta":3,"tool-LatticeX-Foundation--Rosetta":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",157379,2,"2026-04-15T23:32:42",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":107,"forks":108,"last_commit_at":109,"license":110,"difficulty_score":111,"env_os":112,"env_gpu":113,"env_ram":114,"env_deps":115,"category_tags":120,"github_topics":121,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":128,"updated_at":129,"faqs":130,"releases":165},8007,"LatticeX-Foundation\u002FRosetta","Rosetta","A Privacy-Preserving Framework Based on TensorFlow","Rosetta 是一个基于 TensorFlow 构建的隐私保护框架，旨在让人工智能模型在训练和推理过程中无需暴露原始数据。它巧妙融合了安全多方计算、联邦学习以及可信执行环境等主流隐私技术，让开发者无需具备深厚的密码学背景，也能轻松实现数据隐私保护。\n\nRosetta 主要解决了数据孤岛与隐私合规之间的矛盾。在传统模式下，多方协作建模往往面临数据无法共享的难题，而 Rosetta 允许各方在不泄露本地私有数据的前提下完成联合计算。其最大的亮点在于极高的易用性：用户只需在现有的 TensorFlow 代码中引入 `import latticex.rosetta`，即可将传统机器学习任务无缝转换为隐私保护模式，几乎无需修改原有逻辑。\n\n技术上，Rosetta 集成了 SecureNN 和 Helix 等安全协议，支持三方半诚实模型下的安全计算，并引入了高效的 Mystique 零知识证明协议，能够胜任如 ResNet 等复杂模型的隐私推理任务。\n\n这款工具非常适合人工智能开发者、数据科学家以及隐私计算研究人员使用。如果你希望在 Ubuntu 环境下，利用现有的 TensorFlow 技能快","Rosetta 是一个基于 TensorFlow 构建的隐私保护框架，旨在让人工智能模型在训练和推理过程中无需暴露原始数据。它巧妙融合了安全多方计算、联邦学习以及可信执行环境等主流隐私技术，让开发者无需具备深厚的密码学背景，也能轻松实现数据隐私保护。\n\nRosetta 主要解决了数据孤岛与隐私合规之间的矛盾。在传统模式下，多方协作建模往往面临数据无法共享的难题，而 Rosetta 允许各方在不泄露本地私有数据的前提下完成联合计算。其最大的亮点在于极高的易用性：用户只需在现有的 TensorFlow 代码中引入 `import latticex.rosetta`，即可将传统机器学习任务无缝转换为隐私保护模式，几乎无需修改原有逻辑。\n\n技术上，Rosetta 集成了 SecureNN 和 Helix 等安全协议，支持三方半诚实模型下的安全计算，并引入了高效的 Mystique 零知识证明协议，能够胜任如 ResNet 等复杂模型的隐私推理任务。\n\n这款工具非常适合人工智能开发者、数据科学家以及隐私计算研究人员使用。如果你希望在 Ubuntu 环境下，利用现有的 TensorFlow 技能快速搭建安全的分布式机器学习系统，Rosetta 将是一个高效且专业的选择。","![LOGO](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_a6591cd68f5a.png)\n\n[![github license](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-LGPLv3-blue.svg)](https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Flgpl-3.0.en.html)\n\n[![Build-and-Test](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fbuild-and-test.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fbuild-and-test.yml) [![Performance Test](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fperformance-test.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fperformance-test.yml)\n\n------\n\n[中文版](.\u002FREADME_CN.md)\n\n\n## Overview\n\nRosetta is a privacy-preserving framework based on [TensorFlow](https:\u002F\u002Fwww.tensorflow.org). It integrates with mainstream privacy-preserving computation technologies, including cryptography, federated learning and trusted execution environment. Rosetta aims to provide privacy-preserving solutions for artificial intelligence without requiring expertise in cryptography, federated learning and trusted execution environment. Rosetta reuses the APIs of TensorFlow and allows to transfer traditional TensorFlow codes into a privacy-preserving manner with minimal changes. E.g., just add the following line.\n\n```python\nimport latticex.rosetta\n```\n\nThe current version integrates the secure multi-party computation protocols for 3 parties. The underlying protocols are [SecureNN](https:\u002F\u002Feprint.iacr.org\u002F2018\u002F442.pdf) and Helix. They are secure in the semi-honest model with honest majority.\n\nRosetta has also integrated an efficient zero-knowledge proof protocol, [Mystique](https:\u002F\u002Feprint.iacr.org\u002F2021\u002F730), for secure inference tasks of sophisticated AI models, such as ResNet. Please refer to [example](example\u002Fzkp_resnet\u002FREADME.md) for its usage.\n\n\n## Installation\n\nFor now, Rosetta runs on Ubuntu 18.04, and is based on TensorFlow 1.14 with CPUs (Windows OS is not currently supported yet). You can install Rosetta as follows.\n\nFirst, please check that your local system meets our [base environment requirement](doc\u002FDEPLOYMENT.md#rosetta-deployment-guide).\n\nThen install the native TensorFlow with the following codes. Note that you could also install it from source code, check [here](doc\u002FTENSORFLOW_INSTALL.md) for details.\n\n```bash\n# install tensorflow\npip3 install tensorflow==1.14.0\n```\n\nAnd then build and install Rosetta with our all-in-one script as follows.\n\n```bash\n# clone rosetta git repository\ngit clone --recurse https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta.git\n\nor (Note: due to recent github change of personal token, SSH is still working, please refer to github for latest updates)\ngit clone git@github.com:LatticeX-Foundation\u002FRosetta.git\ngit submodule update --init --recursive\ncd Rosetta\n# compile, install. You may check more compilation options by checking `rosetta.sh --help`\n.\u002Frosetta.sh compile --enable-protocol-mpc-securenn; .\u002Frosetta.sh install\n```\n\nBefore running your program, you should configure with your network topology so that a distributed network can be established for parties to communicate with each other.\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_9ff8e7663811.png'  width = \"667\" height = \"400\" align=\"middle\"\u002F>\n\nYou could use an example to check everything runs OK. Please refer to [Deployment Guide](doc\u002FDEPLOYMENT.md) for the detailed steps of installation, configuration and deployment of Rosetta.\n\n## Usage\n\nThe following is a toy [example](example\u002Ftutorials\u002Fcode\u002Frosetta_demo.py) for matrix multiplication using Rosetta.\n\nIn this example, we assume that three guys want to get the product of their private matrix, while do not want others to know what they hold. For brevity, we call them P0, P1 and P2.\n\nWith Rosetta, each of them can run the following script, from which you can see that only a small amount of codes are needed besides the native TensorFlow lines.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\n# Import rosetta package\nimport latticex.rosetta as rtt\nimport tensorflow as tf\n\n# You can activate a backend protocol, here we use SecureNN\nrtt.activate(\"SecureNN\")\n\n# Get private data from every party\nmatrix_a = tf.Variable(rtt.private_console_input(0, shape=(3, 2)))\nmatrix_b = tf.Variable(rtt.private_console_input(1, shape=(2, 1)))\nmatrix_c = tf.Variable(rtt.private_console_input(2, shape=(1, 4)))\n\n# Just use the native tf.matmul operation.\ncipher_result = tf.matmul(tf.matmul(matrix_a, matrix_b), matrix_c)\n\n# Start execution\nwith tf.Session() as sess:\n    sess.run(tf.global_variables_initializer())\n    # Take a glance at the ciphertext\n    cipher_result = sess.run(cipher_result)\n    print('local ciphertext result:', cipher_result)\n    # Set only party a and c can get plain result\n    a_and_c_can_get_plain = 0b101 \n    # Get the result of Rosetta matmul\n    print('plaintext matmul result:', sess.run(rtt.SecureReveal(cipher_result, a_and_c_can_get_plain)))\n```\n\nTo run this jointly, after configuring networks, the three guys can run the following command-line respectively:\n\n```bash\npython rosetta_demo.py --party_id=0\n```\n\n,\n\n```bash\npython rosetta_demo.py --party_id=1\n```\n\nand\n\n```bash\npython rosetta_demo.py --party_id=2\n```\n\nThen each party will be prompted to input his private matrix, for example P0 may have:\n\n> 2021-10-22 09:46:08.571|info|Rosetta: Protocol [SecureNN] backend initialization succeeded! task: , node id: P0\n> \n> please input the private data (float or integer, 6 items, separated by space): 2 3 1 7 6 2\n\nwhile P1 has:\n\n> 2021-10-22 09:46:08.571|info|Rosetta: Protocol [SecureNN] backend initialization succeeded! task: , node id: P1\n>\n> please input the private data (float or integer, 2 items, separated by space): 1 2\n\nwhile P2 has:\n\n> 2021-10-22 09:46:08.571|info|Rosetta: Protocol [SecureNN] backend initialization succeeded! task: , node id: P2\n>\n> please input the private data (float or integer, 4 items, separated by space): 2 1 4 3\n\nNote that input from console like this is purely for pedagogical purpose in this toy example. See our [Doc](doc\u002FAPI_DOC.md) for production-ready data APIs.\n\nAt the end, P0 and P2 will get the plaintext output while P1 dose not, just as required. Specifically, P0 and P2 may have:\n\n> plaintext matmul result: [[b'16.000000' b'8.000000' b'32.000000' b'24.000000']\n>\n>  [b'30.000000' b'15.000000' b'60.000000' b'45.000000']\n>\n>  [b'20.000000' b'10.000000' b'40.000000' b'30.000000']]\n>\n> 2021-10-22 09:49:58.888|info|Rosetta: Protocol [SecureNN] backend has been released.\n\nwhile P1 has:\n\n> plaintext matmul result: [[b'0.000000' b'0.000000' b'0.000000' b'0.000000']\n>\n>  [b'0.000000' b'0.000000' b'0.000000' b'0.000000']\n>\n>  [b'0.000000' b'0.000000' b'0.000000' b'0.000000']]\n>\n> 2021-10-22 09:49:58.887|info|Rosetta: Protocol [SecureNN] backend has been released.\n\nThat's all, you can see Rosetta is so easy to use.\n\n\n\u003Cbr\u002F>\n\nSo, how to use ZKP in Rosetta quickly? Similar to MPC above, here is a simple [example](example\u002Ftutorials\u002Fcode\u002Frosetta_demo_zkp.py).\n\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\n# Import rosetta package\nimport latticex.rosetta as rtt\nimport tensorflow as tf\n\n# You can activate a backend protocol, here we use Mystique\nrtt.activate(\"Mystique\")\n\n# P0 is the Prover, providing all the witnesses(private), and\n# P1 is the Verifier\nmatrix_a = tf.Variable(rtt.private_console_input(0, shape=(3, 2)))\nmatrix_b = tf.Variable(rtt.private_console_input(0, shape=(2, 3)))\n\n# Just use the native tf.matmul operation.\ncipher_result = tf.matmul(matrix_a, matrix_b)\n\n# Start execution\nwith tf.Session() as sess:\n    sess.run(tf.global_variables_initializer())\n    # Take a glance at the ciphertext\n    cipher_result_v = sess.run(cipher_result)\n    print('local ciphertext result:', cipher_result_v)\n    # Get the result of Rosetta matmul\n    print('plaintext result:', sess.run(rtt.SecureReveal(cipher_result)))\n\nrtt.deactivate()\n```\n\nHere P0 is the Prover, providing all the witnesses(private), and the input is as follows:\n\n\n> 2021-10-22 18:12:46.629|info|Rosetta: Protocol [Mystique] backend initialization succeeded! task: , node id: P0\n> \n> 2021-10-22 18:12:46.629|info|create and activate ok. task:  for protocol: Mystique\n> \n> please input the private data (float or integer, 6 items, separated by space): 0 1 2 3 4 5\n> \n> please input the private data (float or integer, 6 items, separated by space): 5 4 3 2 1 0\n\n\nHere P1 is the Verifier, at the end, the verification is successful, and the plaintext result is output as follows:\n\n> 2021-10-22 18:13:12.860|info|succeed in verifying zk!!\n> \n> plaintext result: [[b'2.000000' b'1.000000' b'0.000000']\n> \n>  [b'16.000000' b'11.000000' b'6.000000']\n> \n>  [b'30.000000' b'21.000000' b'12.000000']]\n> \n> 2021-10-22 18:13:13.009|info|Rosetta: Protocol [Mystique] backend has been released.\n\n\u003Cbr\u002F>\n\nFor more details, please check [Tutorials](doc\u002FTUTORIALS.md) and [Examples](.\u002Fexample).\n\n> Note: Currently Rosetta already supports 128-bit integer data type, which can be enabled by configuring the environment variable `export ROSETTA_MPC_128=ON` and adding option `--enable-128bit` when compiling.\n\n## Getting Started\n\nTo help you start with your first workable program with Rosetta easily, our [Tutorials](doc\u002FTUTORIALS.md) will lead you to this fantastic world. In this detailed tutorials, we will assist you learn the basic concepts about Rosetta, then show you how to use the interfaces that we provide by easy-to-understand examples, and finally help you build a workable privacy-preserving machine learning model on real-world datasets.\n\nHopefully, this tutorial, and more other examples in [Examples](.\u002Fexample), will whet your appetite to dive in knowing more about this privacy-preserving framework.\n\n## How Rosetta Works\n\nRosetta works by extending and hacking both Python frontend and the Operation Kernels in backend of TensorFlow. It decouples the development of TensorFlow-related components and privacy technology so that both developers from AI and cryptography can focus on what they are interested.\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_9181bff22b44.png' width = \"700\" height = \"600\" align=\"middle\"\u002F>\n\nWhen running your Rosetta program, firstly the native TensorFlow data flow graph will be converted, and during this process the native Operations within the graph will be replaced with SecureOps.\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_470132f41f4f.png' width = \"800\" height = \"400\" align=\"middle\"\u002F>\n\nAnd at the second stage, the backend kernels of operations, implemented with specific cryptographic protocol, will be called to carry out underlying secure computation.\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_e912e1957439.png' width = \"800\" height = \"400\" align=\"middle\"\u002F>\n\n## Contributing to Rosetta\n\nRosetta is an open source project developed under the LPGLv3 license and maintained by [LatticeX Foundation](https:\u002F\u002Flatticex.foundation\u002F). Contributions from individuals and organizations are all welcome. Before beginning, please take a look at our [contributing guidelines](CONTRIBUTING.md). Our project adheres to [code of conduct](CODE_OF_CONDUCT.md). By participating in our community, you are expected to uphold this code. You could also open an issue by clicking [here](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002Fnew).\n\n## Documents List\n\n* [Rosetta Tutorials](doc\u002FTUTORIALS.md)\n\n* [Rosetta Deployment Guide](doc\u002FDEPLOYMENT.md)\n\n* [Rosetta User API](doc\u002FAPI_DOC.md)\n\n* [Rosetta WhitePaper](doc\u002FRosetta_whitepaper.pdf)\n\n* [Rosetta Glossary](doc\u002FGLOSSARY.md)\n\n* [Rosetta Release Notes](RELEASE.md)\n  \n* [FAQ](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fwiki\u002FFAQ)\n\n\n## Citation\n\nYou can cite our work as folllows:\n```latex \n    @misc{Rosetta,\n      author = {Yuanfeng Chen and Gaofeng Huang and Junjie Shi and Xiang Xie and Yilin Yan},\n      title = {{Rosetta: A Privacy-Preserving Framework Based on TensorFlow}},\n      howpublished = {\\url{https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta}},\n      year={2020}\n    }\n```\n\n## Reference\n\nCheck this [wiki page](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fwiki\u002FReference) for the reference.\n\n## Contact\n\nYou could reach us by [email](mailto:rosetta@latticex.foundation). **And you are welcome to join Rosetta community on [Slack](https:\u002F\u002Fjoin.slack.com\u002Ft\u002Flatticexrosetta\u002Fshared_invite\u002Fzt-dum6j65d-MTxp~Bxq5OwouJW8zUKB1Q) to ask any questions and discuss on any interesting topics with other developers**.\n\n## License\n\nThe Rosetta library is licensed under the [GNU Lesser General Public License v3.0](COPYING.LESSER).\n","![LOGO](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_a6591cd68f5a.png)\n\n[![github license](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-LGPLv3-blue.svg)](https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Flgpl-3.0.en.html)\n\n[![Build-and-Test](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fbuild-and-test.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fbuild-and-test.yml) [![Performance Test](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fperformance-test.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Factions\u002Fworkflows\u002Fperformance-test.yml)\n\n------\n\n[中文版](.\u002FREADME_CN.md)\n\n\n## 概述\n\nRosetta 是一个基于 [TensorFlow](https:\u002F\u002Fwww.tensorflow.org) 的隐私保护框架。它集成了主流的隐私保护计算技术，包括密码学、联邦学习和可信执行环境。Rosetta 的目标是在无需密码学、联邦学习和可信执行环境专业知识的情况下，为人工智能提供隐私保护解决方案。Rosetta 复用了 TensorFlow 的 API，并允许以最小的改动将传统的 TensorFlow 代码转换为隐私保护模式。例如，只需添加以下一行代码：\n\n```python\nimport latticex.rosetta\n```\n\n当前版本集成了针对三方的安全多方计算协议。底层协议是 [SecureNN](https:\u002F\u002Feprint.iacr.org\u002F2018\u002F442.pdf) 和 Helix，它们在诚实多数的半诚实模型下是安全的。\n\nRosetta 还集成了高效的零知识证明协议 [Mystique](https:\u002F\u002Feprint.iacr.org\u002F2021\u002F730)，用于复杂 AI 模型（如 ResNet）的安全推理任务。请参阅 [示例](example\u002Fzkp_resnet\u002FREADME.md) 了解其使用方法。\n\n\n## 安装\n\n目前，Rosetta 运行在 Ubuntu 18.04 上，并基于 TensorFlow 1.14 和 CPU 架构（暂不支持 Windows 操作系统）。您可以按照以下步骤安装 Rosetta。\n\n首先，请确保您的本地系统满足我们的 [基础环境要求](doc\u002FDEPLOYMENT.md#rosetta-deployment-guide)。\n\n然后，使用以下命令安装原生 TensorFlow。请注意，您也可以从源代码安装，详细信息请参阅 [此处](doc\u002FTENSORFLOW_INSTALL.md)。\n\n```bash\n# 安装 tensorflow\npip3 install tensorflow==1.14.0\n```\n\n接下来，使用我们的一体化脚本构建并安装 Rosetta，具体步骤如下：\n\n```bash\n# 克隆 rosetta git 仓库\ngit clone --recurse https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta.git\n\n或（注：由于近期 GitHub 对个人令牌的更改，SSH 方式仍然有效，请参考 GitHub 获取最新更新）\ngit clone git@github.com:LatticeX-Foundation\u002FRosetta.git\ngit submodule update --init --recursive\ncd Rosetta\n# 编译、安装。您可以通过运行 `rosetta.sh --help` 查看更多编译选项。\n.\u002Frosetta.sh compile --enable-protocol-mpc-securenn; .\u002Frosetta.sh install\n```\n\n在运行您的程序之前，您需要根据网络拓扑进行配置，以便建立分布式网络，使各方能够相互通信。\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_9ff8e7663811.png'  width = \"667\" height = \"400\" align=\"middle\"\u002F>\n\n您可以使用一个示例来检查一切是否正常运行。有关 Rosetta 的安装、配置和部署的详细步骤，请参阅 [部署指南](doc\u002FDEPLOYMENT.md)。\n\n## 使用\n\n以下是使用 Rosetta 进行矩阵乘法的一个简单 [示例](example\u002Ftutorials\u002Fcode\u002Frosetta_demo.py)。\n\n在这个示例中，我们假设三个人希望计算各自私有矩阵的乘积，但又不希望其他人知道他们持有的内容。为了简洁起见，我们将这三人分别称为 P0、P1 和 P2。\n\n借助 Rosetta，每个人都可以运行以下脚本，从中可以看出，除了原生 TensorFlow 的代码外，只需要少量额外的代码即可实现。\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\n# 导入 rosetta 包\nimport latticex.rosetta as rtt\nimport tensorflow as tf\n\n# 激活后端协议，这里我们使用 SecureNN\nrtt.activate(\"SecureNN\")\n\n# 从各方获取私有数据\nmatrix_a = tf.Variable(rtt.private_console_input(0, shape=(3, 2)))\nmatrix_b = tf.Variable(rtt.private_console_input(1, shape=(2, 1)))\nmatrix_c = tf.Variable(rtt.private_console_input(2, shape=(1, 4)))\n\n# 直接使用原生的 tf.matmul 操作。\ncipher_result = tf.matmul(tf.matmul(matrix_a, matrix_b), matrix_c)\n\n# 开始执行\nwith tf.Session() as sess:\n    sess.run(tf.global_variables_initializer())\n    # 查看密文结果\n    cipher_result = sess.run(cipher_result)\n    print('本地密文结果:', cipher_result)\n    # 设置只有 P0 和 P2 可以获得明文结果\n    a_and_c_can_get_plain = 0b101 \n    # 获取 Rosetta matmul 的结果\n    print('明文矩阵乘法结果:', sess.run(rtt.SecureReveal(cipher_result, a_and_c_can_get_plain)))\n```\n\n要联合运行此程序，在完成网络配置后，三个人可以分别运行以下命令行：\n\n```bash\npython rosetta_demo.py --party_id=0\n```\n\n、\n\n```bash\npython rosetta_demo.py --party_id=1\n```\n\n以及\n\n```bash\npython rosetta_demo.py --party_id=2\n```\n\n随后，每个参与者会被提示输入自己的私有矩阵。例如，P0 可能会收到：\n\n> 2021-10-22 09:46:08.571|info|Rosetta: 协议 [SecureNN] 后端初始化成功！任务：，节点 ID：P0\n>\n> 请输出私有数据（浮点数或整数，共 6 个，用空格分隔）：2 3 1 7 6 2\n\n而 P1 则会收到：\n\n> 2021-10-22 09:46:08.571|info|Rosetta: 协议 [SecureNN] 后端初始化成功！任务：，节点 ID：P1\n>\n> 请输出私有数据（浮点数或整数，共 2 个，用空格分隔）：1 2\n\nP2 则会收到：\n\n> 2021-10-22 09:46:08.571|info|Rosetta: 协议 [SecureNN] 后端初始化成功！任务：，节点 ID：P2\n>\n> 请输出私有数据（浮点数或整数，共 4 个，用空格分隔）：2 1 4 3\n\n需要注意的是，这种通过控制台输入的方式仅用于本示例的教学目的。有关生产级的数据 API，请参阅我们的 [文档](doc\u002FAPI_DOC.md)。\n\n最终，P0 和 P2 将获得明文输出，而 P1 则不会，正如预期的那样。具体来说，P0 和 P2 可能会看到：\n\n> 明文矩阵乘法结果：[[b'16.000000' b'8.000000' b'32.000000' b'24.000000']\n>\n>  [b'30.000000' b'15.000000' b'60.000000' b'45.000000']\n>\n>  [b'20.000000' b'10.000000' b'40.000000' b'30.000000']]\n>\n> 2021-10-22 09:49:58.888|info|Rosetta: 协议 [SecureNN] 后端已释放。\n\n而 P1 则会看到：\n\n> 明文矩阵乘法结果：[[b'0.000000' b'0.000000' b'0.000000' b'0.000000']\n>\n>  [b'0.000000' b'0.000000' b'0.000000' b'0.000000']\n>\n>  [b'0.000000' b'0.000000' b'0.000000' b'0.000000']]\n>\n> 2021-10-22 09:49:58.887|info|Rosetta: 协议 [SecureNN] 后端已释放。\n\n这就是全部内容，您可以看到 Rosetta 非常易于使用。\n\n\n\u003Cbr\u002F>\n\n那么，如何在 Rosetta 中快速使用 ZKP 呢？与上述 MPC 类似，这里有一个简单的 [示例](example\u002Ftutorials\u002Fcode\u002Frosetta_demo_zkp.py)。\n\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\n# 导入 Rosetta 包\nimport latticex.rosetta as rtt\nimport tensorflow as tf\n\n# 您可以激活一个后端协议，这里我们使用 Mystique\nrtt.activate(\"Mystique\")\n\n# P0 是证明者，提供所有见证数据（私密的），而\n# P1 是验证者\nmatrix_a = tf.Variable(rtt.private_console_input(0, shape=(3, 2)))\nmatrix_b = tf.Variable(rtt.private_console_input(0, shape=(2, 3)))\n\n# 直接使用原生的 tf.matmul 操作。\ncipher_result = tf.matmul(matrix_a, matrix_b)\n\n# 开始执行\nwith tf.Session() as sess:\n    sess.run(tf.global_variables_initializer())\n    # 查看密文结果\n    cipher_result_v = sess.run(cipher_result)\n    print('本地密文结果:', cipher_result_v)\n    # 获取 Rosetta matmul 的结果\n    print('明文结果:', sess.run(rtt.SecureReveal(cipher_result)))\n\nrtt.deactivate()\n```\n\n此处 P0 是证明者，负责提供所有见证数据（私密的），输入如下：\n\n\n> 2021-10-22 18:12:46.629|info|Rosetta: 协议 [Mystique] 后端初始化成功！任务：，节点 ID：P0\n> \n> 2021-10-22 18:12:46.629|info|创建并激活成功。任务：针对协议：Mystique\n> \n> 请录入私密数据（浮点数或整数，共6项，以空格分隔）：0 1 2 3 4 5\n> \n> 请录入私密数据（浮点数或整数，共6项，以空格分隔）：5 4 3 2 1 0\n\n\n此处 P1 是验证者，在最后验证成功，并输出明文结果如下：\n\n> 2021-10-22 18:13:12.860|info|zk 验证成功！！\n> \n> 明文结果：[[b'2.000000' b'1.000000' b'0.000000']\n> \n>  [b'16.000000' b'11.000000' b'6.000000']\n> \n>  [b'30.000000' b'21.000000' b'12.000000']]\n> \n> 2021-10-22 18:13:13.009|info|Rosetta: 协议 [Mystique] 后端已释放。\n\n\u003Cbr\u002F>\n\n更多详情，请查看 [教程](doc\u002FTUTORIALS.md) 和 [示例](.\u002Fexample)。\n\n> 注：目前 Rosetta 已支持 128 位整数数据类型，可通过设置环境变量 `export ROSETTA_MPC_128=ON` 并在编译时添加选项 `--enable-128bit` 来启用。\n\n## 入门指南\n\n为了帮助您轻松上手第一个可用的 Rosetta 程序，我们的 [教程](doc\u002FTUTORIALS.md) 将引领您进入这个精彩的世界。在这些详尽的教程中，我们将引导您学习 Rosetta 的基本概念，然后通过易于理解的示例向您展示如何使用我们提供的接口，最终帮助您在真实世界的数据集上构建一个可行的隐私保护机器学习模型。\n\n希望本教程以及 [示例](.\u002Fexample) 中的其他示例能够激发您进一步了解这一隐私保护框架的兴趣。\n\n## Rosetta 的工作原理\n\nRosetta 通过扩展和“黑客式”改造 TensorFlow 的 Python 前端和后端的操作内核来实现其功能。它将 TensorFlow 相关组件的开发与隐私技术分离，使人工智能和密码学领域的开发者都能专注于自己感兴趣的领域。\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_9181bff22b44.png' width = \"700\" height = \"600\" align=\"middle\"\u002F>\n\n当运行您的 Rosetta 程序时，首先会转换原生的 TensorFlow 数据流图，在此过程中，图中的原生操作会被替换为 SecureOps。\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_470132f41f4f.png' width = \"800\" height = \"400\" align=\"middle\"\u002F>\n\n随后，在第二阶段，会调用基于特定加密协议实现的操作后端内核，以执行底层的安全计算。\n\n\u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_readme_e912e1957439.png' width = \"800\" height = \"400\" align=\"middle\"\u002F>\n\n## 参与 Rosetta 的贡献\n\nRosetta 是一个在 LPGLv3 许可证下开发的开源项目，由 [LatticeX 基金会](https:\u002F\u002Flatticex.foundation\u002F) 维护。我们欢迎个人和组织的贡献。在开始之前，请先阅读我们的 [贡献指南](CONTRIBUTING.md)。我们的项目遵守 [行为准则](CODE_OF_CONDUCT.md)，参与社区的成员应遵守该准则。您也可以点击 [这里](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002Fnew) 提交问题。\n\n## 文档列表\n\n* [Rosetta 教程](doc\u002FTUTORIALS.md)\n\n* [Rosetta 部署指南](doc\u002FDEPLOYMENT.md)\n\n* [Rosetta 用户 API](doc\u002FAPI_DOC.md)\n\n* [Rosetta 白皮书](doc\u002FRosetta_whitepaper.pdf)\n\n* [Rosetta 术语表](doc\u002FGLOSSARY.md)\n\n* [Rosetta 发布说明](RELEASE.md)\n\n* [常见问题解答](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fwiki\u002FFAQ)\n\n\n## 引用\n\n您可以按以下方式引用我们的工作：\n```latex \n    @misc{Rosetta,\n      author = {Yuanfeng Chen 和 Gaofeng Huang 和 Junjie Shi 和 Xiang Xie 和 Yilin Yan},\n      title = {{Rosetta：基于 TensorFlow 的隐私保护框架}},\n      howpublished = {\\url{https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta}},\n      year={2020}\n    }\n```\n\n## 参考资料\n\n请参阅此 [维基页面](https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fwiki\u002FReference) 获取参考资料。\n\n## 联系方式\n\n您可以通过 [电子邮件](mailto:rosetta@latticex.foundation) 与我们联系。**欢迎您加入 Rosetta 社区的 [Slack](https:\u002F\u002Fjoin.slack.com\u002Ft\u002Flatticexrosetta\u002Fshared_invite\u002Fzt-dum6j65d-MTxp~Bxq5OwouJW8zUKB1Q) ，在这里您可以提出任何问题，并与其他开发者讨论感兴趣的话题**。\n\n## 许可证\n\nRosetta 库根据 [GNU 宽通用公共许可证 v3.0](COPYING.LESSER) 授权。","# Rosetta 快速上手指南\n\nRosetta 是一个基于 TensorFlow 的隐私保护框架，集成了安全多方计算（MPC）、联邦学习和可信执行环境等技术。它允许开发者通过极少的代码改动（仅需导入一个包），将传统的 TensorFlow 代码转换为隐私保护模式，无需深厚的密码学背景。\n\n## 1. 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Ubuntu 18.04（目前不支持 Windows）。\n*   **硬件架构**：CPU（支持 x86_64）。\n*   **Python 版本**：需兼容 TensorFlow 1.14 的 Python 环境（通常推荐 Python 3.6 或 3.7）。\n*   **前置依赖**：\n    *   Git\n    *   pip3\n    *   基础编译工具链 (gcc, g++, make 等)\n\n> **注意**：Rosetta 当前基于 TensorFlow 1.14.0 构建。\n\n## 2. 安装步骤\n\n### 第一步：安装原生 TensorFlow\n首先安装指定版本的 TensorFlow：\n\n```bash\npip3 install tensorflow==1.14.0\n```\n\n### 第二步：克隆代码库\n使用 Git 克隆 Rosetta 仓库及其子模块：\n\n```bash\n# 方式一：使用 HTTPS\ngit clone --recurse https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta.git\n\n# 方式二：使用 SSH (如果配置了 GitHub SSH Key)\n# git clone git@github.com:LatticeX-Foundation\u002FRosetta.git\n# cd Rosetta\n# git submodule update --init --recursive\n```\n\n### 第三步：编译与安装\n进入目录并使用官方提供的一键脚本进行编译和安装。默认启用 SecureNN 协议：\n\n```bash\ncd Rosetta\n\n# 编译并安装\n.\u002Frosetta.sh compile --enable-protocol-mpc-securenn\n.\u002Frosetta.sh install\n```\n\n> **提示**：如需支持 128 位整数数据类型，请在编译时添加 `--enable-128bit` 选项，并设置环境变量 `export ROSETTA_MPC_128=ON`。\n\n### 第四步：网络配置\nRosetta 需要多方参与通信。在运行程序前，需根据部署拓扑配置网络文件（如 `party.conf`），确保各参与方（Party）之间可以互相通信。详细配置请参考项目内的 `doc\u002FDEPLOYMENT.md`。\n\n## 3. 基本使用\n\nRosetta 的使用非常简便，只需导入 `latticex.rosetta` 并激活相应协议，即可复用 TensorFlow API 进行隐私计算。\n\n以下是一个最简单的**三方矩阵乘法**示例：假设 P0、P1、P2 三方各自持有私有矩阵，希望计算乘积但不泄露原始数据。\n\n### 代码示例 (`rosetta_demo.py`)\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\n# 导入 rosetta 包\nimport latticex.rosetta as rtt\nimport tensorflow as tf\n\n# 激活后端协议，此处使用 SecureNN\nrtt.activate(\"SecureNN\")\n\n# 获取各方的私有数据 (模拟从控制台输入)\n# shape 分别对应 (3, 2), (2, 1), (1, 4)\nmatrix_a = tf.Variable(rtt.private_console_input(0, shape=(3, 2)))\nmatrix_b = tf.Variable(rtt.private_console_input(1, shape=(2, 1)))\nmatrix_c = tf.Variable(rtt.private_console_input(2, shape=(1, 4)))\n\n# 直接使用原生的 tf.matmul 操作\ncipher_result = tf.matmul(tf.matmul(matrix_a, matrix_b), matrix_c)\n\n# 启动会话执行\nwith tf.Session() as sess:\n    sess.run(tf.global_variables_initializer())\n    \n    # 查看密态结果 (可选)\n    cipher_result_val = sess.run(cipher_result)\n    print('local ciphertext result:', cipher_result_val)\n    \n    # 设定只有 P0 (bit 0) 和 P2 (bit 2) 可以获取明文结果 (二进制 101 = 5)\n    a_and_c_can_get_plain = 0b101 \n    \n    # 解密并输出结果\n    print('plaintext matmul result:', sess.run(rtt.SecureReveal(cipher_result, a_and_c_can_get_plain)))\n```\n\n### 运行方法\n\n配置好网络后，三个参与方需在各自的终端分别运行以下命令（指定不同的 `party_id`）：\n\n**参与方 0 (P0):**\n```bash\npython rosetta_demo.py --party_id=0\n```\n\n**参与方 1 (P1):**\n```bash\npython rosetta_demo.py --party_id=1\n```\n\n**参与方 2 (P2):**\n```bash\npython rosetta_demo.py --party_id=2\n```\n\n### 运行效果\n1.  每个进程启动后，会提示输入私有数据（浮点数或整数，空格分隔）。\n2.  计算完成后，根据权限设置：\n    *   **P0 和 P2** 将看到正确的矩阵乘法明文结果。\n    *   **P1** 将看到全零结果（因为未被授权获取明文）。\n\n---\n*更多高级用法（如零知识证明 Mystique 协议）及详细教程，请参阅项目文档 `doc\u002FTUTORIALS.md` 和 `example` 目录。*","三家竞争医院的科研团队希望联合训练一个癌症预测模型，但受限于患者隐私法规，无法直接共享原始病历数据。\n\n### 没有 Rosetta 时\n- **开发门槛极高**：团队必须聘请密码学专家手动实现安全多方计算（MPC）协议，将普通的 TensorFlow 代码重写为复杂的加密逻辑。\n- **协作成本巨大**：各方需花费数周时间协商数据接口与通信协议，任何一方的代码变动都可能导致整个联合训练流程崩溃。\n- **合规风险难控**：在尝试联邦学习或可信执行环境时，难以确保中间梯度或参数不泄露敏感信息，面临巨大的法律合规隐患。\n- **模型迭代缓慢**：由于底层加密运算效率低下且调试困难，原本几天能完成的模型验证周期被拉长至数月。\n\n### 使用 Rosetta 后\n- **零代码侵入迁移**：开发人员只需在现有 TensorFlow 脚本中加入 `import latticex.rosetta`，即可自动将普通矩阵运算转换为安全的三方密态计算。\n- **屏蔽底层复杂性**：Rosetta 内置了 SecureNN 等成熟协议，自动处理节点间的通信拓扑与密钥管理，让算法工程师专注于模型结构而非密码学细节。\n- **数据可用不可见**：基于半诚实模型下的安全保证，三家医院的数据全程保持加密状态，仅输出最终训练结果，完美满足隐私合规要求。\n- **高效复用生态**：直接兼容 TensorFlow 1.14 API 及现有的 ResNet 等复杂模型架构，利用 Mystique 零知识证明技术加速推理，大幅缩短研发周期。\n\nRosetta 通过“一行代码”的极简改造，让非密码学背景的开发者也能轻松构建高安全、低成本的隐私保护 AI 系统。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FLatticeX-Foundation_Rosetta_9d4fc994.png","LatticeX-Foundation","LatticeX Foundation","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FLatticeX-Foundation_c49ef7d7.png",null,"https:\u002F\u002Flatticex.foundation\u002F","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation",[80,84,88,92,96,100,103],{"name":81,"color":82,"percentage":83},"C++","#f34b7d",62.7,{"name":85,"color":86,"percentage":87},"Python","#3572A5",32.7,{"name":89,"color":90,"percentage":91},"Shell","#89e051",2.1,{"name":93,"color":94,"percentage":95},"CMake","#DA3434",1.5,{"name":97,"color":98,"percentage":99},"Jupyter Notebook","#DA5B0B",0.5,{"name":101,"color":102,"percentage":99},"C","#555555",{"name":104,"color":105,"percentage":106},"Dockerfile","#384d54",0,552,107,"2026-04-14T08:11:04","LGPL-3.0",4,"Linux (Ubuntu 18.04)","未说明 (基于 CPU)","未说明",{"notes":116,"python":117,"dependencies":118},"目前不支持 Windows 和 macOS。默认基于 CPU 运行。支持通过设置环境变量 'export ROSETTA_MPC_128=ON' 并在编译时添加 '--enable-128bit' 选项来启用 128 位整数数据类型。运行前需配置网络拓扑以建立多方通信。","未说明 (需兼容 TensorFlow 1.14)",[119],"tensorflow==1.14.0",[14],[122,123,124,125,126,127],"privacy-preserving-machine-learning","secure-multiparty-computation","homomorphic-encryption","zero-knowledge-proofs","federated-learning","secure-computation","2026-03-27T02:49:30.150509","2026-04-16T16:01:58.135991",[131,136,141,146,151,155,160],{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},35852,"运行多进程任务时出现连接错误或端口冲突怎么办？","在运行涉及 3 个进程的新任务前，请务必检查 CONFIG.json 中配置的端口（例如默认端口 11121, 12144, 13169）未被其他程序占用。如果端口被占用，请修改配置文件中的端口号或关闭占用端口的进程。","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002F49",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},35853,"Rosetta 目前支持几方的安全计算协议？支持两方或多于三方吗？","当前版本主要集成了针对三方的安全多方计算协议（SecureNN 和 Helix），适用于半诚实模型且多数派诚实的场景。如果场景允许存在一个半诚实的第三方，可以直接使用这些协议。如果必须严格限制为两方计算，需等待后续发布的新协议和算法（底层 ZKML 协议是两方的，可参考 README 中的 ZKP 示例）。","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002F102",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},35854,"运行百万富翁问题示例时程序卡住或报错如何解决？","确保按照正确的方式启动三方节点。如果是单机测试，通常需要在同一台机器上通过脚本（如 tutorials.sh）同时启动三个不同 party_id (0, 1, 2) 的进程，而不是手动在三个独立终端分别运行导致配置不一致。请检查 `tutorials.sh` 脚本内容以了解正确的启动参数和顺序。","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002F74",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},35855,"Rosetta 处理后的 Tensor 维度未知（unknown shape）导致后续层报错怎么办？","Rosetta 为了隐私保护可能会掩盖 Tensor 的具体形状。如果遇到类似 \"rank is undefined\" 的错误，尝试在代码中显式地使用 `reshape` 操作来重新定义 Tensor 的形状。此外，确保使用的 Python 版本兼容（如 Python 3.7），某些版本问题可能导致形状推断失败。注意部分算子（如 tf.where）可能尚未完全支持。","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002F114",{"id":152,"question_zh":153,"answer_zh":154,"source_url":150},35856,"为什么三维 Tensor 相乘会报 \"Shape must be rank 2 but is rank 3\" 错误？","目前的 Rosetta 版本中，底层的矩阵乘法算子（RttMatmul）主要优化支持二维矩阵运算。当输入为三维或更高维度的 Tensor 进行 `tf.matmul` 时，可能会触发此限制。建议将高维 Tensor  reshape 为二维矩阵进行计算，然后再恢复形状，或者确认该操作是否在当前支持的算子列表中。",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},35857,"在联合预测场景中，如何正确加载模型和处理私有数据输入？","`private_input` 和 `PrivateInput` 仅用于输入数据，且数据的 shape 在各方必须是已知的。对于模型的保存和加载，建议使用 `tf.train.Saver`，并配合 `rtt.set_saver_model` 和 `rtt.set_restore_model` 来设置保存和加载模式。请参考 `example\u002Ftutorials\u002Fcode` 目录下的 `rtt-linear_regression_saver.py` 和 `rtt-linear_regression_restore.py` 示例代码。","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002F91",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},35858,"是否需要手动编写反向传播图或使用 SGD 优化器？","不需要手动编写反向图。Rosetta 已经支持 SGD 优化器的自动求导功能。用户可以直接参考 tutorials 目录中的现有示例代码进行开发，无需从头构建神经网络的内部构造（如手写前向和反向传播）。","https:\u002F\u002Fgithub.com\u002FLatticeX-Foundation\u002FRosetta\u002Fissues\u002F73",[166,171,176,181,186],{"id":167,"version":168,"summary_zh":169,"released_at":170},281087,"v1.0.0","1. 支持多任务并发，即不同的隐私保护协议可以同时执行。\n\n2. 节点可配置角色，支持计算节点、数据节点和结果节点；其中，数据节点的数量可根据需求任意配置。\n\n3. 重构代码，使代码具有高内聚性和低耦合性。\n\n4. 新增了 SecureExp、SecureSqrt、SecureRsqrt 和 SecureReciprocal 等安全运算功能。\n\n5. 增加审计日志功能，默认关闭，可根据业务场景启用。\n\n6. 通过实现特定接口，可将高效的第三方 I\u002FO 模块集成到 Rosetta 中。\n\n7. 优化后端单元测试，提供更友好的测试用例。\n\n8. 修复了一些已知的 bug。","2021-07-30T11:55:11",{"id":172,"version":173,"summary_zh":174,"released_at":175},281088,"v0.3.0","1. 新增 `PrivateTextLineDataset` 和 `PrivateInput` 安全运算接口。 2. 新增 `SecureLogicalAnd`、`SecureLogicalOr`、`SecureLogicalXor`、`SecureLogicalNot` 安全运算接口。 3. 加速了部分后端操作。 4. 使用 `PrivateTextLineDataset` 等 Python 类及迭代器来加载大规模数据集，从而降低内存占用。 5. 修复了一些已知的 bug。","2020-12-01T11:23:21",{"id":177,"version":178,"summary_zh":179,"released_at":180},281089,"v0.2.0","1. 重构整个架构，使各层边界更加清晰。特别地，新增了一个抽象协议层，用于解耦密码学协议与 TensorFlow Ops，从而实现 TensorFlow 不依赖于特定协议，反之亦然。\n\n2. 主要通过 tf.string 支持自定义数据类型。这将使我们能够处理任意长度和格式的内部密文。\n\n3. 新增并优化了一些 API，例如 activate，以更好地控制后端协议的选择与配置。在本版本中，您可以通过在程序中调用 activate，并以 JSON 字符串的形式配置 IP 端口、主机地址、保存模式标志以及协议精度。\n\n4. 修复了一些已知的 bug。","2020-07-10T06:24:05",{"id":182,"version":183,"summary_zh":184,"released_at":185},281090,"v0.1.1","Rosetta v0.1.1\n- 支持 TensorFlow 的二进制安装","2020-04-27T03:11:34",{"id":187,"version":188,"summary_zh":189,"released_at":190},281091,"v0.1.0","罗塞塔 v0.1.0","2020-04-27T02:33:52"]