How to use the chiapos.Verifier function in chiapos

To help you get started, we’ve selected a few chiapos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Chia-Network / chia-blockchain / src / types / proof_of_space.py View on Github external
def verify_and_get_quality(self) -> Optional[bytes32]:
        v: Verifier = Verifier()
        plot_seed: bytes32 = self.get_plot_seed()
        quality_str = v.validate_proof(plot_seed, self.size, self.challenge_hash,
                                       bytes(self.proof))
        if not quality_str:
            return None
        return self.quality_str_to_quality(self.challenge_hash, quality_str)
github Chia-Network / chia-blockchain / src / full_node.py View on Github external
async def request_header_hash(
        self, request: farmer_protocol.RequestHeaderHash
    ) -> OutboundMessageGenerator:
        """
        Creates a block body and header, with the proof of space, coinbase, and fee targets provided
        by the farmer, and sends the hash of the header data back to the farmer.
        """
        plot_seed: bytes32 = request.proof_of_space.get_plot_seed()

        # Checks that the proof of space is valid
        quality_string: bytes = Verifier().validate_proof(
            plot_seed,
            request.proof_of_space.size,
            request.challenge_hash,
            bytes(request.proof_of_space.proof),
        )
        assert quality_string

        async with self.store.lock:
            # Retrieves the correct head for the challenge
            heads: List[HeaderBlock] = self.blockchain.get_current_tips()
            target_head: Optional[HeaderBlock] = None
            for head in heads:
                assert head.challenge
                if head.challenge.get_hash() == request.challenge_hash:
                    target_head = head
            if target_head is None:

chiapos

Chia proof of space plotting, proving, and verifying (wraps C++)

Apache-2.0
Latest version published 2 months ago

Package Health Score

74 / 100
Full package analysis

Similar packages