Fiamma ZKPVerify SDK
To make it easier to send zkpverify requests to the fiamma network, fiamma supports multi-language sdk, which can be easily used by developers.
Fiamma-sdk-rs
The fiamma-sdk-rs is the Rust SDK for the Fiamma chain, providing a range of APIs for interacting with the Fiamma blockchain. This SDK is primarily designed to simplify the process of blockchain development in Rust, covering fundamental on-chain operations and related functionalities.
Main Features
For eco-project parties
Other features
Create and remove validators on the Fiamma blockchain.
Query the challenge data related to a specific BitVM proof or transaction.
Query the basic account functionality.
etc...
API Methods List
1. submit_proof
Description: Submits a proof to the Fiamma blockchain.
When a project submits a proof to the Fiamma network, the Fiamma network verifies the proof's correctness and provides immediate verification results. This stage is known as "soft finality." If the project requires "hard finality" confirmation of the status, it must wait for a period of time, the duration of which depends on the number of validation nodes operated by community users within the network.
Parameters:
creator: The Account identifiers.
proof_system: The name of the proof system used.
proof: The serialized proof data in bytes.
public_input: The public input associated with the proof, serialized as bytes.
vk: The verification key for the proof, also serialized as bytes.
namespace: The namespace under which the proof is being submitted.
data_location: proof data storage location, the default is fiamma, you can specify the DA storage later.
Example Usage:
2. get_tx
Description: Queries the status of a specific transaction. after submitting the proof, this method can be used to check whether the transaction was successfully submitted to the blockchain network.
Parameters:
tx_hash: The hash of the transaction to query.
Example Usage:
3. get_verify_result
Description: Retrieves the verification result of a previously submitted ZKP. The result indicates whether the proof has passed the verification checks.
Parameters:
proof_id: A unique identifier for the proof you want to retrieve.
Response:
proof_id (
String
): Unique identifier of the proof.proof_system (
i32
): Enum representing the proof system used.data_commitment (
String
): Commitment to the data that was verified.data_location (
i32
): Enum representing where the data is located.result (
bool
): Verification result (true if successful).status (
i32
): Enum representing the current status of verification.community_verification_count (
u64
): Number of community verifications performed.namespace (
String
): The namespace under which this proof belongs.
Example Usage:
4. get_verify_result_by_namespace
Description: Retrieves the verification results for a specific namespace. This method is useful for querying the verification status of proofs submitted under a certain namespace, making it possible to verify the results of multiple proofs associated with the same logical group or entity.
Parameters:
namespace (
String
): The namespace for which the verification results are requested which typically represents a logical grouping of proofs.
Response:
Vec: A vector of VerifyResult objects, each representing the verification details of a proof under the given namespace.
Example Usage:
5. submit_community_verification
Description: allows a community member to submit their verification result for a specific proof in the Fiamma network.
Parameters:
creator: The Account identifiers.
proof_id: Unique identifier of the proof.
verify_result: A boolean value representing the community member’s assessment of the proof.
Example Usage:
6. create_staker
Description: Adds a new validator to the Fiamma network.
Parameters:
creator: The Account identifiers.
staker_address: The address of the validator.
Example Usage:
7. remove_staker
Description: Deletes an existing validator from the Fiamma network.
Parameters:
creator: The Account identifiers.
staker_address: The address of the validator.
Example Usage:
8. get_account_info
Description: contains all the necessary fields for basic account functionality. Parameters: An instance of the Wallet
struct created with the PRIVATE_KEY
. This wallet will manage the user's account and facilitate interactions with the Fiamma blockchain.
Example Usage:
9. get_proof_data
Description: Retrieves the necessary proof data from the Fiamma blockchain.
Parameters:
proof_id: A unique identifier for the proof you want to retrieve.
Response: The ProofData
struct corresponds to the MsgSubmitProof
structure in that both are designed to encapsulate information relevant to the submission and verification of proofs within the Fiamma blockchain context.
Example Usage:
10. get_bitvm_challenge_data
Description: Retrieves the challenge data related to a specific BitVM proof or transaction.
Parameters:
proof_id: A unique identifier for the proof you want to retrieve.
Response:
witness (
Vec<u8>
): Contains the witness data needed for the proof validation process.proposer (
String
): Specifies the account or entity that proposed the challenge.
Example Usage:
11. get_pending_proof
Description: Retrieves a list of proofs that are currently awaiting verification. This is useful for community members or validators who want to access pending tasks and perform verifications.
Response:
Vec: A vector of VerifyResult objects that are currently pending verification.
Example Usage:
12. get_pending_proof_by_namespace
Description: Retrieves a list of proofs that are currently awaiting verification for a specific namespace. This is useful for community members or validators who want to access pending tasks and perform verifications.
Parameters:
namespace (
String
): The namespace for which the pending proofs are requested which typically represents a logical grouping of proofs.
Response:
Vec: A vector of VerifyResult objects that are currently pending verification under the given namespace.
Example Usage:
Last updated