@inco/js 0.6.1 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/cjs/advancedacl/session-key.d.ts +8 -1
  2. package/dist/cjs/advancedacl/session-key.js +55 -21
  3. package/dist/cjs/attestedcompute/attested-compute.js +11 -4
  4. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +38 -1
  5. package/dist/cjs/attesteddecrypt/attested-decrypt.js +49 -6
  6. package/dist/cjs/attesteddecrypt/types.d.ts +6 -1
  7. package/dist/cjs/attesteddecrypt/types.js +1 -1
  8. package/dist/cjs/attestedreveal/attested-reveal.js +9 -7
  9. package/dist/cjs/binary.d.ts +1 -0
  10. package/dist/cjs/binary.js +6 -2
  11. package/dist/cjs/encryption/encryption.d.ts +17 -22
  12. package/dist/cjs/encryption/encryption.js +34 -16
  13. package/dist/cjs/generated/abis/add-two.d.ts +1 -1
  14. package/dist/cjs/generated/abis/add-two.js +1 -1
  15. package/dist/cjs/generated/abis/lightning-preview.d.ts +48 -106
  16. package/dist/cjs/generated/abis/lightning-preview.js +33 -55
  17. package/dist/cjs/generated/abis/lightning.d.ts +55 -116
  18. package/dist/cjs/generated/abis/lightning.js +33 -66
  19. package/dist/cjs/generated/abis/verifier.d.ts +193 -84
  20. package/dist/cjs/generated/abis/verifier.js +151 -61
  21. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +2 -2
  22. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +775 -0
  23. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +261 -0
  24. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +186 -0
  25. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +47 -0
  26. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +2 -2
  27. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  28. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +21 -26
  29. package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +2 -2
  30. package/dist/cjs/generated/lightning.d.ts +0 -32
  31. package/dist/cjs/generated/lightning.js +1 -33
  32. package/dist/cjs/generated/local-node.d.ts +1 -5
  33. package/dist/cjs/generated/local-node.js +2 -6
  34. package/dist/cjs/handle.d.ts +16 -0
  35. package/dist/cjs/handle.js +28 -3
  36. package/dist/cjs/lite/deployments.d.ts +20 -2
  37. package/dist/cjs/lite/deployments.js +1 -1
  38. package/dist/cjs/lite/ecies.d.ts +0 -2
  39. package/dist/cjs/lite/ecies.js +24 -13
  40. package/dist/cjs/lite/hadu.d.ts +3 -23
  41. package/dist/cjs/lite/hadu.js +26 -29
  42. package/dist/cjs/lite/index.d.ts +1 -1
  43. package/dist/cjs/lite/index.js +1 -1
  44. package/dist/cjs/lite/lightning.d.ts +24 -12
  45. package/dist/cjs/lite/lightning.js +62 -27
  46. package/dist/cjs/lite/reencrypt.d.ts +5 -7
  47. package/dist/cjs/lite/reencrypt.js +68 -58
  48. package/dist/cjs/test/mocks.d.ts +12 -0
  49. package/dist/cjs/test/mocks.js +27 -0
  50. package/dist/cjs/viem.d.ts +45 -48
  51. package/dist/esm/advancedacl/session-key.d.ts +8 -1
  52. package/dist/esm/advancedacl/session-key.js +58 -24
  53. package/dist/esm/attestedcompute/attested-compute.js +11 -4
  54. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +38 -1
  55. package/dist/esm/attesteddecrypt/attested-decrypt.js +51 -8
  56. package/dist/esm/attesteddecrypt/types.d.ts +6 -1
  57. package/dist/esm/attesteddecrypt/types.js +1 -1
  58. package/dist/esm/attestedreveal/attested-reveal.js +9 -7
  59. package/dist/esm/binary.d.ts +1 -0
  60. package/dist/esm/binary.js +5 -2
  61. package/dist/esm/encryption/encryption.d.ts +17 -22
  62. package/dist/esm/encryption/encryption.js +30 -16
  63. package/dist/esm/generated/abis/add-two.d.ts +1 -1
  64. package/dist/esm/generated/abis/add-two.js +1 -1
  65. package/dist/esm/generated/abis/lightning-preview.d.ts +48 -106
  66. package/dist/esm/generated/abis/lightning-preview.js +33 -55
  67. package/dist/esm/generated/abis/lightning.d.ts +55 -116
  68. package/dist/esm/generated/abis/lightning.js +33 -66
  69. package/dist/esm/generated/abis/verifier.d.ts +193 -84
  70. package/dist/esm/generated/abis/verifier.js +151 -61
  71. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +2 -2
  72. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +775 -0
  73. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +258 -0
  74. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +186 -0
  75. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +44 -0
  76. package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +2 -2
  77. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  78. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +20 -25
  79. package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +2 -2
  80. package/dist/esm/generated/lightning.d.ts +0 -32
  81. package/dist/esm/generated/lightning.js +1 -33
  82. package/dist/esm/generated/local-node.d.ts +1 -5
  83. package/dist/esm/generated/local-node.js +2 -6
  84. package/dist/esm/handle.d.ts +16 -0
  85. package/dist/esm/handle.js +27 -3
  86. package/dist/esm/lite/deployments.d.ts +20 -2
  87. package/dist/esm/lite/deployments.js +1 -1
  88. package/dist/esm/lite/ecies.d.ts +0 -2
  89. package/dist/esm/lite/ecies.js +26 -15
  90. package/dist/esm/lite/hadu.d.ts +3 -23
  91. package/dist/esm/lite/hadu.js +28 -30
  92. package/dist/esm/lite/index.d.ts +1 -1
  93. package/dist/esm/lite/index.js +1 -1
  94. package/dist/esm/lite/lightning.d.ts +24 -12
  95. package/dist/esm/lite/lightning.js +59 -24
  96. package/dist/esm/lite/reencrypt.d.ts +5 -7
  97. package/dist/esm/lite/reencrypt.js +67 -58
  98. package/dist/esm/test/mocks.d.ts +12 -0
  99. package/dist/esm/test/mocks.js +23 -0
  100. package/dist/esm/viem.d.ts +45 -48
  101. package/dist/types/advancedacl/session-key.d.ts +8 -1
  102. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +38 -1
  103. package/dist/types/attesteddecrypt/types.d.ts +6 -1
  104. package/dist/types/binary.d.ts +1 -0
  105. package/dist/types/encryption/encryption.d.ts +17 -22
  106. package/dist/types/generated/abis/add-two.d.ts +1 -1
  107. package/dist/types/generated/abis/lightning-preview.d.ts +48 -106
  108. package/dist/types/generated/abis/lightning.d.ts +55 -116
  109. package/dist/types/generated/abis/verifier.d.ts +193 -84
  110. package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +775 -0
  111. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +186 -0
  112. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  113. package/dist/types/generated/lightning.d.ts +0 -32
  114. package/dist/types/generated/local-node.d.ts +1 -5
  115. package/dist/types/handle.d.ts +16 -0
  116. package/dist/types/lite/deployments.d.ts +20 -2
  117. package/dist/types/lite/ecies.d.ts +0 -2
  118. package/dist/types/lite/hadu.d.ts +3 -23
  119. package/dist/types/lite/index.d.ts +1 -1
  120. package/dist/types/lite/lightning.d.ts +24 -12
  121. package/dist/types/lite/reencrypt.d.ts +5 -7
  122. package/dist/types/test/mocks.d.ts +12 -0
  123. package/dist/types/viem.d.ts +45 -48
  124. package/package.json +3 -1
@@ -0,0 +1,186 @@
1
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Message } from "@bufbuild/protobuf";
3
+ /**
4
+ * Describes the file inco/covalidator/compute/v1/types.proto.
5
+ */
6
+ export declare const file_inco_covalidator_compute_v1_types: GenFile;
7
+ /**
8
+ * @generated from message inco.covalidator.compute.v1.InputContext
9
+ */
10
+ export type InputContext = Message<"inco.covalidator.compute.v1.InputContext"> & {
11
+ /**
12
+ * @generated from field: string host_chain_id = 1;
13
+ */
14
+ hostChainId: string;
15
+ /**
16
+ * @generated from field: string acl_address = 2;
17
+ */
18
+ aclAddress: string;
19
+ /**
20
+ * @generated from field: string user_address = 3;
21
+ */
22
+ userAddress: string;
23
+ /**
24
+ * @generated from field: string contract_address = 4;
25
+ */
26
+ contractAddress: string;
27
+ };
28
+ /**
29
+ * Describes the message inco.covalidator.compute.v1.InputContext.
30
+ * Use `create(InputContextSchema)` to create a new message.
31
+ */
32
+ export declare const InputContextSchema: GenMessage<InputContext>;
33
+ /**
34
+ * InputCryptogram is the outer encrypted content of the CiphertextInput
35
+ *
36
+ * @generated from message inco.covalidator.compute.v1.InputCryptogram
37
+ */
38
+ export type InputCryptogram = Message<"inco.covalidator.compute.v1.InputCryptogram"> & {
39
+ /**
40
+ * The input context that should be collected from the ambient context (e.g. event fields and metadata). This will
41
+ * be compared with CiphertextInputPayload.context_hash to ensure that the ciphertext is being used in the correct context.
42
+ *
43
+ * @generated from field: inco.covalidator.compute.v1.InputContext context = 1;
44
+ */
45
+ context?: InputContext;
46
+ /**
47
+ * The CiphertextInput: an encrypted serialisation of InputPayload
48
+ *
49
+ * @generated from field: bytes payload = 2;
50
+ */
51
+ payload: Uint8Array;
52
+ };
53
+ /**
54
+ * Describes the message inco.covalidator.compute.v1.InputCryptogram.
55
+ * Use `create(InputCryptogramSchema)` to create a new message.
56
+ */
57
+ export declare const InputCryptogramSchema: GenMessage<InputCryptogram>;
58
+ /**
59
+ * InputPayload is the inner encrypted content of the CiphertextInput
60
+ *
61
+ * @generated from message inco.covalidator.compute.v1.InputPayload
62
+ */
63
+ export type InputPayload = Message<"inco.covalidator.compute.v1.InputPayload"> & {
64
+ /**
65
+ * A canonical hash of the InputContext defined as:
66
+ * keccak256(abi.encodePacked("evm/", hostChainId, aclAddress, userAddress, contractAddress))
67
+ *
68
+ * @generated from field: bytes context_hash = 1;
69
+ */
70
+ contextHash: Uint8Array;
71
+ /**
72
+ * Plaintexts all sharing a common context
73
+ *
74
+ * @generated from field: repeated inco.covalidator.compute.v1.AnyValue values = 2;
75
+ */
76
+ values: AnyValue[];
77
+ };
78
+ /**
79
+ * Describes the message inco.covalidator.compute.v1.InputPayload.
80
+ * Use `create(InputPayloadSchema)` to create a new message.
81
+ */
82
+ export declare const InputPayloadSchema: GenMessage<InputPayload>;
83
+ /**
84
+ * @generated from message inco.covalidator.compute.v1.AnyValue
85
+ */
86
+ export type AnyValue = Message<"inco.covalidator.compute.v1.AnyValue"> & {
87
+ /**
88
+ * The plaintext bytes deserialisable according to the type
89
+ *
90
+ * @generated from oneof inco.covalidator.compute.v1.AnyValue.value
91
+ */
92
+ value: {
93
+ /**
94
+ * @generated from field: inco.covalidator.compute.v1.Scalar scalar = 2;
95
+ */
96
+ value: Scalar;
97
+ case: "scalar";
98
+ } | {
99
+ /**
100
+ * @generated from field: inco.covalidator.compute.v1.List list = 3;
101
+ */
102
+ value: List;
103
+ case: "list";
104
+ } | {
105
+ case: undefined;
106
+ value?: undefined;
107
+ };
108
+ };
109
+ /**
110
+ * Describes the message inco.covalidator.compute.v1.AnyValue.
111
+ * Use `create(AnyValueSchema)` to create a new message.
112
+ */
113
+ export declare const AnyValueSchema: GenMessage<AnyValue>;
114
+ /**
115
+ * Scalar represents a single scalar value of a given type and only applies to inputs not store cryptograms
116
+ *
117
+ * @generated from message inco.covalidator.compute.v1.Scalar
118
+ */
119
+ export type Scalar = Message<"inco.covalidator.compute.v1.Scalar"> & {
120
+ /**
121
+ * The type of the scalar
122
+ *
123
+ * @generated from field: int32 type = 1;
124
+ */
125
+ type: number;
126
+ /**
127
+ * The value of the scalar
128
+ *
129
+ * @generated from field: bytes value = 2;
130
+ */
131
+ value: Uint8Array;
132
+ };
133
+ /**
134
+ * Describes the message inco.covalidator.compute.v1.Scalar.
135
+ * Use `create(ScalarSchema)` to create a new message.
136
+ */
137
+ export declare const ScalarSchema: GenMessage<Scalar>;
138
+ /**
139
+ * List represents a list of values of a given type and only applies to inputs not store cryptograms
140
+ *
141
+ * @generated from message inco.covalidator.compute.v1.List
142
+ */
143
+ export type List = Message<"inco.covalidator.compute.v1.List"> & {
144
+ /**
145
+ * The type of the elements of the list
146
+ *
147
+ * @generated from field: int32 elementType = 1;
148
+ */
149
+ elementType: number;
150
+ /**
151
+ * The values of the list
152
+ *
153
+ * @generated from field: repeated bytes values = 2;
154
+ */
155
+ values: Uint8Array[];
156
+ };
157
+ /**
158
+ * Describes the message inco.covalidator.compute.v1.List.
159
+ * Use `create(ListSchema)` to create a new message.
160
+ */
161
+ export declare const ListSchema: GenMessage<List>;
162
+ /**
163
+ * @generated from message inco.covalidator.compute.v1.StoredCryptogram
164
+ */
165
+ export type StoredCryptogram = Message<"inco.covalidator.compute.v1.StoredCryptogram"> & {
166
+ /**
167
+ * The external handle for the ciphertext, this handle is indicative but not authoritative
168
+ * it should be compared with the internal handle in storage payload or verified against the HADU
169
+ * derived handle for InputCiphertextPayload before being trusted. A handle mismatch should trigger an error indicating
170
+ * some kind of bug or tampering.
171
+ *
172
+ * @generated from field: bytes handle = 1;
173
+ */
174
+ handle: Uint8Array;
175
+ /**
176
+ * An encrypted serialisation of the compute payload consisting of a deterministic serialisation of the value and internal handle defined in the computable sub-package
177
+ *
178
+ * @generated from field: bytes payload = 2;
179
+ */
180
+ payload: Uint8Array;
181
+ };
182
+ /**
183
+ * Describes the message inco.covalidator.compute.v1.StoredCryptogram.
184
+ * Use `create(StoredCryptogramSchema)` to create a new message.
185
+ */
186
+ export declare const StoredCryptogramSchema: GenMessage<StoredCryptogram>;
@@ -43,113 +43,6 @@ export type KeyResponse = Message<"inco.kms.lite.v1.KeyResponse"> & {
43
43
  * Use `create(KeyResponseSchema)` to create a new message.
44
44
  */
45
45
  export declare const KeyResponseSchema: GenMessage<KeyResponse>;
46
- /**
47
- * ReencryptRequest is the request type for the KmsService/Reencrypt RPC method.
48
- *
49
- * @generated from message inco.kms.lite.v1.ReencryptRequest
50
- */
51
- export type ReencryptRequest = Message<"inco.kms.lite.v1.ReencryptRequest"> & {
52
- /**
53
- * user_address is the Ethereum address of the user who requested the
54
- * reencryption, prefixed with 0x.
55
- *
56
- * @generated from field: string user_address = 1;
57
- */
58
- userAddress: string;
59
- /**
60
- * ephemeral_pub_key is the encoding of the user's public ephemeral
61
- * encryption key (secp256k1), generated by the user for this reencryption
62
- * request. It is encoded in its 33-byte compressed format.
63
- *
64
- * @generated from field: bytes ephemeral_pub_key = 2;
65
- */
66
- ephemeralPubKey: Uint8Array;
67
- /**
68
- * eip712_signature is an EIP-712 signature of the following EIP-712 typed data by
69
- * `user_address` (note that we only give a JSON representation for the sake of
70
- * readability, but the actual signed data is defined in the EIP-712 spec):
71
- *
72
- * ```json
73
- * {
74
- * "types": {
75
- * "EIP712Domain": [
76
- * { "name": "name", "type": "string" },
77
- * { "name": "version", "type": "string" },
78
- * { "name": "chainId", "type": "uint256" }
79
- * ],
80
- * "ReencryptionRequest": [
81
- * { "name": "publicKey", "type": "bytes" }
82
- * ]
83
- * },
84
- * "primaryType": "ReencryptionRequest",
85
- * "domain": {
86
- * "name": "IncoReencryption",
87
- * "version": "0.1.0",
88
- * "chainId": "<host_chain_id>",
89
- * "verifyingContract": "<acl_address>",
90
- * "salt": "0x0000000000000000000000000000000000000000000000000000000000000000"
91
- * },
92
- * "message": {
93
- * "publicKey": "<ephemeral_pub_key>"
94
- * }
95
- * }
96
- * ```
97
- *
98
- * @generated from field: bytes eip712_signature = 3;
99
- */
100
- eip712Signature: Uint8Array;
101
- /**
102
- * handles_with_proofs is the list of handles of the ciphertexts to reencrypt,
103
- * along with the ACL proof that the user has access to the ciphertext.
104
- *
105
- * @generated from field: repeated inco.kms.lite.v1.HandleWithProof handles_with_proofs = 4;
106
- */
107
- handlesWithProofs: HandleWithProof[];
108
- };
109
- /**
110
- * Describes the message inco.kms.lite.v1.ReencryptRequest.
111
- * Use `create(ReencryptRequestSchema)` to create a new message.
112
- */
113
- export declare const ReencryptRequestSchema: GenMessage<ReencryptRequest>;
114
- /**
115
- * ReencryptResponse is the response type for the KmsService/Reencrypt RPC method.
116
- *
117
- * @generated from message inco.kms.lite.v1.ReencryptResponse
118
- */
119
- export type ReencryptResponse = Message<"inco.kms.lite.v1.ReencryptResponse"> & {
120
- /**
121
- * payload is the reencryption response payload.
122
- *
123
- * @generated from field: inco.kms.lite.v1.ReencryptionResponsePayload payload = 1;
124
- */
125
- payload?: ReencryptionResponsePayload;
126
- };
127
- /**
128
- * Describes the message inco.kms.lite.v1.ReencryptResponse.
129
- * Use `create(ReencryptResponseSchema)` to create a new message.
130
- */
131
- export declare const ReencryptResponseSchema: GenMessage<ReencryptResponse>;
132
- /**
133
- * ReencryptionResponsePayload is the payload of the ReencryptResponse,
134
- * separated out because it is signed by the KMS using its signing key.
135
- *
136
- * @generated from message inco.kms.lite.v1.ReencryptionResponsePayload
137
- */
138
- export type ReencryptionResponsePayload = Message<"inco.kms.lite.v1.ReencryptionResponsePayload"> & {
139
- /**
140
- * user_ciphertexts is the list of ciphertexts that were reencrypted to the
141
- * user's public key. Each ciphertext at index `i` corresponds to the ciphertext
142
- * at index `i` in the `ReencryptRequest`.
143
- *
144
- * @generated from field: repeated inco.fhe.v1.TypedCiphertext user_ciphertexts = 1;
145
- */
146
- userCiphertexts: TypedCiphertext[];
147
- };
148
- /**
149
- * Describes the message inco.kms.lite.v1.ReencryptionResponsePayload.
150
- * Use `create(ReencryptionResponsePayloadSchema)` to create a new message.
151
- */
152
- export declare const ReencryptionResponsePayloadSchema: GenMessage<ReencryptionResponsePayload>;
153
46
  /**
154
47
  * AttestedDecryptRequest is the request type for the KmsService/AttestedDecrypt RPC method.
155
48
  *
@@ -163,10 +56,21 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
163
56
  * @generated from field: string user_address = 1;
164
57
  */
165
58
  userAddress: string;
59
+ /**
60
+ * reencrypt_pub_key is the encoding of the user's public
61
+ * encryption key (secp256k1) used to reencrypt the result for.
62
+ * It is encoded in its 33-byte compressed format.
63
+ * If empty, the KMS will return plaintext decryption instead of reencryption.
64
+ *
65
+ * @generated from field: bytes reencrypt_pub_key = 2;
66
+ */
67
+ reencryptPubKey: Uint8Array;
166
68
  /**
167
69
  * eip712_signature is an EIP-712 signature of the following EIP-712 typed data by
168
70
  * `user_address` (note that we only give a JSON representation for the sake of
169
- * readability, but the actual signed data is defined in the EIP-712 spec):
71
+ * readability, but the actual signed data is defined in the EIP-712 spec) where:
72
+ * handles - list of 0x prefixed handles to decrypt
73
+ * publicKey - 0x prefixed reencrypt_pub_key (if any). "0x" otherwise if empty.
170
74
  *
171
75
  * ```json
172
76
  * {
@@ -177,7 +81,8 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
177
81
  * { "name": "chainId", "type": "uint256" }
178
82
  * ],
179
83
  * "AttestedDecryptRequest": [
180
- * { "name": "handles", "type": "bytes32[]" }
84
+ * { "name": "handles", "type": "bytes32[]" },
85
+ * { "name": "publicKey", "type": "bytes" },
181
86
  * ]
182
87
  * },
183
88
  * "primaryType": "AttestedDecryptRequest",
@@ -187,12 +92,13 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
187
92
  * "chainId": "<host_chain_id>",
188
93
  * },
189
94
  * "message": {
190
- * "handles": ["<handle1>", "<handle2>", ...]
95
+ * "handles": ["<handle1>", "<handle2>", ...],
96
+ * "publicKey": "0x<reencrypt_pub_key>"
191
97
  * }
192
98
  * }
193
99
  * ```
194
100
  *
195
- * @generated from field: bytes eip712_signature = 2;
101
+ * @generated from field: bytes eip712_signature = 3;
196
102
  */
197
103
  eip712Signature: Uint8Array;
198
104
  /**
@@ -200,7 +106,7 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
200
106
  * Either the user_address or sharer must have ACL access to the handles for the attested
201
107
  * decryption to succeed.
202
108
  *
203
- * @generated from field: repeated inco.kms.lite.v1.HandleWithProof handles_with_proofs = 3;
109
+ * @generated from field: repeated inco.kms.lite.v1.HandleWithProof handles_with_proofs = 4;
204
110
  */
205
111
  handlesWithProofs: HandleWithProof[];
206
112
  };
@@ -367,6 +273,40 @@ export type AttestedComputeResponse = Message<"inco.kms.lite.v1.AttestedComputeR
367
273
  * Use `create(AttestedComputeResponseSchema)` to create a new message.
368
274
  */
369
275
  export declare const AttestedComputeResponseSchema: GenMessage<AttestedComputeResponse>;
276
+ /**
277
+ * Plaintext contains the decrypted plaintext value.
278
+ *
279
+ * @generated from message inco.kms.lite.v1.Plaintext
280
+ */
281
+ export type Plaintext = Message<"inco.kms.lite.v1.Plaintext"> & {
282
+ /**
283
+ * value is the decrypted plaintext value as a 32-byte word.
284
+ *
285
+ * @generated from field: bytes value = 1;
286
+ */
287
+ value: Uint8Array;
288
+ };
289
+ /**
290
+ * Describes the message inco.kms.lite.v1.Plaintext.
291
+ * Use `create(PlaintextSchema)` to create a new message.
292
+ */
293
+ export declare const PlaintextSchema: GenMessage<Plaintext>;
294
+ /**
295
+ * Reencryption contains the reencrypted ciphertext value.
296
+ *
297
+ * @generated from message inco.kms.lite.v1.Reencryption
298
+ */
299
+ export type Reencryption = Message<"inco.kms.lite.v1.Reencryption"> & {
300
+ /**
301
+ * @generated from field: inco.fhe.v1.TypedCiphertext user_ciphertext = 1;
302
+ */
303
+ userCiphertext?: TypedCiphertext;
304
+ };
305
+ /**
306
+ * Describes the message inco.kms.lite.v1.Reencryption.
307
+ * Use `create(ReencryptionSchema)` to create a new message.
308
+ */
309
+ export declare const ReencryptionSchema: GenMessage<Reencryption>;
370
310
  /**
371
311
  * DecryptionAttestation contains the attestation for the decryption of a single handle.
372
312
  *
@@ -380,11 +320,28 @@ export type DecryptionAttestation = Message<"inco.kms.lite.v1.DecryptionAttestat
380
320
  */
381
321
  handle: string;
382
322
  /**
383
- * plaintext is the decrypted plaintext value as a 32-byte word.
384
- *
385
- * @generated from field: bytes plaintext = 2;
386
- */
387
- plaintext: Uint8Array;
323
+ * @generated from oneof inco.kms.lite.v1.DecryptionAttestation.value
324
+ */
325
+ value: {
326
+ /**
327
+ * Returns plaintext if reencrypt_pub_key was empty in the request
328
+ *
329
+ * @generated from field: inco.kms.lite.v1.Plaintext plaintext = 2;
330
+ */
331
+ value: Plaintext;
332
+ case: "plaintext";
333
+ } | {
334
+ /**
335
+ * Returns encrypted ciphertext if reencrypt_pub_key was set in the request
336
+ *
337
+ * @generated from field: inco.kms.lite.v1.Reencryption reencryption = 3;
338
+ */
339
+ value: Reencryption;
340
+ case: "reencryption";
341
+ } | {
342
+ case: undefined;
343
+ value?: undefined;
344
+ };
388
345
  /**
389
346
  * signature is the attestation from the covalidator for the (handle,plaintext) pair.
390
347
  * This signature will be verified on the host chain.
@@ -421,7 +378,7 @@ export type DecryptionAttestation = Message<"inco.kms.lite.v1.DecryptionAttestat
421
378
  * }
422
379
  * ```
423
380
  *
424
- * @generated from field: bytes signature = 3;
381
+ * @generated from field: bytes signature = 4;
425
382
  */
426
383
  signature: Uint8Array;
427
384
  };
@@ -536,20 +493,10 @@ export declare const KmsService: GenService<{
536
493
  input: typeof KeyRequestSchema;
537
494
  output: typeof KeyResponseSchema;
538
495
  };
539
- /**
540
- * Reencrypt reencrypts a ciphertext using the ephemeral public key of the
541
- * user.
542
- *
543
- * @generated from rpc inco.kms.lite.v1.KmsService.Reencrypt
544
- */
545
- reencrypt: {
546
- methodKind: "unary";
547
- input: typeof ReencryptRequestSchema;
548
- output: typeof ReencryptResponseSchema;
549
- };
550
496
  /**
551
497
  * AttestedDecrypt decrypts multiple ciphertexts and provides an attestation
552
498
  * that the decryption was performed correctly.
499
+ * Can optionally reencrypt the result of the decryption to a desired public key.
553
500
  *
554
501
  * @generated from rpc inco.kms.lite.v1.KmsService.AttestedDecrypt
555
502
  */
@@ -13,8 +13,6 @@ export declare const lightningDeployments: readonly [{
13
13
  readonly patch: 2;
14
14
  readonly shortSalt: "725458969";
15
15
  };
16
- readonly decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95";
17
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
18
16
  readonly blockNumber: 32124925;
19
17
  readonly deployDate: "2025-10-09T13:55:42.997Z";
20
18
  readonly commit: "v0.5.3-10-ga4f2312d";
@@ -34,8 +32,6 @@ export declare const lightningDeployments: readonly [{
34
32
  readonly patch: 2;
35
33
  readonly shortSalt: "904635675";
36
34
  };
37
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
38
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
39
35
  readonly blockNumber: 3696905;
40
36
  readonly deployDate: "2025-10-03T13:24:44.682Z";
41
37
  readonly commit: "v0.5.3-6-g8db0f27f-dirty";
@@ -55,8 +51,6 @@ export declare const lightningDeployments: readonly [{
55
51
  readonly patch: 0;
56
52
  readonly shortSalt: "904635675";
57
53
  };
58
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
59
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
60
54
  readonly blockNumber: 3344310;
61
55
  readonly deployDate: "2025-09-29T11:14:02.599Z";
62
56
  readonly commit: "v0.5.1-5-g4135c790-dirty";
@@ -76,8 +70,6 @@ export declare const lightningDeployments: readonly [{
76
70
  readonly patch: 0;
77
71
  readonly shortSalt: "183408998";
78
72
  };
79
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
80
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
81
73
  readonly blockNumber: 26296576;
82
74
  readonly deployDate: "2025-05-27T15:57:24.175Z";
83
75
  readonly commit: "v5-3-gec8b6aae-dirty";
@@ -97,8 +89,6 @@ export declare const lightningDeployments: readonly [{
97
89
  readonly patch: 29;
98
90
  readonly shortSalt: "183408998";
99
91
  };
100
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
101
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
102
92
  readonly blockNumber: 13464615;
103
93
  readonly deployDate: "2025-04-22T16:01:14.380Z";
104
94
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -118,8 +108,6 @@ export declare const lightningDeployments: readonly [{
118
108
  readonly patch: 29;
119
109
  readonly shortSalt: "183408998";
120
110
  };
121
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
122
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
123
111
  readonly blockNumber: 24784654;
124
112
  readonly deployDate: "2025-04-22T16:00:02.028Z";
125
113
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -139,8 +127,6 @@ export declare const lightningDeployments: readonly [{
139
127
  readonly patch: 0;
140
128
  readonly shortSalt: "863421733";
141
129
  };
142
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
143
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
144
130
  readonly blockNumber: 25737175;
145
131
  readonly deployDate: "2025-05-14T17:10:44.285Z";
146
132
  readonly commit: "v4-11-g4a1f413a-dirty";
@@ -160,8 +146,6 @@ export declare const lightningDeployments: readonly [{
160
146
  readonly patch: 29;
161
147
  readonly shortSalt: "863421733";
162
148
  };
163
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
164
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
165
149
  readonly blockNumber: 25719113;
166
150
  readonly deployDate: "2025-05-14T07:08:39.059Z";
167
151
  readonly commit: "v4";
@@ -181,8 +165,6 @@ export declare const lightningDeployments: readonly [{
181
165
  readonly patch: 1;
182
166
  readonly shortSalt: "297966649";
183
167
  };
184
- readonly decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95";
185
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
186
168
  readonly blockNumber: 27543410;
187
169
  readonly deployDate: "2025-06-25T12:38:32.856Z";
188
170
  readonly commit: "v5-17-ga03e4b32-dirty";
@@ -202,8 +184,6 @@ export declare const lightningDeployments: readonly [{
202
184
  readonly patch: 0;
203
185
  readonly shortSalt: "297966649";
204
186
  };
205
- readonly decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95";
206
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
207
187
  readonly blockNumber: 26894782;
208
188
  readonly deployDate: "2025-06-10T12:17:35.790Z";
209
189
  readonly commit: "v5-13-gd6b19c10-dirty";
@@ -223,8 +203,6 @@ export declare const lightningDeployments: readonly [{
223
203
  readonly patch: 1;
224
204
  readonly shortSalt: "340846814";
225
205
  };
226
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
227
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
228
206
  readonly blockNumber: 1718868;
229
207
  readonly deployDate: "2025-09-10T15:20:25.654Z";
230
208
  readonly commit: "v6-7-gf96f358e-dirty";
@@ -244,8 +222,6 @@ export declare const lightningDeployments: readonly [{
244
222
  readonly patch: 1;
245
223
  readonly shortSalt: "340846814";
246
224
  };
247
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
248
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
249
225
  readonly blockNumber: 1717229;
250
226
  readonly deployDate: "2025-09-10T14:53:07.218Z";
251
227
  readonly commit: "v6-7-gf96f358e-dirty";
@@ -265,8 +241,6 @@ export declare const lightningDeployments: readonly [{
265
241
  readonly patch: 1;
266
242
  readonly shortSalt: "340846814";
267
243
  };
268
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
269
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
270
244
  readonly blockNumber: 17365942;
271
245
  readonly deployDate: "2025-08-15T17:35:15.208Z";
272
246
  readonly commit: "v0.2.17-35-g8cca6b4e-dirty";
@@ -286,8 +260,6 @@ export declare const lightningDeployments: readonly [{
286
260
  readonly patch: 0;
287
261
  readonly shortSalt: "340846814";
288
262
  };
289
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
290
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
291
263
  readonly blockNumber: 26122863;
292
264
  readonly deployDate: "2025-05-23T15:26:57.031Z";
293
265
  readonly commit: "v5-2-g8957c16b-dirty";
@@ -307,8 +279,6 @@ export declare const lightningDeployments: readonly [{
307
279
  readonly patch: 29;
308
280
  readonly shortSalt: "340846814";
309
281
  };
310
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
311
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
312
282
  readonly blockNumber: 13464197;
313
283
  readonly deployDate: "2025-04-22T15:57:26.862Z";
314
284
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -328,8 +298,6 @@ export declare const lightningDeployments: readonly [{
328
298
  readonly patch: 29;
329
299
  readonly shortSalt: "340846814";
330
300
  };
331
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
332
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
333
301
  readonly blockNumber: 24784527;
334
302
  readonly deployDate: "2025-04-22T15:55:47.828Z";
335
303
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -1,7 +1,6 @@
1
1
  export declare const localNodeLightningConfig: {
2
2
  readonly testnet: {
3
3
  readonly executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd";
4
- readonly eciesPublicKey: "0x0235692e009a07315b5505fbfb44144553b2b163e0d9eddc705a1c49ba4d0dcb91";
5
4
  readonly chainId: 31337;
6
5
  readonly covalidatorUrl: "http://localhost:50055";
7
6
  readonly hostChainRpcUrl: "http://localhost:8545";
@@ -9,7 +8,6 @@ export declare const localNodeLightningConfig: {
9
8
  };
10
9
  readonly devnet: {
11
10
  readonly executorAddress: "0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6";
12
- readonly eciesPublicKey: "0x0232aae7e5deffacd4e682821a95f4200d4327b7ac1e288d147cfa343f751e3f61";
13
11
  readonly chainId: 31337;
14
12
  readonly covalidatorUrl: "http://localhost:50055";
15
13
  readonly hostChainRpcUrl: "http://localhost:8545";
@@ -17,15 +15,13 @@ export declare const localNodeLightningConfig: {
17
15
  };
18
16
  readonly alphanet: {
19
17
  readonly executorAddress: "0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A";
20
- readonly eciesPublicKey: "0x034bc20c48ff1b8e86563dff8dd2ec3936bdea0ab570986780971cdc4c3871fe09";
21
18
  readonly chainId: 31337;
22
19
  readonly covalidatorUrl: "http://localhost:50055";
23
20
  readonly hostChainRpcUrl: "http://localhost:8545";
24
- readonly senderPrivateKey: "0xa0b9f1fb7c6803e5692b73bd08ccc5c468b15eebe7df4398d048e9a58f785706";
21
+ readonly senderPrivateKey: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d";
25
22
  };
26
23
  readonly scratch: {
27
24
  readonly executorAddress: "0x195ec7fDf68fD835b9F78d6eb13E280cC2e25fdD";
28
- readonly eciesPublicKey: "0x02516bda9e68a1c3dce74dc1b6ed7d91a91d51c1e1933947f06331cef59631e9eb";
29
25
  readonly chainId: 31337;
30
26
  readonly covalidatorUrl: "http://localhost:50055";
31
27
  readonly hostChainRpcUrl: "http://127.0.0.1:8567";
@@ -29,13 +29,29 @@ export declare const InputContext: Schema.Struct<{
29
29
  export type InputContext = typeof InputContext.Type;
30
30
  export type Handle = HexString;
31
31
  export declare function getHandleType(handle: HexString): FheType;
32
+ /**
33
+ * Computes the prehandle hash for an input based on the ciphertext
34
+ *
35
+ * @param ciphertextPayload Note this is the different from the input which has the external handle prepended
36
+ * @param indexHandle
37
+ * @param handleType
38
+ * @param handleVersion
39
+ */
32
40
  export declare function computePrehandle({ ciphertext, indexHandle, handleType, handleVersion, }: {
33
41
  ciphertext: Uint8Array;
34
42
  indexHandle: number;
35
43
  handleType: FheType;
36
44
  handleVersion: number;
37
45
  }): Buffer;
46
+ /**
47
+ * Computes the final handle for an input based on the prehandle and the input context, matches the handle generation
48
+ * in Go and Solidity
49
+ *
50
+ * @param prehandle
51
+ * @param context
52
+ */
38
53
  export declare function computeHandle({ prehandle, context, }: {
39
54
  prehandle: Uint8Array;
40
55
  context: InputContext;
41
56
  }): Buffer;
57
+ export declare function hashInputContext(context: InputContext): Buffer;