Schema
{
id: STRING[255],
type: STRING[15],
subtype: STRING[15],
creator: STRING[65535],
createdAt: UINT64,
payload: OBJECT, // Depends on message type
} Name
Type
Description
const type = hexString(message.type.toUpperCase()); // e.g. "POST" -> 504f5354
const subtype = hexString(message.subtype.toUpperCase());
const creator = hexString(message.creator); // ETH address
const createdAt = hexUint32(message.createdAt); // e.g. 1624773198 -> 60D8124E
const payload = hex(message.payload); // hex order based on message types
const encode = [
uint8len(hash), hash, // "POST" -> 504f5354 -> 8504f5354
uint8len(subtype), subtype, // "" -> "" -> 0
uint16len(creator), creator, // "bob.eth" -> 626f622e657468 -> 000e626f622e657468
createdAt, // 1624780498 -> 0000000060d82ed2
payload
].join('');
const messageHash = crypto.createHash('sha256').update(encode).digest('hex');
const messageId = creator + '/' + messageHash; // e.g. 0x1234...7890/42740f20aed483b69701a55ab295a2ed Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Last updated