The Swiss dispatched the 19-year-old Maryland native 7-6(2), 6-3 on Saturday but the Australian Open champion was forced to stretch every sinew against the Next Gen star.
Tiafoe has flirted with the top 100 in 2017 and came through a tricky qualifying draw to feature in Florida.
“I think he's going to be really good,” Federer told reporters after his triumph.
“He's got big shots, and I like his mindset. That goes a long way.”
Indeed, those expecting the Swiss maestro to dismantle Tiafoe, 16 years his junior, were in for a shock when the American forced an opening set tie-break.
The 19-year-old limited his unforced error count in the tie-break to just one but Federer’s experience proved telling.
Tiafoe broke the world number six to open set two but he could not consolidate the break and Federer took advantage thereafter.
“He stayed with me for a very long time,” the 2006 champion added.
“I thought we both played very well, and both can maybe walk away from this match quite happy, which is not often the case in tennis.”
The American is content
Tiafoe revealed before the match that he had grew up idolizing Federer but he showed no signs of being overawed during the contest.
“One is more happy than the other,” smiled the American.
“I'm definitely happy. We both played pretty well. It was good tennis.”
Both players shared a warm embrace at the net and Tiafoe was quizzed as to what he told his opponent.
“It was an honor playing you. I hope we can play again, hopefully not so early in the tournament.”
Federer will play the Argentine Juan Martin del Potro in a mouthwatering clash in the third round.