File Formats


Key elements

messagebase - This is a string used in all keys - "fms" is recommended.
yyyy - The 4 digit year in which the key is inserted.
mm - The 2 digit month in which the key is inserted. Single digit months should be prefixed with 0.
dd - The 2 digit day in which the key is inserted. Single digit days should be prefixed with 0.
# - An index number starting at 0.

Other considerations

All dates and times must be in UTC.
All board names must be lower case and no longer than 40 characters. Commas and whitespace characters are not allowed in board names.
All UUIDs should follow the UUID standard, but failing that, they MUST be unique and MUST NOT contain the | character. The only characters a UUID in FMS may contain are A-Z, a-z, 0-9, @, _, -, and ~.


Identity

The Identity message is posted to that identity's SSK and contains information about it. This must be inserted at least once per day if the identity is active (i.e. has posted a message on a board). This lets other clients know they should check for messages from this identity. Absense of this file for a particular day will mean that clients should not check for new messages from this identity. Although the Identity message is indexed, it should not change very often and only the first index position (0) can be used to reduce polling.

SSK@asdfasdf.../messagebase|yyyy-mm-dd|Identity|#.xml
<?xml version="1.0" encoding="UTF-8"?>
<Identity>
	<Name><![CDATA[my name]]></Name>
	<Signature><![CDATA[signature]]></Signature>
	<Avatar><![CDATA[SSK@asdfasdf.../avatar.png]]></Avatar>
	<SingleUse>true|false</SingleUse>
	<PublishTrustList>true|false</PublishTrustList>
	<PublishBoardList>true|false</PublishBoardList>
	<!--FreesiteEdition is only present when identity is publishing a Freesite-->
	<FreesiteEdition>#</FresiteEdition>
</Identity>

Message

A Message contains a post to a board from an identity. The message id must be a unique alpha-numeric string. The message may be posted to more than one board and the board in which the replies should be posted to can be specified. The ID of the message should begin with a standard UUID then an @ and then the first part of the inserting identity's SSK (the part between the @ and first ,) with the ~ and - removed. This should then be checked by the downloading client to verify the source.

SSK@asdfasdf.../messagebase|yyyy-mm-dd|Message|#.xml (soon to be deprecated key - replaced by editioned SSK as shown below)
SSK@asdfasdf.../messagebase|yyyy-mm-dd|Message-#
<?xml version="1.0" encoding="UTF-8"?>
<Message>
	<Date>yyyy-mm-dd</Date>
	<Time>HH:MM:SS</Time>
	<Subject><![CDATA[message subject]]></Subject>
	<MessageID><![CDATA[UUID + @ + first part of SSK (between @ and first,) with ~ and - removed]]></MessageID>
	<Boards>
		<Board><![CDATA[board1]]></Board>
		<Board><![CDATA[board2]]></Board>
	</Boards>
	<ReplyBoard><![CDATA[board2]]></ReplyBoard>
	<InReplyTo>
		<Message>
			<Order>0</Order>
			<MessageID><![CDATA[messageid1]]></MessageID>
		</Message>
		<Message>
			<Order>1</Order>
			<MessageID><![CDATA[messageid2]]></MessageID>
		</Message>
	</InReplyTo>
	<Body><![CDATA[body of the message]]></Body>
	<Attachments>
		<File>
			<Key><![CDATA[CHK@sdfasdfsdfdsf...]]></Key>
			<Size>18573</Size>
		</File>
	</Attachments>
</Message>

TrustList

A TrustList message contains the trust levels of other identities given to them by the identity that inserted it. An identity may opt not to publish his trust list. A user may opt not to download an identity's trust list if his trust level is lower than a particular number. If one or more of the trust levels are not set, they may be absent from the file. The downloading client should assume that any missing trust level means that particular type of trust is NULL. The comment nodes may also be absent if there isn't a comment for the trust level. The TrustList must only contain identities that have been seen recently, and that are either identities we have just learned about recently, or identities that have posted recently.

SSK@asdfasdf.../messagebase|yyyy-mm-dd|TrustList|#.xml
<?xml version="1.0" encoding="UTF-8"?>
<TrustList Version="1.0">
	<Trust>
		<Identity><![CDATA[SSK@asdfasdf.../]]></Identity>
		<MessageTrustLevel>0 - 100</MessageTrustLevel>
		<TrustListTrustLevel>0 - 100</TrustListTrustLevel>
		<MessageTrustComment><![CDATA[a short comment]]></MessageTrustComment>
		<TrustListTrustComment><![CDATA[a short comment]]></TrustListTrustComment>
		<IsFMS>true</IsFMS>
		<IsWOT>false</IsWOT>
	</Trust>
	<Trust>
		<Identity><![CDATA[SSK@asdfasdf2.../]]></Identity>
		<MessageTrustLevel>0 - 100</MessageTrustLevel>
		<TrustListTrustLevel>0 - 100</TrustListTrustLevel>
		<MessageTrustComment><![CDATA[a short comment]]></MessageTrustComment>
		<TrustListTrustComment><![CDATA[a short comment]]></TrustListTrustComment>
		<IsFMS>true</IsFMS>
		<IsWOT>false</IsWOT>
	</Trust>
</TrustList>

MessageList

A MessageList is used to alleviate polling for individual messages. It contains a list of messages that this identity posted to each board, as well as the last X posts by other identities. All messages posted within the last X days should be listed. An identity should insert this at least once a day if the file will contain any data, and every time the identity posts a new message.

USK@asdfasdf.../messagebase|yyyy.mm.dd|MessageList/#/MessageList.xml
<?xml version="1.0" encoding="UTF-8"?>
<MessageList>
	<Message>
		<Date>yyyy-mm-dd</Date>
		<Boards>
			<Board><![CDATA[board1]]></Board>
		</Boards>
		<Index>#</Index>
	</Message>
	<Message>
		<Date>yyyy-mm-dd</Date>
		<Boards>
			<Board><![CDATA[board1]]></Board>
			<Board><![CDATA[board2]]></Board>
		</Boards>
		<Index>#</Index>
	</Message>
	<ExternalMessage>
		<!-- Type is "Keyed" or "Anonymous" -->
		<Type>Keyed</Type>
		<!-- If Type = "Keyed" we need the Identity and Index -->
		<Identity><![CDATA[SSK@id1.../]]></Identity>
		<Index>#</Index>
		<!-- message fields as usual -->
		<Date>yyyy-mm-dd</Date>
		<Boards>
			<Board><![CDATA[board3]]></Board>
		</Boards>
	</ExternalMessage>
	<ExternalMessage>
		<Type>Anonymous</Type>
		<!-- If Type = "Anonymous" we need the MessageKey -->
		<MessageKey><![CDATA[KSK@fms|yyyy-mm-dd|AnonymousMessage|#.xml]]></MessageKey>
		<!-- message fields as usual -->
		<Date>yyyy-mm-dd</Date>
		<Boards>
			<Board><![CDATA[board3]]></Board>
		</Boards>				
	</ExternalMessage>
</MessageList>

BoardList

A BoardList contains a list of boards that an identity has recently posted to. Inserting a BoardList once a day should be sufficient.

SSK@asdfasdf.../messagebase|yyyy-mm-dd|BoardList|#.xml
<?xml version="1.0" encoding="UTF-8"?>
<BoardList>
	<Board>
		<Name><![CDATA[fms]]></Name>
		<Description><![CDATA[Freenet Message System]]></Description>
	</Board>
	<Board>
		<Name><![CDATA[freenet]]></Name>
		<Description><![CDATA[Freenet]]></Description>
	</Board>
</BoardList>

IntroductionPuzzle

An IntroductionPuzzle contains a information about a puzzle that an identity must solve to correctly create a key where they can introduce themselves. For a captcha type puzzle, the captcha image is base64 encoded in the message. Every day, or as soon as an identity successfully announces themselves by solving the current puzzle, the client should insert a new puzzle. The UUID of the puzzle should begin with a standard UUID then a @ and then the first part of the inserting identity's SSK (the part between the @ and first ,) with ~ and - removed. This should then be checked by the downloading client to verify the source.

SSK@asdfasdf.../messagebase|yyyy-mm-dd|IntroductionPuzzle|#.xml
<?xml version="1.0" encoding="UTF-8"?>
<IntroductionPuzzle>
	<Type>captcha</Type>
	<UUID><![CDATA[UUID + @ + first part of SSK (between @ and first,) with ~ and - removed]]></UUID>
	<MimeType>data mime type</MimeType>
	<PuzzleData>base64 encoded image</PuzzleData>
</IntroductionPuzzle>

IdentityIntroduction

An IdentityIntroduction allows a brand new identity to be introduced into the system. After solving an IntroductionPuzzle, the client should take the SHA1 hash of the solution and insert an IdentityIntroduction. The Hex encoding of the solution hash should be with capital letters (i.e. 255 is FF not ff).

KSK@messagebase|yyyy-mm-dd|puzzleuuid|hexencodedpuzzlesolutionhash.xml
<?xml version="1.0" encoding="UTF-8"?>
<IdentityIntroduction>
	<Identity><![CDATA[SSK@asdfasdf.../]]></Identity>
</IdentityIntroduction>