In November 2002, Madlib went to Brazil to participate in a Red Bull Music Academy lecture, where he debuted the first music from the album by playing an unfinished version of "America's Most Blunted". Madlib also went crate digging during his time in Brazil, searching for obscure vinyl records he could sample later, with fellow producers Cut Chemist, DJ Babu, and J.Rocc. According to Madlib himself, he bought multiple crates full of vinyl records, two of which he later lost. He used some of these records to produce beats for "Madvillainy". Most of the album, including beats for "Strange Ways", "Raid", and "Rhinestone Cowboy", was produced in his hotel room in São Paulo, using a portable turntable, a cassette deck, and a Boss SP-303 sampler. While Madlib was working on the album in Brazil, the unfinished demo was stolen and leaked on the internet, 14 months before its official release. Jeff Jank, Stones Throw's art director, remembers the leak in the interview with "Pitchfork":