Okay so this strange thing happened to me last night. I was having a regular dream and then everything around me just filled with blackness. It felt like I was on the border of waking up or something. I knew I was sleeping and thought to myself that if I opened my eyes I would be awake. But I didn't want to because I wanted sleep longer so I could go lucid. I got bored of the blackness because nothing was happening so I just opened my eyes and bam! I was awake.

This is not the first time this has happened though. A few months ago when I first started reading about lucid dreaming, I was having this dream and then it just all went black again. I realised I was dreaming and I'm like oh my god I'm lucid so I tried jumping or something I think but I can't remember what happened. And then I was thinking to myself if I open my eyes I will be awake and I'm pretty sure I'm awake right now but my eyes are just closed. So I opened my eyes and I was awake. So I don't know if I was just waking up and my eyes were closed or if I was like partially lucid.

I was thinking maybe sleep paralysis? But I could wake up on demand.
Any thoughts?