Freelance "work" while in H-1B status is prohibited. This covers side gigs like driving an Uber, blogging for pay (including ad revenue and donations), playing music for tips, and yes, working on your own for-profit company, even in pre-revenue stage where you're not actually getting paid yet.
Your hack - to base the company abroad - gets points for creativity! It would still violate H-1B status, however, if the "work" you're doing for the foreign entity physically takes place in the US.
Here's a pretty accurate summary of the situation. https://www.nolo.com/legal-encyclopedia/can-i-work-remotely-...
I'm putting "work" in airquotes, because performing non-H-1B labor of any kind while in the US is the core of the H-1B violation. So, for example, owning a company in the US is permissible in H-1B status, as long as you don't work there in any capacity.
I realize this is perverse and insane. H-1B requirements are frozen in time in the pre-internet workplace of the early 90's. But here we are.
Personally I'd advise against testing the limits of the H-1B, mostly from hearing horror stories about H-1B renewals getting denied, over dumb things like occasional babysitting, or fixing your neighbors' computers for pay, or "working" at a volunteer organization.
That said, I think there's scope for plenty of activities to advance your startup, that aren't "work" in the H-1B sense. Reframe it for now as an interest, hobby, or skill, and build an online reputation as an expert in that thing. Give advice, ask for opinions, identify pain points, get known, build an audience.
Also, building and testing a prototype of your thing, in the privacy of your own home, still counts as a hobby. Sounds like you've already done this though, so maybe you're at the limit of this one already.
Hope this helps. I feel your pain. I wrote an article about this if you're interested. From 2016, still accurate. My first post on HN as I recall.
https://news.ycombinator.com/item?id=11491428
https://visabuilder.com/blog/escape-from-h1b-hell-5-things-i...
Edited to add, the article cited below from "Law Firm 4 Immigrants" is a misleading blend of accurate and inaccurate information, which is pretty dangerous IMO.
Next we have this little gem:
"First, decide whether you really want to start your business or not.
If yes, act as a passive investor or passive shareholder in your company. Here is the list of actions you can do to start a business while on your H-1B status:"
You can't start a business passively. Starting a business is an action. Investing in a business is a completely different thing.
The article then gives a list of specific things you can do. None of them involve starting a business.
All I an conclude from this is that you clearly can't start a side business while on a H1B and the author really, really doesn't want to tell you this for some reason.