Class ProofOfWork

java.lang.Object
org.drasyl.identity.ProofOfWork

public class ProofOfWork extends Object
This class models the proof of work for a given public key. Hence, identity creation becomes an expensive operation and sybil attacks should be made more difficult.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNonce

      public int getNonce()
    • intValue

      public int intValue()
      Returns the value of this ProofOfWork as an int.
    • of

      public static ProofOfWork of(int nonce)
    • generateProofOfWork

      public static ProofOfWork generateProofOfWork(CompressedPublicKey publicKey, short difficulty)
    • isValid

      public boolean isValid(CompressedPublicKey publicKey, short difficulty)
    • getDifficulty

      public static short getDifficulty(ProofOfWork proofOfWork, CompressedPublicKey publicKey)
    • incNonce

      public void incNonce()