@arcium-hq/client
Classes
| Class | Description |
|---|---|
| Aes128Cipher | AES-128 cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret. See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode. |
| Aes192Cipher | AES-192 cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret. See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode. |
| Aes256Cipher | AES-256 cipher in Counter (CTR) mode, using SHA3-256 to derive the key from a shared secret. See: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf (Section 6.5) for details on CTR mode. |
| Matrix | Matrix class over FpField. Data is row-major. |
| RescueCipher | The Rescue cipher in Counter (CTR) mode, with a fixed block size m = 5. See: https://tosc.iacr.org/index.php/ToSC/article/view/8695/8287 |
| RescueDesc | Description and parameters for the Rescue cipher or hash function, including round constants, MDS matrix, and key schedule. See: https://tosc.iacr.org/index.php/ToSC/article/view/8695/8287 |
| RescuePrimeHash | The Rescue-Prime hash function, as described in https://eprint.iacr.org/2020/1143.pdf, offering 256 bits of security against collision, preimage and second-preimage attacks for any field of size at least 102 bits. We use the sponge construction with fixed rate = 7 and capacity = 5 (i.e., m = 12), and truncate the output to 5 field elements. |
Type Aliases
| Type Alias | Description |
|---|---|
| ArciumIdlType | Program IDL in camelCase format in order to be used in JS/TS. |
| ArciumLocalEnv | Structure representing the local Arcium environment variables required for local development or testing. |
| ComputationErrorType | Represents possible error messages that can occur during computation processing or transaction handling. |
| FpField | Field type for Curve25519 base field. |
Variables
| Variable | Description |
|---|---|
| arcisEd25519 | Ed25519 curve instance using SHA3-512 for hashing, suitable for MPC (ArcisEd25519 signature scheme). This is essentially Ed25519 but with SHA3-512 instead of SHA-512 for lower multiplicative depth. See: https://datatracker.ietf.org/doc/html/rfc8032#section-5.1 |
| ARCIUM_ADDR | The deployed address of the Arcium program, as specified in the IDL. |
| ARCIUM_IDL | The Anchor-generated IDL JSON object for the Arcium program. |
| CURVE25519_BASE_FIELD | Curve25519 base field as an IField instance. |
| CURVE25519_SCALAR_FIELD_MODULUS | Scalar field prime modulus for Curve25519: 2^252 + 27742317777372353535851937790883648493 |
| x25519 | ECDH using curve25519 aka x25519. |
Functions
| Function | Description |
|---|---|
| awaitComputationFinalization | Waits for the finalization of a computation by listening for the finalizeComputationEvent. Resolves with the transaction signature once the computation is finalized. |
| buildFinalizeCompDefTx | Builds a transaction to finalize a computation definition. |
| compressUint128 | Compresses an array of bytes into 128-bit bigints. |
| decompressUint128 | Decompresses an array of 128-bit bigints into a flattened byte array. |
| deserializeLE | Deserializes a little-endian Uint8Array to a bigint. |
| generateRandomFieldElem | Generates a random value within the field bound by q. |
| getArciumAccountBaseSeed | Returns the base seed for an Arcium account, given its name. |
| getArciumEnv | Reads local Arcium environment information from environment variables. Only available in Node.js and when testing locally. |
| getArciumProgAddress | Returns the public key of the deployed Arcium program on Solana. |
| getArciumProgram | Returns an Anchor program instance for the Arcium program. |
| getArciumProgramId | Returns the public key of the deployed Arcium program on Solana. |
| getArciumProgramReadonly | Returns a read-only Anchor program instance for the Arcium program. |
| getArxAccPDA | Returns the PDA (program-derived address) for an ArxNode account given the program ID and node offset. |
| getArxNodeAccAddress | Derives the ArxNode account address for a given offset. |
| getClockAccAddress | Derives the clock account address. |
| getClusterAccAddress | Derives the cluster account address for a given offset. |
| getCompDefAccAddress | Derives the computation definition account address for a given MXE program ID and offset. |
| getCompDefAccOffset | Computes the offset for a computation definition account, based on the circuit name. |
| getComputationAccAddress | Derives the computation account address for a given cluster and offset. |
| getExecutingPoolAccAddress | Derives the executing pool account address for a given cluster. |
| getExecutingPoolAccData | Fetches and decodes the executing pool account data for any pool size. |
| getFeePoolAccAddress | Derives the fee pool account address. |
| getMempoolAccAddress | Derives the mempool account address for a given cluster. |
| getMempoolAccData | Fetches and decodes the mempool account data for any mempool account size. |
| getMXEAccAddress | Derives the MXE account address for a given MXE program ID. |
| getMXEArcisEd25519VerifyingKey | Fetches and extracts the MXE arcis ed25519 verifying key from the MXE account. |
| getMXEPublicKey | Fetches and extracts the MXE public key from the MXE account. |
| positiveModulo | Computes the positive modulo of a over m. |
| randMatrix | - |
| serializeLE | Serializes a bigint to a little-endian Uint8Array of the specified length. |
| sha256 | Computes the SHA-256 hash of an array of Uint8Arrays. |
| toVec | - |
| uploadCircuit | Uploads a circuit to the blockchain, splitting it into multiple accounts if necessary. |