public function resolveBucket(string $address, string &$name = null): string
    {
        $bucket = null;
        $length = 0;
        foreach ($this->prefixes as $id => $prefix) {
            if (strpos($address, $prefix) === 0 && strlen($prefix) > $length) {
                $bucket = $id;
                $length = strlen($prefix);
            }
        }

        if (empty($bucket)) {
            throw new ResolveException("Unable to resolve bucket of `{$address}`.");
        }

        $name = substr($address, $length);

        return $bucket;
    }