Porcupines are buoyant, thanks in part to the hollow structure of their quills. These sharp spines are solid at the base and tip but mostly hollow in the middle, with a light spongy material (the quill medulla) sealed off inside. This helps porcupines float, but although North American, crested, and brush-tailed porcupines are keen swimmers, not all porcupine species are fond of water.
Porcupine quills are even sometimes used by fishermen as floats. The main function of quills, though, is for defense. North American porcupines have up to 30,000 quills each measuring around ten centimeters (four inches) long; if a predator gets too close the barbed tips snag into their skin.