Primus zkTLS Core SDK
Use this skill when the user wants to integrate @primuslabs/zktls-core-sdk, understand its interfaces, generate zkTLS attestations, or verify those attestations in Solidity with zktls-contracts.
Repositories Covered
https://github.com/primus-labs/zktls-core-sdkhttps://github.com/primus-labs/zktls-contracts
What This Skill Should Help With
- Explain the SDK's exported types and main class.
- Show how to build
AttNetworkRequestandAttNetworkResponseResolve. - Show how to call
init(),generateRequestParams(), andstartAttestation(). - Explain
proxytlsvsmpctls,noProxy,requestInterval, and attestation conditions. - Verify attestations locally with the SDK.
- Verify attestations on-chain with
IPrimusZKTLS.verifyAttestation. - Explain contract-side attestor management with
setAttestor()andremoveAttestor().
Core Workflow
- Install the SDK and provide
appIdplusappSecret. - Call
init(appId, appSecret, mode?). - Build one request or a batch of requests.
- Build matching response resolve rules.
- Call
generateRequestParams(). - Optionally set
attMode,attConditions,additionParams,sslCipher,noProxy, orrequestInterval. - Call
startAttestation(). - Use
verifyAttestation()locally if needed. - Submit the returned
Attestationobject to a Solidity contract that callsIPrimusZKTLS.verifyAttestation(attestation).
Working Rules
- Default to
PrimusCoreTLSas the main integration entrypoint. - Default all demos and quick-start examples to
proxytls. - Do not proactively guide the user toward
mpctlsunless they explicitly ask for it or their scenario clearly requires it. - When documenting the SDK, distinguish clearly between:
- SDK initialization
- request/response description
- attestation generation
- local verification
- on-chain verification
- When the user asks for examples, prefer realistic
GETJSON API examples first. - If the user needs chain integration, show both:
- a consumer contract calling
verifyAttestation - owner-side attestor configuration when self-hosting or managing a contract instance
- a consumer contract calling
- Be explicit that the SDK's local
verifyAttestation()checks the recovered signer against the built-in Primus attestor address constant, while the on-chain contract validates against configured attestors in_attestors.
Important SDK Facts
PrimusCoreTLS.init()storesappIdandappSecret, then initializes the algorithm backend.generateRequestParams()returns anAttRequestinstance with defaults:attMode.algorithmType = "proxytls"attMode.resultType = "plain"sslCipher = "ECDHE-RSA-AES128-GCM-SHA256"noProxy = truerequestInterval = -1
startAttestation()signs the request JSON withappSecret, sends it to the algorithm service, polls for the result, and resolves to a parsedAttestation.verifyAttestation(attestation)returns a boolean in the SDK.IPrimusZKTLS.verifyAttestation(attestation)isviewand reverts when verification fails.
Mode Selection Guidance
- Use
proxytlsunless the user explicitly needs or testsmpctls. - For batched requests, supply:
AttNetworkRequest[]AttNetworkResponseResolve[][]
- Use
attConditionswhen the proof must enforce comparisons or field constraints, not just reveal fields.
Contract Guidance
- Import
IPrimusZKTLSandAttestationfrom@primuslabs/zktls-contracts/src/IPrimusZKTLS.sol. - Consumer contracts usually only need to call
verifyAttestation(attestation). - If managing a
PrimusZKTLSdeployment, the owner must ensure valid attestors are configured withsetAttestor(). - When the user asks for deployed contract addresses, use the current EVM address list documented by Primus in the on-chain interaction overview.
Reference Files
- Full usage guide: references/usage-guide.md


