function findScriptPath(node, hash) {
  if (isHashBranch(node)) {
    const leftPath = findScriptPath(node.left, hash);
    if (leftPath !== undefined) return [...leftPath, node.right.hash];
    const rightPath = findScriptPath(node.right, hash);
    if (rightPath !== undefined) return [...rightPath, node.left.hash];
  } else if (tools.compare(node.hash, hash) === 0) {
    return [];
  }
  return undefined;
}
Given a HashTree, finds the path from a particular hash to the root.
@param node - the root of the tree
@param hash - the hash to search for
@returns - array of sibling hashes, from leaf (inclusive) to root
(exclusive) needed to prove inclusion of the specified hash. undefined if no
path is found