I meant see what AP (Activitypub) aimplementation Mastodon is using, and adapt that implementation, not the entirety of Mastodon. In fact quick web search immediately finds there are multiple pre-packaged Ruby gems for Activitypub, so just use one.
I looked at the Wikipedia article about AP and it's kind of bureaucratic but I don't see much difficult. Yeah it's not suited to a raw beginning programmer but it shouldn't take a big expert. OP, have you done much programming?
I see on Wikipedia that there's a new thing called "AT Protocol" that's supposed to improve on AP. That might also be worth looking into.