Crypto API

Crypto API

The crypto API is available from the full node via websockets.

If you have not set up your websockets connection, please read this article.

Blinding and Un-Blinding

blind_signature graphene::app::crypto_api::blind_sign(const extended_private_key_type &key, const fc::ecc::blinded_hash &hash, int i)
signature_type graphene::app::crypto_api::unblind_signature(const extended_private_key_type &key, const extended_public_key_type &bob, const fc::ecc::blind_signature &sig, const fc::sha256 &hash, int i)
commitment_type graphene::app::crypto_api::blind(const fc::ecc::blind_factor_type &blind, uint64_t value)
blind_factor_type graphene::app::crypto_api::blind_sum(const std::vector<blind_factor_type> &blinds_in, uint32_t non_neg)

Rage Proofs

range_proof_info graphene::app::crypto_api::range_get_info(const std::vector<char> &proof)
std::vector<char> graphene::app::crypto_api::range_proof_sign(uint64_t min_value, const commitment_type &commit, const blind_factor_type &commit_blind, const blind_factor_type &nonce, int8_t base10_exp, uint8_t min_bits, uint64_t actual_value)

Verification

bool graphene::app::crypto_api::verify_sum(const std::vector<commitment_type> &commits_in, const std::vector<commitment_type> &neg_commits_in, int64_t excess)
verify_range_result graphene::app::crypto_api::verify_range(const fc::ecc::commitment_type &commit, const std::vector<char> &proof)
verify_range_proof_rewind_result graphene::app::crypto_api::verify_range_proof_rewind(const blind_factor_type &nonce, const fc::ecc::commitment_type &commit, const std::vector<char> &proof)