Katana VentraIP

Snowflake ID

Snowflake IDs, or snowflakes, are a form of unique identifier used in distributed computing. The format was created by X (formerly Twitter) and is used for the IDs of tweets. It is popularly believed that every snowflake has a unique structure, so they took the name "snowflake ID". The format has been adopted by other companies, including Discord and Instagram. The Mastodon social network uses a modified version.

1777740857483460608

Twitter Snowflake

The first 41 (+ 1 top zero bit) bits convert to decimal as 367597485448. Add the value to the X Epoch of 1288834974657 (in milliseconds),[4] the Unix time of the tweet is therefore 1656432460.105: June 28, 2022 16:07:40.105 UTC.

Unix time

The middle 10 bits 01 0111 1010 are the machine ID.

The last 12 bits decode to all zero, meaning this tweet is the first tweet processed by the machine at the given millisecond.

X uses snowflake IDs for tweets, direct messages, users, lists, and all other objects available over the .[7]

API

Discord also uses snowflakes, with their epoch set to the first second of the year 2015.

[2]

Instagram uses a modified version of the format, with 41 bits for a timestamp, 13 bits for a ID, and 10 bits for a sequence number.[8]

shard

Mastodon's modified format has 48 bits for a millisecond-level timestamp, as it uses the . The remaining 16 bits are for sequence data.[9]

UNIX epoch

The format was first announced by Twitter in June 2010.[5] Due to implementation challenges, they waited until later in the year to roll out the update.[6]

Universally unique identifier

on GitHub

Twitter's reference implementation