LogoLogo
PAO DocsInfrastructure DocsDeveloper DocsPeerplays.com
  • Introduction to Peerplays
  • Concepts
    • Decentralization
    • Consensus Mechanisms Compared
  • Technology
    • Peerplays Technical Summary
    • Intro to Peerplays Tokens
    • Intro to Peerplays Liquidity Pools
      • Service Infrastructure Pools
    • Staking (PowerUp) in Peerplays
    • Gamified User Namespaces and Subject Matter Expert Committees
    • Peer-to-Peer Autonomous Organizations: Flow Diagram
    • Gamified Proof of Stake (GPOS)
      • Wallet User Guide
        • GPOS Panel
        • GPOS Landing Page
        • Power Up
        • Power Down
        • Vote
        • Thank you for voting!
      • FAQ
        • General
        • GPOS Panel
        • Power Up & Power Down
        • Voting
        • Participation Rewards
    • Sidechain Operator Nodes (SONs)
      • New to SONs?
        • What are Sidechain Operating Nodes?
        • How do SONs Work?
        • Why are SONs important?
        • How do SONs impact me?
        • SON Fees & Performance Requirements
        • Peerplays SONs
      • FAQ
      • Running a SON Node
    • NFTs and Marketplace
      • NFT marketplace in Python
      • NFT Operations in Python
      • NFT, Marketplace, HRP, and RBAC related Commands/Use Cases
      • NFT command reference
    • Peerplays DEX
      • User Guide
        • Account Creation
        • Dashboard
          • Bitcoin Transaction
        • Market Activity
        • Peerplays Blocks
        • Settings
        • Wallet
        • Profile
        • GPOS - Voting
        • Logout
  • Witnesses
    • What is a Peerplays Witness?
    • Becoming a Peerplays Witness
    • Hardware Requirements
    • Installation Guides
  • Bookie Oracle Suite (BOS)
    • Introduction to BOS
    • BOS Installation
    • BookieSports
    • Manual Intervention Tool (MINT)
  • Data Proxies
    • Introduction to Data Proxies
    • How Data Proxies Work
    • Data Proxy Set Up
  • Couch Potato
    • Introduction
    • Installation
    • User Guide
  • Random Number Generator (RNG)
    • RNG Technical Summary
    • RNG API
  • API
    • Peerplays Core API
      • Popular API Calls
      • Account History API
      • Asset API
      • Block API
      • Crypto API
      • Database API
      • Network Broadcast API
      • Network Nodes API
      • Orders API
    • Wallet API
      • Account Calls
      • Asset Calls
      • Blockchain Inspection
      • General Calls
      • Governance
      • Privacy Mode
      • Trading Calls
      • Transaction Builder
      • Wallet Calls
    • Bookie API
      • General
      • Tournaments
      • Listeners
    • Python Peerplays
      • Installation
      • Creating the wallet
      • Creating an Account
      • NFT
      • Market Place
      • HRP / RBAC
  • Connecting Elasticsearch to a blockchain node
  • GitLab
    • GitLab Ticket Templates
    • Labels
    • Time Tracking
  • Other Documentation
    • Peerplays Home
    • Infrastructure Docs
    • Developer Docs
    • Site Reliability Engineering
  • Known Issues
    • Peerplays Disaster Recovery Plan
    • Sept 2021 Mainnet Outage - Postmortem Report
  • Kickstart Guide
    • Peerplays Developer
  • Risk Register
    • Introduction
      • Bunker Issue
        • DDOS Attack
        • Hypervisor Compromised
        • Power and Backup Failure
        • Crypto Restriction
      • Core-Block Issue
        • Expensive Servers
        • Witness node - Not reachable
        • Witnesses get DDOS'd
        • Bad Actor infiltrate witness/SONs
      • Credential Security
        • NEX Open Source Vulnerabilities
        • Keyloggers, access to NEX deployment
        • Password manager hacked
        • SONs active keys exposed in configuration
    • Glossary
  • Operation Cost Estimation
    • Project Operations
    • Cost Estimation
Powered by GitBook
On this page
  • Blinding and Un-Blinding
  • blind
  • blind_sum
  • Range Proofs
  • range_get_info
  • range_proof_sign
  • Verification
  • verify_sum
  • verify_range
  • verify_range_proof_rewind
Export as PDF
  1. API
  2. Peerplays Core API

Crypto API

PreviousBlock APINextDatabase API

Last updated 1 year ago

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

Blinding and Un-Blinding

blind

Get signed blocks.

Generates a Pedersen Commitment: *commit = blind * G + value * G2. The commitment is 33 bytes, the blinding factor is 32 bytes.

Tip: For more information about Pedersen Commitment see:

commitment_type graphene::app::crypto_api::blind(
    const fc::ecc::blind_factor_type &blind, 
    uint64_t value)
  • blind: Sha-256 blind factor type

  • value: Positive 64-bit integer value

A 33-byte Pedersen Commitment: commit = blind G + value * G2

blind_sum

Get SHA-256 blind factor type.

blind_factor_type graphene::app::crypto_api::blind_sum(
    const std::vector<blind_factor_type> &blinds_in, 
    uint32_t non_neg)
  • blinds_in: List of SHA-256 blind factor types

  • non_neg: 32-bit integer value

A blind factor type.

Range Proofs

range_get_info

Gets “range proof” information.

The cli_wallet includes functionality for sending blind transfers in which the values of the input and output amounts are “blinded.”

Note: In the case where a transaction produces two or more outputs, (e.g. an amount to the intended recipient plus “charge” back to the sender), a “range proof” must be supplied to prove that none of the outputs commit to a negative value.

range_proof_info graphene::app::crypto_api::range_get_info(
    const std::vector<char> &proof)

proof: List of proof’s characters

A range proof info structure with exponent, mantissa, min and max values.

range_proof_sign

Proves with respect to min_value the range for Pedersen Commitment which has the provided blinding factor and value.

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
  • min_value: Positive 64-bit integer value

  • commit: 33-byte pedersen commitment

  • commit_blind: Sha-256 blind factor type for the correct digits

  • nonce: Sha-256 blind factor type for our non-forged signatures

  • base10_exp: Exponents base 10 in range [-1 ; 18] inclusively

  • min_bits: 8-bit positive integer, must be in range [0 ; 64] inclusively

  • actual_value: 64-bit positive integer, must be greater or equal min_value

A list of characters as proof in proof.

Verification

verify_sum

Verifies that commits + neg_commits + excess == 0.

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)
  • commits_in: List of 33-byte Pedersen Commitments

  • neg_commits_in: List of 33-byte Pedersen Commitments

  • excess: Sum of two list of 33-byte Pedersen Commitments where sums the first set and subtracts the second

(Boolean) True in event of commits + neg_commits + excess == 0, otherwise false

verify_range

Verifies range proof for 33-byte Pedersen Commitment.

verify_range_result graphene::app::crypto_api::verify_range(
    const fc::ecc::commitment_type &commit, 
    const std::vector<char> &proof)
  • commit: 33-byte pedersen commitment

  • proof: List of characters

A structure with success, min and max values

verify_range_proof_rewind

Verifies range proof rewind for 33-byte Pedersen Commitment.

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)
  • nonce: Sha-256 blind refactor type

  • commit: 33-byte pedersen commitment

  • proof: List of characters

A structure with success, min, max, value_out, blind_out and message_out values.

Commitment Scheme