The second one "beginning" is correct. This is because we often need a double consonant to show that the pronunciation of the word uses the short vowel sound. For example, "hoped" uses the long O sound like in the word "so." And "hopped" uses the short O sound like in the word "drop."
I hope this was helpful for you.