“If Hamilton were on Twitter, he would have been a worse oversharer than me,” said the composer-performer Lin-Manuel Miranda recently over lunch at Fraunces Tavern in Lower Manhattan. Mr. Miranda, who won a Tony for the score of “In the Heights,” was holding forth on Alexander Hamilton, the nation’s first treasury secretary, who is the unlikely subject of his new musical, “Hamilton,” now in previews at the Public Theater. In contrast to such relatively taciturn rivals as Thomas Jefferson and Aaron Burr, Mr. Miranda said, “Everything we know about Hamilton, we knew when he was alive, because he told us.”

Likewise, anyone who follows Mr. Miranda’s lively Twitter feed knows all about his 3-month-old son, his obsession with “Les Misérables” and the roster of celebrities and friends seeing his show on a given night. Before lunch, Mr. Miranda tweeted a photo of himself working on his laptop at the tavern, a Revolutionary War haunt of Hamilton’s and Burr’s, and the place where George Washington held a farewell dinner for his officers.

A meeting of old and new, Colonial and millennial, is the quintessence of “Hamilton,” in which Mr. Miranda — who wrote the book, lyrics and music, and stars in the title role — uses a hip-hop, R&B and pop score to retell America’s founding story. The much-anticipated musical, already extended through May 3 at the Public, is widely rumored to be headed for Broadway.

The hip-hop element does not feel like a kitschy anachronism; this is not “Epic Rap Battles of History,” although “Hamilton” includes its share of epic rap battles. It’s told that way because, while reading Ron Chernow’s exhaustive 2004 Hamilton biography, Mr. Miranda was struck by the parallels between Hamilton — an illegitimate immigrant from the West Indies who rose to power largely by the sheer force of his rhetoric — and such hustlers-turned-moguls as Jay Z.