Now that the law has been rolled back, sports betting could suddenly turn from an accepted but illegal practice in much of the country to one front and center in American sports. NASCAR needs to be at the forefront of that acceptance.

The sport already runs its own fantasy game, where players can pick different drivers for each race and earn points based on their finishing positions. While there’s officially no money wagered by users — and hence how the game is legal — NASCAR isn’t exactly shying away from encouraging people to bet on its events currently.

“Whether wagering or fantasy — look what fantasy has done for football,” Denny Hamlin told Yahoo Sports. “What people are asking now — what do they care more about, their favorite team or their fantasy team? And most people say fantasy team now because it’s such a big deal. I definitely was encouraged when fantasy NASCAR came out and there’s so many different platforms to do that and encourage fans to get into that because it gives you something to be excited about if your driver has a bad race or something like that.”

Imagine being able to bet from the grandstands at NASCAR races in states where sports betting is legal. The sport could set up betting windows at tracks and fans could place bets much like in horse racing or through a sanctioned mobile app while in their seats in the stands.

NASCAR’s new race format is set up perfectly for betting too. The three-stage breakdown of each race provides fans the opportunity to bet on three different winners in a single race. Throwing money on a parlay of Ryan Blaney to win stage one, Martin Truex Jr. to win stage two and Jimmie Johnson to take the checkered flag in the Daytona 500 would net a nice little payoff if it hit.

One of the reasons stages and the breaks between them were implemented in 2017 as a way for television networks to fit in more commercials during caution flags. With legal gambling, they can also serve as an opportunity for people to place bets on what’s next without missing any of the race.

Offshore sportsbooks like Bovada currently offer the opportunity to bet on race winners. But that’s just the tip of the iceberg. With NASCAR’s support — the sport declined to comment for this story — fans could bet on the fastest lap of a race or within a stage, the fastest pit stop, which driver will finish last, who will pass the most cars … you get the idea. The possibilities are almost endless.

According to ESPN, Las Vegas Golden Knights games are generating 10-15 times the betting activity of a typical NHL game for sportsbooks in the area. The Golden Knights are the first professional franchise to play in Las Vegas and the action is generated because people can bet from their seats at local sportsbooks.

The NHL isn’t a popular betting sport. But Golden Knights games are getting as much action as NFL games because of the accessibility. It wasn’t that long ago when NASCAR was trying to be mentioned in the same sentence as the NFL when it comes to popularity.

As the sport’s television ratings and attendance have plummeted since the mid-2000s, NASCAR has been searching for ways to attract new fans and keep the old ones. The sport’s embrace of gambling could be the ticket to reversing a slide of decreasing attention that doesn’t seem to have found a floor yet. As Hamlin alluded to, the NFL’s popularity surge and fantasy football’s rise aren’t coincidental.

At the minimum, betting could provide another source of income for the sport itself. How could NASCAR say no to that? The sport, which has a list of dozens of official sponsors, could find official sports betting partners to sign up. And it could take a small percentage of all bets that are made at the track.

“Think about how many people play fantasy football that weren’t football fans — I can name several that are in a few leagues of ours that didn’t watch any games and now watch all the games because they’re in fantasy,” Junior said then. “And only because they’re in fantasy.”

The sport would have to install safeguards as well, of course. Keselowski remarked Wednesday that he didn’t think it should be illegal for a competitor to bet in favor of himself. While massive self-confidence is always advisable, the sport would likely want to bar wagering of any kind by drivers and team members to avoid any race-fixing issues.

Those safeguards would need to be intricate. But other sports leagues have already begun to think about a future with legal gambling. In a statement to NBC earlier this month, a spokesperson for the NBA said the league supports legal sports betting if it “includes comprehensive protections for the integrity of our sport.”

If leagues collaborated on those protections, they wouldn’t be arduous to implement. And the upside for a sport that’s shifted its marketing focus towards the stars of the future in an attempt to stay relevant in the present should be at the forefront of an impending American sports betting revolution.