A simple algebraic characterization of nonstandard extensions