docs: function get_address_type(address) {
      var decoded_hex;
      try {
          decoded_hex = base58.decode(address);
      } catch (e) {
          // if decoding fails, assume invalid address
          return null;
      }
  
      // make a usable buffer from the decoded data
      var decoded = new Buffer(decoded_hex, 'hex');
  
      // should be 25 bytes per btc address spec
      if (decoded.length != 25) {
          return null;
      }
  
      var length = decoded.length;
      var cksum = decoded.slice(length - 4, length).toString('binary');
      var body = decoded.slice(0, length - 4);
  
      var good_cksum = sha256_digest(sha256_digest(body)).toString('binary').substr(0,4);
      return (cksum === good_cksum ? decoded_hex.slice(0, 2) : null);
  }