Skip to content

Commit

Permalink
Add comment to ProofOfWork.payload about the recent changes and futur…
Browse files Browse the repository at this point in the history
…e rename.
  • Loading branch information
HenrikJannsen committed Mar 26, 2024
1 parent ad9a27d commit dac57db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions security/src/main/java/bisq/security/pow/ProofOfWork.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@
@Getter
@EqualsAndHashCode
public final class ProofOfWork implements NetworkProto {
// payload is usually the pubKeyHash
private final byte[] payload; // message of 1000 chars has about 1300 bytes
// For HashCashTokens we used the serialized message data, thus it was called payload, and
// it could become quite large (e.g. inventory request with 2MB size limit)
// We fixed that design mistake with HashCashV2Token and using the hash of the protobuf data.
// With that we will get a fixes size of 20 bytes. Once the HashCashToken is not used anymore we can rename
// the field to hash and change the verify methods to expect 20 bytes.
private final byte[] payload;

private final long counter;
// If challenge does not make sense we set it null
// Challenge need to be hashed to 256 bits
Expand Down

0 comments on commit dac57db

Please sign in to comment.