Test Vectors
Concrete examples for implementation verification.
Content Hash Computation
Input (POST content):
# Hello World
This is my first post on epress.
Computation:
content = "# Hello World\n\nThis is my first post on epress.\n"
hash = SHA-256(UTF-8.encode(content))
contentHash = "0x" || hex(hash)
CreateConnection
Scenario: Alice (0x742d35Cc6634C0532925a3b844Bc9e7595f3aB1d) follows Bob (0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199).
Typed Data:
{
"domain": {
"name": "epress world",
"version": "1",
"chainId": 1
},
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "version", "type": "string" },
{ "name": "chainId", "type": "uint256" }
],
"CreateConnection": [
{ "name": "followerAddress", "type": "address" },
{ "name": "followeeAddress", "type": "address" },
{ "name": "followeeUrl", "type": "string" },
{ "name": "followerUrl", "type": "string" },
{ "name": "timestamp", "type": "uint64" }
]
},
"primaryType": "CreateConnection",
"message": {
"followerAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f3aB1d",
"followeeAddress": "0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199",
"followeeUrl": "https://bob.example.com",
"followerUrl": "https://alice.example.com",
"timestamp": 1705312800
}
}
DestroyConnection
Typed Data:
{
"domain": {
"name": "epress world",
"version": "1",
"chainId": 1
},
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "version", "type": "string" },
{ "name": "chainId", "type": "uint256" }
],
"DestroyConnection": [
{ "name": "followerAddress", "type": "address" },
{ "name": "followeeAddress", "type": "address" },
{ "name": "timestamp", "type": "uint64" }
]
},
"primaryType": "DestroyConnection",
"message": {
"followerAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f3aB1d",
"followeeAddress": "0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199",
"timestamp": 1705312800
}
}
StatementOfSource
Typed Data:
{
"domain": {
"name": "epress world",
"version": "1",
"chainId": 1
},
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "version", "type": "string" },
{ "name": "chainId", "type": "uint256" }
],
"StatementOfSource": [
{ "name": "contentHash", "type": "bytes32" },
{ "name": "publisherAddress", "type": "address" },
{ "name": "timestamp", "type": "uint64" }
]
},
"primaryType": "StatementOfSource",
"message": {
"contentHash": "0xabc123def4567890123456789012345678901234567890123456789012345678",
"publisherAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f3aB1d",
"timestamp": 1705312800
}
}
Profile Response
{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f3aB1d",
"url": "https://alice.example.com",
"title": "Alice's Node",
"description": "Personal publishing node",
"ewpVersion": "1",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-06-15T12:30:00.000Z"
}
Publications Response
{
"data": [
{
"contentHash": "0xabc123def4567890123456789012345678901234567890123456789012345678",
"publisherAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f3aB1d",
"signature": "0x3040506070809010203040506070809010203040506070809010203040506070...",
"timestamp": 1705312800,
"createdAt": "2024-06-15T10:30:00.000Z",
"contentKind": "POST",
"slug": "my-first-post"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
}
Error Response
{ "error": "INVALID_SIGNATURE" }