bitcoin-spv - redundant functionality  Won't Fix
The library exposes redundant implementations of bitcoins double `sha256`.\\nsolidity native implementation with an overzealous type correction issue 5.45\\n```\\n/// @notice Implements bitcoin's hash256 (double sha2)\\n/// @dev abi.encodePacked changes the return to bytes instead of bytes32\\n/// @param \\_b The pre-image\\n/// @return The digest\\nfunction hash256(bytes memory \\_b) internal pure returns (bytes32) {\\n    return abi.encodePacked(sha256(abi.encodePacked(sha256(\\_b)))).toBytes32();\\n}\\n```\\n\\nassembly implementation\\nNote this implementation does not handle errors when staticcall'ing the precompiled `sha256` contract (private chains).\\n```\\n/// @notice Implements bitcoin's hash256 (double sha2)\\n/// @dev sha2 is precompiled smart contract located at address(2)\\n/// @param \\_b The pre-image\\n/// @return The digest\\nfunction hash256View(bytes memory \\_b) internal view returns (bytes32 res) {\\n    assembly {\\n        let ptr := mload(0x40)\\n        pop(staticcall(gas, 2, add(\\_b, 32), mload(\\_b), ptr, 32))\\n        pop(staticcall(gas, 2, ptr, 32, ptr, 32))\\n        res := mload(ptr)\\n    }\\n}\\n```\\n
We recommend providing only one implementation for calculating the double `sha256` as maintaining two interfaces for the same functionality is not desirable. Furthermore, even though the assembly implementation is saving gas, we recommend keeping the language provided implementation.
```\\n/// @notice Implements bitcoin's hash256 (double sha2)\\n/// @dev abi.encodePacked changes the return to bytes instead of bytes32\\n/// @param \\_b The pre-image\\n/// @return The digest\\nfunction hash256(bytes memory \\_b) internal pure returns (bytes32) {\\n    return abi.encodePacked(sha256(abi.encodePacked(sha256(\\_b)))).toBytes32();\\n}\\n```\\n