I believe the name is hydrogen fuel cell. It takes hydrogen as a fuel and generates electricity like a battery, instead of combusting it like a typical gas powered motor
The output of a hydrogen fuel cell is water, so it is a fairly sustainable loop if you can capture the water and generate hydrogen from it. But you need an efficient process to convert water into hydrogen