public static final class SignerKey.Ed25519SignedPayload
extends java.lang.Object
An Ed25519 signed payload consists of an Ed25519 public key and a payload of up to 64 bytes. The signature for this signer type is produced by Ed25519 signing the payload with the private key that corresponds to the public key.
This signer type is particularly useful for multi-party contracts such as payment channels, where it allows all parties to share signatures for a set of transactions while ensuring that signing one transaction reveals the information needed to authorize related transactions.
The signature hint for this signer type is calculated as the XOR of the last 4 bytes of the Ed25519 public key and the last 4 bytes of the payload (padded with zeros if the payload is less than 4 bytes).
Constructor and Description |
---|
Ed25519SignedPayload(byte[] ed25519PublicKey,
byte[] payload)
Creates a new Ed25519SignedPayload.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
byte[] |
getEd25519PublicKey()
The Ed25519 public key (32 bytes) that must sign the payload.
|
java.lang.String |
getEncodedEd25519PublicKey()
Gets the StrKey-encoded representation of the Ed25519 public key.
|
byte[] |
getPayload()
The payload to be signed (up to 64 bytes).
|
int |
hashCode() |
java.lang.String |
toString() |
public Ed25519SignedPayload(byte[] ed25519PublicKey, byte[] payload)
ed25519PublicKey
- The 32-byte Ed25519 public keypayload
- The payload to be signed (maximum 64 bytes)java.lang.IllegalArgumentException
- if the payload length exceeds the maximum allowedpublic java.lang.String getEncodedEd25519PublicKey()
public byte[] getEd25519PublicKey()
public byte[] getPayload()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object