How the hand and digits originated from fish fins during the Devonian fin-to-limb transition remains unsolved. Controversy in this conundrum stems from the scarcity of ontogenetic data from extant lobe-finned fishes."
Source : Science Advances Vol. 6, No. 34
Various transformational theories for the 'fin-to-limb transition' were first proposed in the 19th century, and recently have been integrated with ideas from developmental biology and gene regulation.
However :
Today, competing mutually incompatible hypotheses propose that digits could result from adoption of a dermoskeletal genetic network by the distal endoskeleton following the evolutionary loss of fin rays, or alternatively, that they arose through the emergence of new forms of the hox gene regulation producing limb-specific gene expression domains."
[ source as above ]