Class BlindedHop


  • public class BlindedHop
    extends Object
    An encrypted payload and node id corresponding to a hop in a payment or onion message path, to be encoded in the sender's onion packet. These hops cannot be identified by outside observers and thus can be used to hide the identity of the recipient.
    • Method Detail

      • get_blinded_node_id

        public byte[] get_blinded_node_id()
        The blinded node id of this hop in a [`BlindedPath`].
      • set_blinded_node_id

        public void set_blinded_node_id​(byte[] val)
        The blinded node id of this hop in a [`BlindedPath`].
      • get_encrypted_payload

        public byte[] get_encrypted_payload()
        The encrypted payload intended for this hop in a [`BlindedPath`]. Returns a copy of the field.
      • set_encrypted_payload

        public void set_encrypted_payload​(byte[] val)
        The encrypted payload intended for this hop in a [`BlindedPath`].
      • of

        public static BlindedHop of​(byte[] blinded_node_id_arg,
                                    byte[] encrypted_payload_arg)
        Constructs a new BlindedHop given each field
      • hash

        public long hash()
        Generates a non-cryptographic 64-bit hash of the BlindedHop.
      • hashCode

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

        public boolean eq​(BlindedHop b)
        Checks if two BlindedHops contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
      • write

        public byte[] write()
        Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read