How can I create a self-quoted tweet that cites 'the tweet itself'?



Mr. Ossian Moran, an engineer who succeeded in making a 'tweet quoting the tweet itself' on Twitter, explains how to do it on his blog.

Oisín Moran | How I Made a Self-Quoting Tweet

https://oisinmoran.com/quinetweet

The tweets that succeeded in self-quoting are as follows.




If you check on the Twitter site, you can see that the URL of the tweet is described in the tweet and it is in an infinite reference state.



According to Moran, the point of creating a self-quoted tweet is to guess what kind of rule the tweet ID is generated.

Twitter uses the format Snowflake ID for tweet IDs, in which the first 41 bits are the 'timestamp', the next 10 bits are the 'machine ID', and the last when the ID number is converted to a binary number. The 12 bits are the 'sequence number'.



With a total of 63 bits, it's almost impossible to rely on it completely randomly. However, since the time stamp part, which is the largest element, can be easily guessed, it is possible to make a self-quoted tweet if you can guess the machine ID of up to 1024 patterns and the sequence number of up to 4096 patterns.

Moran first set up a Twitter developer account

so that he could use twurl to tweet from the program. By sending two tweets in succession, he observed the change in ID. For example, the following two tweets have IDs '1309237975868469248' and '1309237977982345216', but if you apply this to the Snowflake format, the former will be 'Timestamp: 3121646657912' 'Machine ID: 375' 'Sequence number: 0' So, the latter is 'Timestamp: 312146658416' 'Machine ID: 362' 'Sequence number: 0', the second post was 504 milliseconds later, the machine ID is 13 different, the sequence number Turned out to be 0 for both. Assuming that the most sequence number is 0, the only completely random element is the machine ID, which can be brute-forced.






Moran kept sending tweets until he was hit by an API limitation, fixing the time stamp lag. The state of the program is as follows, and the time stamp, machine ID, and sequence number are displayed under the tweet ID. In particular, the third ID had the same time stamp and machine ID, but the sequence number was different by 1, which was very regrettable.



And succeeded in self-quoting tweet at the 960th tweet.






At the end of the blog, Moran told Twitter engineers 'I'm very sorry' that the structure of the tweet is no longer a directed acyclic graph because of this one tweet.

in Software,   Web Service, Posted by log1d_ts