On a long road trip from the Moldovan frontier through Odesa to Kyiv, Kharkiv and back, I heard overwhelmingly that Ukrainians are determined to fight on. That isn’t always because they love President Volodymyr Zelensky , trust their generals, or see a path to victory. The bottom line in Ukraine is that they must keep fighting because Vladimir Putin gives them no choice.

Mr. Putin isn’t looking for compromise, they say. It isn’t about moving the border posts a few miles to the west. He believes he needs all or almost all of Ukraine, and he won’t stop until he gets it.

Worse, they say, Mr. Putin doesn’t only want to raise the Russian flag over the country and redistribute its wealth to his favored oligarchs. He wants to crush Ukrainian nationality, marginalize the language and culture, impose totalitarian rule over the country, and enlist Ukraine in his project of rebuilding the Russian Empire.

“When he’s conquered us,” says a young Ukrainian employee of a nongovernmental organization, “he’ll draft us into his slave army to keep driving west.”

My young friend is basically right. Mr. Putin doesn’t want Ukraine as a trophy. He wants it as a base—demographic, economic, geographic—for further expansion.

But if Ukraine can’t afford to stop fighting the war, what’s the plan to win? Last year Ukrainians and their supporters believed that superior Western weapons were going to give Ukraine dominance on the battlefield, while Western economic sanctions would drive Russia’s economy toward collapse.

The plan failed. The counteroffensive led to heavy casualties on the Ukrainian side without compensating setbacks for Moscow, and Russia’s economy so far has survived Western sanctions. Ukraine is trapped in a war of attrition with a larger, richer country, and Mr. Putin thinks he can grind out a win.

So, what is Ukraine’s Plan B? You won’t hear a lot of speeches about it in Ukraine, but if you look at the country’s actions, a new war-fighting plan appears to be taking shape. It isn’t unlike Winston Churchill ’s Plan B after Germany’s smashing blitzkrieg victories in 1940. Britain, Churchill told the world, would fight on with everything it had, until “in God’s good time, the New World, with all its power and might, steps forth to the rescue and the liberation of the Old.”

Churchill didn’t expect an American rescue out of pity or principle. He had things to offer, and he had threats to make. Churchill wasn’t above gently reminding Franklin D. Roosevelt that some future British prime minister—Churchill himself would never consider it—might turn the British navy over to Hitler to gain better terms for a defeated and starving island. Churchill knew that Roosevelt couldn’t let that happen, and he believed, with reason, that the increased arrogance and aggression of the Axis powers would ultimately force America into full participation in the war.

Mr. Zelensky seems to be developing a similar plan. Ukraine seeks to make itself indispensable to the West and the U.S., not merely as a geographical barrier to Russian expansion but with capabilities that make the country valuable for its own sake. I visited the workshops where Ukraine is developing cutting-edge battle technologies. Ukrainian special forces are engaged in missions against Russian and Russian-backed forces in Syria and Africa. Ukraine’s cyber capabilities are significant and growing. Few countries match Ukraine’s ability to understand Russia and to cultivate an intelligence network inside it.

Ukraine’s bet is that as these capabilities grow, and as the confrontation between the China-Russia-Iran-North Korea axis of revisionists and the West deepens, two things will happen: Ukraine’s ability to resist Russia will grow, and Ukraine’s allies will do what they must to keep this valuable asset from falling into Mr. Putin’s hands.

Churchill and Roosevelt also used smart financing to get aid flowing to Britain fast enough to make a difference. Ukraine can do something similar. It could, for example, issue bonds backed by the value of future oil and gas resources from the Black Sea. Countries (including perhaps the U.S. under a President Trump) would be more forthcoming with funding if they saw some value attached. In addition, since those bonds would be worthless unless Ukraine wins the war and can exploit the Black Sea resources, there would be a stronger political constituency in some countries for a Ukrainian victory.

I once asked one of my interns if he’d figured out what his job was. “Yes,” he said, “it’s to become indispensable. If you have to have me, you’ll find the money to keep me around.”

That was a smart kid, and he’s gone on to great things. Mr. Zelensky seems to be learning the same lesson. Let’s all hope he succeeds.