This article originally appeared on VICE US.

Staying motivated to work out is hard, and no one likes to waste cryptocurrency that they could hoard or invest. What if one problem could solve the other?

Entrepreneur Amr Saleh hacked together a jury-rigged punching bag as a proof-of-concept that exploits the cryptocurrency miner’s fear of losing their investment to keep them healthy. The concept is simple, the miner locks up an amount of ether (the native token of the Ethereum blockchain) into a smart contract then sets a daily goal for punches on the bag.

A smart contract is a self-executing bit of code that releases funds when certain requirements are met. In this case, you get your ether back if you throw enough punches. If the user doesn’t complete the promised workout routine, the smart contract sends the ether to an Ethereum wallet of their choosing. In a Medium post, Saleh said he set his contracts to send his workout Ethereum to an unspecified charity.

“Knowing the rule of loss aversion, and that losing money hurts more than gaining muscle feels good I thought, why not add a financial motive to help me stick to my exercise plan!” Saleh wrote on Medium. “I wanted to challenge myself so I locked a $100 worth of Ether in a smart contract and committed to 500 punches a day for 10 days. If I finish my workout on schedule, I get my money back,and if I don’t, the money goes to charity.”

According to a YouTube video posted on Wednesday, the bag uses an accelerometer to count the punches and a lightbulb to tell the sweaty miner they’ve completed their workout and secured their precious ether. The accelerometer is hooked up to a prototype Elk board, a proprietary piece of hardware from Elk, a startup that Saleh co-founded. It’s like a blockchain-specific Raspberry Pi. The punching bag idea was first demoed by Elk at a hackathon in 2018.