private Optional<Address> computeAuthority() {
    BytesValueRLPOutput rlpOutput = new BytesValueRLPOutput();
    CodeDelegationTransactionEncoder.encodeSingleCodeDelegationWithoutSignature(this, rlpOutput);

    final Hash hash = Hash.hash(Bytes.concatenate(MAGIC, rlpOutput.encoded()));

    Optional<Address> authorityAddress;
    try {
      authorityAddress =
          SIGNATURE_ALGORITHM
              .get()
              .recoverPublicKeyFromSignature(hash, signature)
              .map(Address::extract);
    } catch (final IllegalArgumentException e) {
      authorityAddress = Optional.empty();
    }

    return authorityAddress;
  }
Create code delegation.

@param chainId can be either the current chain id or zero
@param address the address from which the code will be set into the EOA account
@param nonce the nonce
@param v the recovery id
@param r the r value of the signature
@param s the s value of the signature
@return CodeDelegation
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/CodeDelegation.java