@typeberry/lib 0.5.0-c1a86af → 0.5.0-d7595f1
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/index.cjs +322 -987
- package/index.d.ts +30 -30
- package/index.js +322 -987
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2013,12 +2013,26 @@ declare namespace bandersnatch_d_exports {
|
|
|
2013
2013
|
/* tslint:disable */
|
|
2014
2014
|
/* eslint-disable */
|
|
2015
2015
|
/**
|
|
2016
|
-
*
|
|
2017
|
-
*
|
|
2018
|
-
*
|
|
2019
|
-
*
|
|
2016
|
+
* Compute VRF output hash from a secret seed and input data.
|
|
2017
|
+
*
|
|
2018
|
+
* This function derives a deterministic VRF output hash without generating a proof.
|
|
2019
|
+
* Unlike `generate_seal`, this produces only the output hash, not a verifiable signature.
|
|
2020
|
+
*
|
|
2021
|
+
* # Arguments
|
|
2022
|
+
* * `secret_seed` - Seed used to derive the secret key
|
|
2023
|
+
* * `input` - VRF input data to be hashed
|
|
2024
|
+
*
|
|
2025
|
+
* # Returns
|
|
2026
|
+
* A byte vector with the following format:
|
|
2027
|
+
* - On success (33 bytes):
|
|
2028
|
+
* - Byte 0: Status code `0` (RESULT_OK)
|
|
2029
|
+
* - Bytes 1-32: VRF output hash (32 bytes)
|
|
2030
|
+
* - On error (1 byte):
|
|
2031
|
+
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
2032
|
+
*
|
|
2033
|
+
* Returns an error if the input cannot be converted to a valid VRF input point.
|
|
2020
2034
|
*/
|
|
2021
|
-
declare function
|
|
2035
|
+
declare function vrf_output_hash(secret_seed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
2022
2036
|
/**
|
|
2023
2037
|
* Verify multiple tickets at once as defined in:
|
|
2024
2038
|
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
@@ -2026,6 +2040,17 @@ declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payl
|
|
|
2026
2040
|
* NOTE: the aux_data of VRF function is empty!
|
|
2027
2041
|
*/
|
|
2028
2042
|
declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
|
|
2043
|
+
/**
|
|
2044
|
+
* Generate ring commitment given concatenation of ring keys.
|
|
2045
|
+
*/
|
|
2046
|
+
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
2047
|
+
/**
|
|
2048
|
+
* Seal verification as defined in:
|
|
2049
|
+
* https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
|
|
2050
|
+
* or
|
|
2051
|
+
* https://graypaper.fluffylabs.dev/#/68eaa1f/0e54010e5401?v=0.6.4
|
|
2052
|
+
*/
|
|
2053
|
+
declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payload: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
2029
2054
|
/**
|
|
2030
2055
|
* Generate seal that is verifiable using `verify_seal` function.
|
|
2031
2056
|
*
|
|
@@ -2053,31 +2078,6 @@ declare function generate_seal(secret_seed: Uint8Array, input: Uint8Array, aux_d
|
|
|
2053
2078
|
* returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
|
|
2054
2079
|
*/
|
|
2055
2080
|
declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
2056
|
-
/**
|
|
2057
|
-
* Compute VRF output hash from a secret seed and input data.
|
|
2058
|
-
*
|
|
2059
|
-
* This function derives a deterministic VRF output hash without generating a proof.
|
|
2060
|
-
* Unlike `generate_seal`, this produces only the output hash, not a verifiable signature.
|
|
2061
|
-
*
|
|
2062
|
-
* # Arguments
|
|
2063
|
-
* * `secret_seed` - Seed used to derive the secret key
|
|
2064
|
-
* * `input` - VRF input data to be hashed
|
|
2065
|
-
*
|
|
2066
|
-
* # Returns
|
|
2067
|
-
* A byte vector with the following format:
|
|
2068
|
-
* - On success (33 bytes):
|
|
2069
|
-
* - Byte 0: Status code `0` (RESULT_OK)
|
|
2070
|
-
* - Bytes 1-32: VRF output hash (32 bytes)
|
|
2071
|
-
* - On error (1 byte):
|
|
2072
|
-
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
2073
|
-
*
|
|
2074
|
-
* Returns an error if the input cannot be converted to a valid VRF input point.
|
|
2075
|
-
*/
|
|
2076
|
-
declare function vrf_output_hash(secret_seed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
2077
|
-
/**
|
|
2078
|
-
* Generate ring commitment given concatenation of ring keys.
|
|
2079
|
-
*/
|
|
2080
|
-
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
2081
2081
|
type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
2082
2082
|
interface InitOutput$2 {
|
|
2083
2083
|
readonly memory: WebAssembly.Memory;
|