As above, the Windows 10 license is tied to hardware.
The Windows 8.1 licence you had is still yours and you can use that.
I'm not 100% on the workings of it, but there's definitely no licence key you can swap to another machine.
there will be a mechanism to move the licence to another unit though, otherwise if a system board fails you'd need to buy windows again!
further to that though, if i did sell the unit with windows still on it, how would that licence then be transferred out of my microsoft account? as when i log in to my account i can see that licenced unit attached to my account.
if the new owner doesn't log into windows using a microsoft account the licence would never transfer out of my own microsoft account?
definitely much easier when you have a physical key on a sticker !
the windows 8.1 licence is virtually useless, no-one in their right mind would want to use windows 8.1 now and the licence has already had it's free upgrade to 10.