code: function bufferToTuples (buf) {
    const tuples = []
    let i = 0
    while (i < buf.length) {
      const code = varint.decode(buf, i)
      const n = varint.decode.bytes
  
      const p = protocols(code)
  
      const size = sizeForAddr(p, buf.slice(i + n))
  
      if (size === 0) {
        tuples.push([code])
        i += n
        continue
      }
  
      const addr = buf.slice(i + n, i + n + size)
  
      i += (size + n)
  
      if (i > buf.length) { // did not end _exactly_ at buffer.length
        throw ParseError('Invalid address buffer: ' + buf.toString('hex'))
      }
  
      // ok, tuple seems good.
      tuples.push([code, addr])
    }
  
    return tuples
  }
docs: Buffer -> [[int code, Buffer ]... ]