This release is a pre-release and may not be stable for production use.
隐私计算平台互联互通协议
本仓库存放隐私计算平台互联互通协议(接口)文档。请注意当前的接口、协议文档还不是最终稳定版,不排除某些接口可能会做变更。
协议文档地址:https://www.secretflow.org.cn/docs/interconnection/
当前已经定义的互联互通协议(接口)有:
目录结构
.
├── PPCA # 存放隐私计算联盟归口的标准协议文件
├── docs # 文档网站的网页源代码
└── interconnection # 所有接口文件
├── common # 通用的接口定义
├── handshake # 所有握手协议相关接口
│ ├── algos # 算法层的握手协议接口
│ ├── op # 安全算子层的握手协议接口
│ └── protocol_family # 密码协议层的握手协议接口
├── legacy # 目前已经废弃的接口文件
├── link # 传输层接口
├── runtime # 算法运行主体所用的接口
└── service # 访问第三方公共基础服务所用的接口
协议设计范式
目前所有的开放协议都分为握手协议和算法主体两部分,其中握手协议用于对齐算法版本、算法运行所需参数等,并遵循一些统一的范式:
- 所有算法都复用同一套握手协议,即所有算法的握手请求都用的是
interconnection/handshake/entry.proto中定义的HandshakeRequest,所有算法的握手协商结果都使用HandshakeResponse格式。 - 对于多个参与方的算法,我们为每个参与方赋予一个编号,称为 rank,rank 的数值从 0 开始依次递增。
- 握手协议执行时,由非 0 参与方向 rank-0 发送
HandshakeRequest,rank-0 汇总所有参与方的请求后,得出一组公共参数,依次发送HandshakeResponse,如果参数协商失败,则依次发送错误消息。 HandshakeRequest中每一类具体的参数项,其命名风格一般为 XxxProposal,HandshakeResponse中选定的参数项,其命名风格一般为 XxxResult。- 对于某些连续数值型参数,例如深度学习中的 learning_rate 等,我们假设无论参数选择几对功能无影响,对方都应该支持,这一类参数不需要协商,而是由 rank-0 选定一个数值,在
HandshakeResponse中发给大家。 - 对于一些可枚举的功能性参数,
HandshakeRequest用一个列表表示,表示发送者支持列表所列的功能;并且这个列表是有序的,表示发送者更加偏爱列表中靠前的参数。例如 ECDH-PSI 中的椭圆曲线(EC)类型,假如请求列表是[SM2, CURVE25519],则表示发送者同时支持 SM2 和 CURVE25519,如果其他参与方也同时支持这两种 EC,则协商者应当优先选择 SM2, 因为 SM2 排在前面。当然,如果多个参数方发送的列表顺序是矛盾的,协商者会优先满足大多数参与方的偏爱。
算法主体部分因算法而异,请以具体协议文档为准。
算法协议与传输层关系
算法协议中提到的 proto 一般并不直接用于 RPC 框架,而是用作跨语言、跨版本的序列化、反序列化工具使用。传输层只负责传输裸的二进制 buffer,不感知具体的 proto 格式,下图是一个示例:
┌─────────────┐ ┌─────────────┐
│ Algorithm │ │ Algorithm │
└──────┬──────┘ └──────▲──────┘
│Serialize │
│proto │Deserialize
│to buffer │buffer
┌──────▼──────┐ ┌──────┴──────┐
│ Transport │ buffer │ Transport │
│ layer ├────────────────►│ layer │
└─────────────┘ http(s)/rpc └─────────────┘
示例图:
- 左侧的算法将 proto 序列化成 buffer,提交给传输层
- 左侧传输层通过网络将数据发送到右侧传输层模块
- 右侧算法获取传输层中的 buffer,反序列化成 proto
Metadata
Release files for interconnection 0.1.0.dev20231204
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| interconnection-0.1.0.dev20231204-py3-none-manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for interconnection-0.1.0.dev20231204-py3-none-manylinux2014_x86_64.whl |
| interconnection-0.1.0.dev20231204-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for interconnection-0.1.0.dev20231204-py3-none-macosx_11_0_arm64.whl |
Total release size: 52.3 kB
Release files / interconnection-0.1.0.dev20231204-py3-none-manylinux2014_x86_64.whl
| Download URL | interconnection-0.1.0.dev20231204-py3-none-manylinux2014_x86_64.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
e07b3033d06c9e2caa7abfc2b32df901ba67e2fe04ef572c881b6b295aaf9d62
|
|
BLAKE2b-256 checksum How to use checksums |
ba48597b8ce1e444d06f085bbd3e3769d8d8f741b260db8e9a3b8d1c209cd661
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Release files / interconnection-0.1.0.dev20231204-py3-none-macosx_11_0_arm64.whl
| Download URL | interconnection-0.1.0.dev20231204-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
18ef5f570c6db08aa55219b02349bd515cc91dfd3e360bca7f62322779514fcb
|
|
BLAKE2b-256 checksum How to use checksums |
84ef2d54d5b9ac342902218f13733f8a4a7b0e1a2bc1d7df0249ca223311ac08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Security for interconnection 0.1.0.dev20231204
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.