@reclaimprotocol/attestor-core 5.0.4 → 5.0.6
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.
- package/lib/avs/client/create-claim-on-avs.d.ts +4 -4
- package/lib/avs/config.d.ts +1 -1
- package/lib/avs/types/index.d.ts +4 -4
- package/lib/avs/utils/contracts.d.ts +3 -3
- package/lib/avs/utils/register.d.ts +1 -1
- package/lib/avs/utils/tasks.d.ts +1 -1
- package/lib/client/create-claim.d.ts +2 -2
- package/lib/client/tunnels/make-rpc-tcp-tunnel.d.ts +2 -2
- package/lib/client/tunnels/make-rpc-tls-tunnel.d.ts +2 -2
- package/lib/client/utils/attestor-pool.d.ts +1 -1
- package/lib/client/utils/client-socket.d.ts +4 -4
- package/lib/client/utils/message-handler.d.ts +2 -2
- package/lib/config/index.d.ts +1 -1
- package/lib/external-rpc/handle-incoming-msg.d.ts +1 -1
- package/lib/external-rpc/index.js +25 -8
- package/lib/external-rpc/jsc-polyfills/1.d.ts +1 -1
- package/lib/external-rpc/jsc-polyfills/index.d.ts +2 -2
- package/lib/external-rpc/setup-browser.d.ts +1 -1
- package/lib/external-rpc/setup-jsc.d.ts +2 -2
- package/lib/external-rpc/types.d.ts +7 -7
- package/lib/external-rpc/utils.d.ts +2 -2
- package/lib/index.js +26 -9
- package/lib/mechain/client/create-claim-on-mechain.d.ts +3 -3
- package/lib/mechain/types/index.d.ts +2 -2
- package/lib/providers/http/index.d.ts +1 -1
- package/lib/providers/http/utils.d.ts +3 -3
- package/lib/providers/index.d.ts +1 -1
- package/lib/scripts/generate-receipt.d.ts +2 -2
- package/lib/scripts/jsc-cli-rpc.d.ts +1 -1
- package/lib/scripts/start-server.d.ts +1 -1
- package/lib/server/handlers/claimTeeBundle.d.ts +1 -1
- package/lib/server/handlers/claimTunnel.d.ts +1 -1
- package/lib/server/handlers/completeClaimOnChain.d.ts +1 -1
- package/lib/server/handlers/createClaimOnChain.d.ts +1 -1
- package/lib/server/handlers/createTaskOnMechain.d.ts +1 -1
- package/lib/server/handlers/createTunnel.d.ts +1 -1
- package/lib/server/handlers/disconnectTunnel.d.ts +1 -1
- package/lib/server/handlers/fetchCertificateBytes.d.ts +1 -1
- package/lib/server/handlers/index.d.ts +1 -1
- package/lib/server/handlers/init.d.ts +1 -1
- package/lib/server/handlers/toprf.d.ts +1 -1
- package/lib/server/socket.d.ts +4 -4
- package/lib/server/tunnels/make-tcp-tunnel.d.ts +3 -3
- package/lib/server/utils/assert-valid-claim-request.d.ts +4 -4
- package/lib/server/utils/gcp-attestation.d.ts +1 -1
- package/lib/server/utils/generics.d.ts +8 -2
- package/lib/server/utils/oprf-raw.d.ts +2 -2
- package/lib/server/utils/process-handshake.d.ts +2 -2
- package/lib/server/utils/tee-oprf-mpc-verification.d.ts +3 -3
- package/lib/server/utils/tee-oprf-verification.d.ts +3 -3
- package/lib/server/utils/tee-transcript-reconstruction.d.ts +3 -3
- package/lib/server/utils/tee-verification.d.ts +3 -3
- package/lib/server/utils/validation.d.ts +1 -1
- package/lib/types/claims.d.ts +6 -6
- package/lib/types/client.d.ts +5 -5
- package/lib/types/general.d.ts +1 -1
- package/lib/types/handlers.d.ts +3 -3
- package/lib/types/providers.d.ts +5 -5
- package/lib/types/rpc.d.ts +2 -2
- package/lib/types/tunnel.d.ts +1 -1
- package/lib/types/zk.d.ts +1 -1
- package/lib/utils/auth.d.ts +2 -2
- package/lib/utils/bgp-listener.d.ts +1 -1
- package/lib/utils/claims.d.ts +3 -3
- package/lib/utils/error.d.ts +1 -1
- package/lib/utils/generics.d.ts +2 -2
- package/lib/utils/http-parser.d.ts +1 -1
- package/lib/utils/logger.d.ts +1 -1
- package/lib/utils/prepare-packets.d.ts +2 -2
- package/lib/utils/redactions.d.ts +1 -1
- package/lib/utils/retries.d.ts +1 -1
- package/lib/utils/signatures/eth.d.ts +1 -1
- package/lib/utils/signatures/index.d.ts +2 -2
- package/lib/utils/socket-base.d.ts +3 -3
- package/lib/utils/zk.d.ts +4 -4
- package/package.json +4 -3
- package/lib/avs/abis/avsDirectoryABI.js +0 -340
- package/lib/avs/abis/delegationABI.js +0 -1
- package/lib/avs/abis/registryABI.js +0 -725
- package/lib/avs/client/create-claim-on-avs.js +0 -138
- package/lib/avs/config.js +0 -20
- package/lib/avs/contracts/ReclaimServiceManager.js +0 -1
- package/lib/avs/contracts/common.js +0 -1
- package/lib/avs/contracts/factories/ReclaimServiceManager__factory.js +0 -1169
- package/lib/avs/contracts/factories/index.js +0 -4
- package/lib/avs/contracts/index.js +0 -2
- package/lib/avs/types/index.js +0 -1
- package/lib/avs/utils/contracts.js +0 -33
- package/lib/avs/utils/register.js +0 -78
- package/lib/avs/utils/tasks.js +0 -40
- package/lib/client/create-claim.js +0 -433
- package/lib/client/index.js +0 -3
- package/lib/client/tunnels/make-rpc-tcp-tunnel.js +0 -51
- package/lib/client/tunnels/make-rpc-tls-tunnel.js +0 -131
- package/lib/client/utils/attestor-pool.js +0 -25
- package/lib/client/utils/client-socket.js +0 -98
- package/lib/client/utils/message-handler.js +0 -87
- package/lib/config/index.js +0 -44
- package/lib/external-rpc/benchmark.js +0 -69
- package/lib/external-rpc/event-bus.js +0 -14
- package/lib/external-rpc/handle-incoming-msg.js +0 -233
- package/lib/external-rpc/jsc-polyfills/1.js +0 -82
- package/lib/external-rpc/jsc-polyfills/2.js +0 -20
- package/lib/external-rpc/jsc-polyfills/event.js +0 -14
- package/lib/external-rpc/jsc-polyfills/index.js +0 -2
- package/lib/external-rpc/jsc-polyfills/ws.js +0 -81
- package/lib/external-rpc/setup-browser.js +0 -33
- package/lib/external-rpc/setup-jsc.js +0 -22
- package/lib/external-rpc/types.js +0 -1
- package/lib/external-rpc/utils.js +0 -100
- package/lib/external-rpc/zk.js +0 -63
- package/lib/mechain/abis/governanceABI.js +0 -458
- package/lib/mechain/abis/taskABI.js +0 -509
- package/lib/mechain/client/create-claim-on-mechain.js +0 -28
- package/lib/mechain/client/index.js +0 -1
- package/lib/mechain/constants/index.js +0 -3
- package/lib/mechain/index.js +0 -2
- package/lib/mechain/types/index.js +0 -1
- package/lib/proto/api.js +0 -4273
- package/lib/proto/tee-bundle.js +0 -1316
- package/lib/providers/http/index.js +0 -658
- package/lib/providers/http/patch-parse5-tree.js +0 -33
- package/lib/providers/http/utils.js +0 -324
- package/lib/providers/index.js +0 -4
- package/lib/scripts/fetch-ec2-metadata.d.ts +0 -1
- package/lib/server/create-server.js +0 -103
- package/lib/server/handlers/claimTeeBundle.js +0 -252
- package/lib/server/handlers/claimTunnel.js +0 -73
- package/lib/server/handlers/completeClaimOnChain.js +0 -22
- package/lib/server/handlers/createClaimOnChain.js +0 -26
- package/lib/server/handlers/createTaskOnMechain.js +0 -47
- package/lib/server/handlers/createTunnel.js +0 -93
- package/lib/server/handlers/disconnectTunnel.js +0 -5
- package/lib/server/handlers/fetchCertificateBytes.js +0 -41
- package/lib/server/handlers/index.js +0 -22
- package/lib/server/handlers/init.js +0 -32
- package/lib/server/handlers/toprf.js +0 -16
- package/lib/server/index.js +0 -4
- package/lib/server/socket.js +0 -109
- package/lib/server/tunnels/make-tcp-tunnel.js +0 -177
- package/lib/server/utils/apm.js +0 -36
- package/lib/server/utils/assert-valid-claim-request.js +0 -204
- package/lib/server/utils/config-env.js +0 -4
- package/lib/server/utils/dns.js +0 -18
- package/lib/server/utils/gcp-attestation.js +0 -289
- package/lib/server/utils/generics.js +0 -51
- package/lib/server/utils/iso.js +0 -256
- package/lib/server/utils/keep-alive.js +0 -38
- package/lib/server/utils/nitro-attestation.js +0 -325
- package/lib/server/utils/process-handshake.js +0 -215
- package/lib/server/utils/proxy-session.js +0 -6
- package/lib/server/utils/tee-oprf-mpc-verification.js +0 -90
- package/lib/server/utils/tee-oprf-verification.js +0 -174
- package/lib/server/utils/tee-transcript-reconstruction.js +0 -187
- package/lib/server/utils/tee-verification.js +0 -421
- package/lib/server/utils/validation.js +0 -38
- package/lib/types/bgp.js +0 -1
- package/lib/types/claims.js +0 -1
- package/lib/types/client.js +0 -1
- package/lib/types/general.js +0 -1
- package/lib/types/handlers.js +0 -1
- package/lib/types/index.js +0 -10
- package/lib/types/providers.gen.js +0 -10
- package/lib/types/providers.js +0 -1
- package/lib/types/rpc.js +0 -1
- package/lib/types/signatures.js +0 -1
- package/lib/types/tunnel.js +0 -1
- package/lib/types/zk.js +0 -1
- package/lib/utils/auth.js +0 -59
- package/lib/utils/b64-json.js +0 -17
- package/lib/utils/bgp-listener.js +0 -119
- package/lib/utils/claims.js +0 -99
- package/lib/utils/env.js +0 -15
- package/lib/utils/error.js +0 -50
- package/lib/utils/generics.js +0 -317
- package/lib/utils/http-parser.js +0 -246
- package/lib/utils/index.js +0 -13
- package/lib/utils/logger.js +0 -91
- package/lib/utils/prepare-packets.js +0 -62
- package/lib/utils/redactions.js +0 -148
- package/lib/utils/retries.js +0 -24
- package/lib/utils/signatures/eth.js +0 -29
- package/lib/utils/signatures/index.js +0 -7
- package/lib/utils/socket-base.js +0 -90
- package/lib/utils/tls.js +0 -58
- package/lib/utils/ws.js +0 -22
- package/lib/utils/zk.js +0 -577
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* are already trusted because they are included in TEE-signed payloads.
|
|
7
7
|
* This module verifies that both TEEs computed identical outputs.
|
|
8
8
|
*/
|
|
9
|
-
import type { KOutputPayload, TOutputPayload } from '
|
|
10
|
-
import type { OprfVerificationResult } from '
|
|
11
|
-
import type { Logger } from '
|
|
9
|
+
import type { KOutputPayload, TOutputPayload } from '../../proto/tee-bundle.ts';
|
|
10
|
+
import type { OprfVerificationResult } from '../../server/utils/tee-oprf-verification.ts';
|
|
11
|
+
import type { Logger } from '../../types/general.ts';
|
|
12
12
|
/**
|
|
13
13
|
* Verifies OPRF MPC outputs from TEE_K and TEE_T match
|
|
14
14
|
* Returns verified outputs for transcript replacement (same format as ZK OPRF)
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* TEE OPRF Verification and Replacement
|
|
3
3
|
* Verifies OPRF proofs and replaces ranges in reconstructed plaintext
|
|
4
4
|
*/
|
|
5
|
-
import type { OPRFVerificationData } from '
|
|
6
|
-
import type { TeeBundleData } from '
|
|
7
|
-
import type { Logger } from '
|
|
5
|
+
import type { OPRFVerificationData } from '../../proto/tee-bundle.ts';
|
|
6
|
+
import type { TeeBundleData } from '../../server/utils/tee-verification.ts';
|
|
7
|
+
import type { Logger } from '../../types/general.ts';
|
|
8
8
|
export interface OprfVerificationResult {
|
|
9
9
|
position: number;
|
|
10
10
|
length: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TLS Transcript Reconstruction from TEE data
|
|
3
3
|
*/
|
|
4
|
-
import type { CertificateInfo } from '
|
|
5
|
-
import type { TeeBundleData } from '
|
|
6
|
-
import type { Logger } from '
|
|
4
|
+
import type { CertificateInfo } from '../../proto/tee-bundle.ts';
|
|
5
|
+
import type { TeeBundleData } from '../../server/utils/tee-verification.ts';
|
|
6
|
+
import type { Logger } from '../../types/general.ts';
|
|
7
7
|
export interface TeeTranscriptData {
|
|
8
8
|
revealedRequest: Uint8Array;
|
|
9
9
|
reconstructedResponse: Uint8Array;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* TEE Bundle verification utilities
|
|
3
3
|
* Handles validation of TEE verification bundles including attestations and signatures
|
|
4
4
|
*/
|
|
5
|
-
import type { SignedMessage } from '
|
|
6
|
-
import { KOutputPayload, TOutputPayload } from '
|
|
7
|
-
import type { Logger } from '
|
|
5
|
+
import type { SignedMessage } from '../../proto/tee-bundle.ts';
|
|
6
|
+
import { KOutputPayload, TOutputPayload } from '../../proto/tee-bundle.ts';
|
|
7
|
+
import type { Logger } from '../../types/general.ts';
|
|
8
8
|
export interface TeeBundleData {
|
|
9
9
|
teekSigned: SignedMessage;
|
|
10
10
|
teetSigned: SignedMessage;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ProviderName, ProviderParams } from '
|
|
1
|
+
import type { ProviderName, ProviderParams } from '../../types/index.ts';
|
|
2
2
|
export declare function assertValidateProviderParams<T extends ProviderName>(name: T, params: unknown): asserts params is ProviderParams<T>;
|
package/lib/types/claims.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ProviderClaimData } from '
|
|
2
|
-
import type { IAttestorClient, IAttestorClientInitParams } from '
|
|
3
|
-
import type { CompleteTLSPacket, Logger } from '
|
|
4
|
-
import type { ProofGenerationStep, ProviderName, ProviderParams, ProviderSecretParams } from '
|
|
5
|
-
import type { Transcript } from '
|
|
6
|
-
import type { PrepareZKProofsBaseOpts } from '
|
|
1
|
+
import type { ProviderClaimData } from '../proto/api.ts';
|
|
2
|
+
import type { IAttestorClient, IAttestorClientInitParams } from '../types/client.ts';
|
|
3
|
+
import type { CompleteTLSPacket, Logger } from '../types/general.ts';
|
|
4
|
+
import type { ProofGenerationStep, ProviderName, ProviderParams, ProviderSecretParams } from '../types/providers.ts';
|
|
5
|
+
import type { Transcript } from '../types/tunnel.ts';
|
|
6
|
+
import type { PrepareZKProofsBaseOpts } from '../types/zk.ts';
|
|
7
7
|
/**
|
|
8
8
|
* Uniquely identifies a claim.
|
|
9
9
|
* Hash of claim info.
|
package/lib/types/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'http';
|
|
2
2
|
import type { WebSocket as WSWebSocket } from 'ws';
|
|
3
|
-
import type { AuthenticationRequest, InitRequest, InitResponse, RPCMessage, RPCMessages, ServiceSignatureType, TunnelMessage } from '
|
|
4
|
-
import type { BGPListener } from '
|
|
5
|
-
import type { Logger } from '
|
|
6
|
-
import type { RPCEvent, RPCEventMap, RPCEventType, RPCRequestData, RPCResponseData, RPCType } from '
|
|
7
|
-
import type { TCPSocketProperties, Tunnel } from '
|
|
3
|
+
import type { AuthenticationRequest, InitRequest, InitResponse, RPCMessage, RPCMessages, ServiceSignatureType, TunnelMessage } from '../proto/api.ts';
|
|
4
|
+
import type { BGPListener } from '../types/bgp.ts';
|
|
5
|
+
import type { Logger } from '../types/general.ts';
|
|
6
|
+
import type { RPCEvent, RPCEventMap, RPCEventType, RPCRequestData, RPCResponseData, RPCType } from '../types/rpc.ts';
|
|
7
|
+
import type { TCPSocketProperties, Tunnel } from '../types/tunnel.ts';
|
|
8
8
|
/**
|
|
9
9
|
* Any WebSocket implementation -- either the native
|
|
10
10
|
* WebSocket or the WebSocket from the `ws` package.
|
package/lib/types/general.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Logger as TLSLogger, TLSPacketContext, TLSProtocolVersion } from '@reclaimprotocol/tls';
|
|
2
|
-
import type { OPRFRawMarker, TOPRFProofParams } from '
|
|
2
|
+
import type { OPRFRawMarker, TOPRFProofParams } from '../types/zk.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a slice of any array or string
|
|
5
5
|
*/
|
package/lib/types/handlers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Transaction } from 'elastic-apm-node';
|
|
2
|
-
import type { IAttestorServerSocket } from '
|
|
3
|
-
import type { Logger } from '
|
|
4
|
-
import type { RPCRequestData, RPCResponseData, RPCType } from '
|
|
2
|
+
import type { IAttestorServerSocket } from '../types/client.ts';
|
|
3
|
+
import type { Logger } from '../types/general.ts';
|
|
4
|
+
import type { RPCRequestData, RPCResponseData, RPCType } from '../types/rpc.ts';
|
|
5
5
|
export type RPCHandlerMetadata = {
|
|
6
6
|
logger: Logger;
|
|
7
7
|
tx?: Transaction;
|
package/lib/types/providers.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TLSConnectionOptions } from '@reclaimprotocol/tls';
|
|
2
|
-
import type { AttestorVersion, ProviderClaimData } from '
|
|
3
|
-
import type { ArraySlice, Logger, RedactedOrHashedArraySlice } from '
|
|
4
|
-
import type { ProvidersConfig } from '
|
|
5
|
-
import type { Awaitable } from '
|
|
6
|
-
import type { Transcript } from '
|
|
2
|
+
import type { AttestorVersion, ProviderClaimData } from '../proto/api.ts';
|
|
3
|
+
import type { ArraySlice, Logger, RedactedOrHashedArraySlice } from '../types/general.ts';
|
|
4
|
+
import type { ProvidersConfig } from '../types/providers.gen.ts';
|
|
5
|
+
import type { Awaitable } from '../types/signatures.ts';
|
|
6
|
+
import type { Transcript } from '../types/tunnel.ts';
|
|
7
7
|
export type AttestorData = {
|
|
8
8
|
id: string;
|
|
9
9
|
url: string;
|
package/lib/types/rpc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RPCMessage, TunnelDisconnectEvent, TunnelMessage } from '
|
|
2
|
-
import type { AttestorError } from '
|
|
1
|
+
import type { RPCMessage, TunnelDisconnectEvent, TunnelMessage } from '../proto/api.ts';
|
|
2
|
+
import type { AttestorError } from '../utils/error.ts';
|
|
3
3
|
type ExtractPrefix<T, S extends string> = T extends `${infer _}${S}` ? _ : never;
|
|
4
4
|
export type RPCType = ExtractPrefix<keyof RPCMessage, 'Request'>;
|
|
5
5
|
type RPCRequestType<T extends RPCType> = `${T}Request`;
|
package/lib/types/tunnel.d.ts
CHANGED
package/lib/types/zk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EncryptionAlgorithm, OPRFOperator, ZKEngine, ZKOperator } from '@reclaimprotocol/zk-symmetric-crypto';
|
|
2
|
-
import type { TOPRFPayload } from '
|
|
2
|
+
import type { TOPRFPayload } from '../proto/api.ts';
|
|
3
3
|
export type ZKOperators = {
|
|
4
4
|
[E in EncryptionAlgorithm]?: ZKOperator;
|
|
5
5
|
};
|
package/lib/utils/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AuthenticationRequest, ServiceSignatureType } from '
|
|
2
|
-
import { AuthenticatedUserData } from '
|
|
1
|
+
import type { AuthenticationRequest, ServiceSignatureType } from '../proto/api.ts';
|
|
2
|
+
import { AuthenticatedUserData } from '../proto/api.ts';
|
|
3
3
|
export declare function assertValidAuthRequest(request: AuthenticationRequest | undefined, signatureType: ServiceSignatureType): Promise<void>;
|
|
4
4
|
/**
|
|
5
5
|
* Create an authentication request with the given data and private key,
|
package/lib/utils/claims.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClaimTunnelResponse } from '
|
|
2
|
-
import type { ClaimID, ClaimInfo, CompleteClaimData, ProviderParams } from '
|
|
1
|
+
import { ClaimTunnelResponse } from '../proto/api.ts';
|
|
2
|
+
import type { ClaimID, ClaimInfo, CompleteClaimData, ProviderParams } from '../types/index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Creates the standard string to sign for a claim.
|
|
5
5
|
* This data is what the attestor will sign when it successfully
|
|
@@ -16,7 +16,7 @@ export declare function createSignDataForClaim(data: CompleteClaimData): string;
|
|
|
16
16
|
* The successful run of this function means that the claim
|
|
17
17
|
* is valid, and the attestor that signed the claim is valid.
|
|
18
18
|
*/
|
|
19
|
-
export declare function assertValidClaimSignatures({ signatures, ...res }: Partial<ClaimTunnelResponse>, metadata?: import("
|
|
19
|
+
export declare function assertValidClaimSignatures({ signatures, ...res }: Partial<ClaimTunnelResponse>, metadata?: import("../proto/api.ts").InitRequest): Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
* Generates a unique identifier for given claim info
|
|
22
22
|
* @param info
|
package/lib/utils/error.d.ts
CHANGED
package/lib/utils/generics.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CipherSuite, TLSProtocolVersion } from '@reclaimprotocol/tls';
|
|
2
2
|
import { uint8ArrayToBinaryStr } from '@reclaimprotocol/tls';
|
|
3
|
-
import { RPCMessage, RPCMessages } from '
|
|
4
|
-
import type { CompleteTLSPacket, IDecryptedTranscript, IDecryptedTranscriptMessage, ProviderField, RPCEvent, RPCEventMap, RPCEventType, RPCType, Transcript } from '
|
|
3
|
+
import { RPCMessage, RPCMessages } from '../proto/api.ts';
|
|
4
|
+
import type { CompleteTLSPacket, IDecryptedTranscript, IDecryptedTranscriptMessage, ProviderField, RPCEvent, RPCEventMap, RPCEventType, RPCType, Transcript } from '../types/index.ts';
|
|
5
5
|
export { uint8ArrayToBinaryStr };
|
|
6
6
|
/**
|
|
7
7
|
* Decodes a Uint8Array to a UTF-8 string.
|
package/lib/utils/logger.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CipherSuite, TLSPacketContext } from '@reclaimprotocol/tls';
|
|
2
|
-
import type { ClaimTunnelRequest_TranscriptMessage as TranscriptMessage } from '
|
|
3
|
-
import type { CompleteTLSPacket, Logger, MessageRevealInfo, PrepareZKProofsBaseOpts, Transcript } from '
|
|
2
|
+
import type { ClaimTunnelRequest_TranscriptMessage as TranscriptMessage } from '../proto/api.ts';
|
|
3
|
+
import type { CompleteTLSPacket, Logger, MessageRevealInfo, PrepareZKProofsBaseOpts, Transcript } from '../types/index.ts';
|
|
4
4
|
export type PreparePacketsForRevealOpts = {
|
|
5
5
|
cipherSuite: CipherSuite;
|
|
6
6
|
logger: Logger;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArraySlice, OPRFRawMarker, RedactedOrHashedArraySlice, TOPRFProofParams } from '
|
|
1
|
+
import type { ArraySlice, OPRFRawMarker, RedactedOrHashedArraySlice, TOPRFProofParams } from '../types/index.ts';
|
|
2
2
|
export declare const REDACTION_CHAR = "*";
|
|
3
3
|
export declare const REDACTION_CHAR_CODE: number;
|
|
4
4
|
type SliceWithReveal<T> = {
|
package/lib/utils/retries.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ServiceSignatureProvider } from '
|
|
1
|
+
import type { ServiceSignatureProvider } from '../../types/index.ts';
|
|
2
2
|
export declare const ETH_SIGNATURE_PROVIDER: ServiceSignatureProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ServiceSignatureType } from '
|
|
2
|
-
import type { ServiceSignatureProvider } from '
|
|
1
|
+
import { ServiceSignatureType } from '../../proto/api.ts';
|
|
2
|
+
import type { ServiceSignatureProvider } from '../../types/index.ts';
|
|
3
3
|
export declare const SIGNATURES: { [key in ServiceSignatureType]: ServiceSignatureProvider; };
|
|
4
4
|
export declare const SelectedServiceSignatureType: 1;
|
|
5
5
|
export declare const SelectedServiceSignature: ServiceSignatureProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WebSocket as WSWebSocket } from 'ws';
|
|
2
|
-
import type { InitRequest, RPCMessage } from '
|
|
3
|
-
import { RPCMessages } from '
|
|
4
|
-
import type { IAttestorSocket, Logger, RPCEvent, RPCEventMap } from '
|
|
2
|
+
import type { InitRequest, RPCMessage } from '../proto/api.ts';
|
|
3
|
+
import { RPCMessages } from '../proto/api.ts';
|
|
4
|
+
import type { IAttestorSocket, Logger, RPCEvent, RPCEventMap } from '../types/index.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Common AttestorSocket class used on the client & server side as the
|
|
7
7
|
* base for their respective socket implementations.
|
package/lib/utils/zk.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CipherSuite } from '@reclaimprotocol/tls';
|
|
2
2
|
import type { EncryptionAlgorithm, OPRFOperator, PrivateInput, PublicInput, ZKEngine, ZKOperator } from '@reclaimprotocol/zk-symmetric-crypto';
|
|
3
|
-
import type { MessageReveal_MessageRevealZk as ZKReveal, MessageReveal_TOPRFProof as TOPRFProof, MessageReveal_ZKProof as ZKProof } from '
|
|
4
|
-
import { ZKProofEngine } from '
|
|
5
|
-
import type { CompleteTLSPacket, Logger, OPRFOperators, PrepareZKProofsBaseOpts, TOPRFProofParams, ZKOperators, ZKRevealInfo } from '
|
|
3
|
+
import type { MessageReveal_MessageRevealZk as ZKReveal, MessageReveal_TOPRFProof as TOPRFProof, MessageReveal_ZKProof as ZKProof } from '../proto/api.ts';
|
|
4
|
+
import { ZKProofEngine } from '../proto/api.ts';
|
|
5
|
+
import type { CompleteTLSPacket, Logger, OPRFOperators, PrepareZKProofsBaseOpts, TOPRFProofParams, ZKOperators, ZKRevealInfo } from '../types/index.ts';
|
|
6
6
|
type PrepareZKProofsOpts = {
|
|
7
7
|
logger?: Logger;
|
|
8
8
|
cipherSuite: CipherSuite;
|
|
@@ -62,7 +62,7 @@ export declare function makeZkProofGenerator({ zkOperators, oprfOperators, logge
|
|
|
62
62
|
*/
|
|
63
63
|
export declare function verifyZkPacket({ cipherSuite, ciphertext, zkReveal, zkOperators, oprfOperators, logger, zkEngine, iv, recordNumber, toprfOvershotNullifier, getNextPacket }: ZKVerifyOpts): Promise<{
|
|
64
64
|
redactedPlaintext: Uint8Array<ArrayBuffer>;
|
|
65
|
-
oprfRawMarkers: import("
|
|
65
|
+
oprfRawMarkers: import("../proto/api.ts").MessageReveal_OPRFRawMarker[];
|
|
66
66
|
}>;
|
|
67
67
|
export declare function makeDefaultZkOperator(algorithm: EncryptionAlgorithm, zkEngine: ZKEngine, logger: Logger): ZKOperator;
|
|
68
68
|
export declare function makeDefaultOPRFOperator(algorithm: EncryptionAlgorithm, zkEngine: ZKEngine, logger: Logger): OPRFOperator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reclaimprotocol/attestor-core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "tsc -p tsconfig.build.json && npm run run:tsc -- src/scripts/build-lib.ts",
|
|
24
|
+
"build": "tsc -p tsconfig.build.json && tsc-alias && npm run run:tsc -- src/scripts/build-lib.ts",
|
|
25
25
|
"build:browser": "sh ./src/scripts/build-browser.sh",
|
|
26
26
|
"run:tsc": "node --experimental-strip-types",
|
|
27
27
|
"start": "npm run run:tsc -- src/scripts/start-server.ts",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"pino": "^9.14.0",
|
|
108
108
|
"re2": "^1.24.0",
|
|
109
109
|
"serve-static": "^1.16.3",
|
|
110
|
-
"snarkjs": "
|
|
110
|
+
"snarkjs": "^0.7.6",
|
|
111
111
|
"ws": "^8.20.0",
|
|
112
112
|
"xpath": "^0.0.34"
|
|
113
113
|
},
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
"json-schema-to-typescript": "^15.0.4",
|
|
132
132
|
"ts-jest": "^29.4.6",
|
|
133
133
|
"ts-proto": "^2.11.6",
|
|
134
|
+
"tsc-alias": "^1.8.17",
|
|
134
135
|
"typechain": "^8.3.2",
|
|
135
136
|
"typescript": "^5.9.3",
|
|
136
137
|
"whatwg-url": "^14.2.0",
|