Skip to content

mailstone/mailstone-verifier

Repository files navigation

MailStone

MailStone Verifier

MailStone Verifier License Go Version

MailStone Verifier is an open-source desktop application for verifying blockchain-anchored emails and attachments. It provides three essential tools:

  1. Hash Calculator - Calculate SHA-256 hashes of files (Email PDFs, attachments, ACK JSON)
  2. TimeStamp Decoder - Decode RFC 3161 TSA timestamps from proof documents
  3. Merkle Verifier - Verify that a file is included in a Merkle tree and reconstruct the root

Features

  • SHA-256 Hash Calculation - Fast and secure hashing of any file
  • RFC 3161 Timestamp Decoding - Extract provider, date, serial number, and hash algorithm
  • Merkle Tree Verification - Reconstruct Merkle root and verify file inclusion
  • Standalone Binaries - No installation required, runs on macOS, Linux, and Windows
  • User-Friendly GUI - Modern web-based interface powered by Wails
  • Open Source - MIT licensed, transparent and auditable

Screenshots

Hash Calculation

Calculate SHA-256 hash of any file with a simple drag-and-drop interface.

Hash Calculation tab

TimeStamp Decoder

Decode Base64-encoded TSA timestamp tokens and view provider, date, serial number and hash algorithm.

TimeStamp Decoder tab

Merkle Verification

Verify file inclusion in the Merkle tree and reconstruct the root hash from the proof JSON.

Merkle Verification tab


Installation

Download Pre-built Binaries

Download the latest release for your platform from the Releases page:

  • macOS: mailstone-verifier-darwin-amd64 (Intel) or mailstone-verifier-darwin-arm64 (Apple Silicon)
  • Linux: mailstone-verifier-linux-amd64
  • Windows: mailstone-verifier-windows-amd64.exe

Make the binary executable (macOS/Linux):

chmod +x mailstone-verifier-*
./mailstone-verifier-darwin-arm64

Build from Source

Automatic Setup (Recommended)

Run the setup script to install all dependencies automatically:

# Clone the repository
git clone https://github.com/mailstone/mailstone-verifier.git
cd mailstone-verifier

# Run setup script (installs Wails + dependencies)
./setup.sh

# Run in development mode
make dev

Manual Setup

Prerequisites:

  • Go 1.24 or higher
  • Wails v2 (go install github.com/wailsapp/wails/v2/cmd/wails@latest)
  • Platform dependencies (see BUILD.md)

Steps:

# Clone the repository
git clone https://github.com/mailstone/mailstone-verifier.git
cd mailstone-verifier

# Install dependencies
go mod download

# Add GOPATH/bin to PATH
export PATH=$PATH:$(go env GOPATH)/bin

# Run in development mode
wails dev

# Build for your platform
wails build

# Cross-compile for other platforms
wails build -platform darwin/amd64,darwin/arm64,linux/amd64,windows/amd64

Binaries will be in the build/bin/ directory.


Usage

1. Hash Calculation

Purpose: Calculate the SHA-256 hash of a file to verify its integrity.

Steps:

  1. Open the Hash Calculation tab
  2. Click to browse or drag & drop a file (Email PDF, attachment, ACK JSON)
  3. Click Generate SHA-256 Hash
  4. Copy the hash to clipboard using the copy button

Use Case: Compare this hash with the hash listed in your MailStone proof document to verify the file hasn't been tampered with.


2. TimeStamp Decoder

Purpose: Decode RFC 3161 TSA timestamp tokens to view timestamp details.

Steps:

  1. Open the TimeStamp Decoder tab
  2. Copy the Base64-encoded timestamp token from your proof document (starts with MII...)
  3. Paste it into the textarea
  4. Click Decode TimeStamp

Output:

  • Provider: TSA authority (e.g., MailStone TimeStamp, Unataca, FreeTSA)
  • Date & Time: Exact timestamp in UTC
  • Serial Number: Unique identifier for this timestamp
  • Hash Algorithm: Algorithm used (e.g., SHA-256, SHA-256)
  • Status: GRANTED or FAILED

3. Merkle Verification

Purpose: Verify that a file is included in the Merkle tree and reconstruct the root.

Steps:

  1. Open the Merkle Verification tab
  2. Paste the Merkle JSON from your proof document into the first textarea
  3. Paste the hash you want to verify into the second input field (you can use the hash from Tab 1)
  4. Click Verify Merkle Proof

Output:

  • Success: Calculated root matches expected root (file is authentic)
  • Failure: Roots don't match (file may be tampered with)
  • Position: Leaf index in the tree (e.g., Leaf #2 / 3 total leaves)
  • Type: Entity type (EMAIL, ATTACHMENT, ACK)
  • Merkle Path: Step-by-step reconstruction (click to expand)

Merkle JSON Format

The Merkle JSON should follow this format (from MailStone proof documents):

{
  "blockchain": {
    "ledger": "1435173",
    "network": "testnet",
    "provider": "Stellar",
    "tx_hash": "46e9a41208459bffeb9d68288be4f151326c5cc1a665519b15549d88f383512d"
  },
  "leaf_count": 3,
  "leaves": [
    {
      "entity_id": "caecb78e-30a6-46db-bde7-2460f81f7d84",
      "entity_type": "email",
      "leaf_hash": "95936cb47dc3de3b84ff43bf40476f779555db241f616c0c95f9224a59a4be44",
      "leaf_index": 0,
      "merkle_path": [
        {
          "level": 0,
          "position": "LEFT",
          "sibling_hash": "fbaf52109b712e295d2a398f025ccacec47cf2e732409f268a6cf429bb4bd996"
        }
      ]
    }
  ],
  "root_hash": "d94edba57b23719c0be436e51d4f408b6e19635856197874900ebd76992c7942"
}

Development

Project Structure

mailstone-verifier/
├── main.go                 # Wails entry point
├── app.go                  # Backend API (CalculateHash, DecodeTimestamp, VerifyMerkle)
├── internal/
│   ├── hasher/             # SHA-256 hash calculation
│   ├── timestamp/          # RFC 3161 timestamp decoder
│   └── merkle/             # Merkle tree verification
├── frontend/
│   ├── index.html          # UI with 3 tabs
│   ├── style.css           # Modern styling
│   └── app.js              # Frontend logic
├── go.mod
├── wails.json
├── README.md
└── LICENSE

Technologies

  • Backend: Go 1.24+
  • Frontend: HTML/CSS/JavaScript (vanilla, no frameworks)

Running Tests

# Run all tests
go test ./...

# Run with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


About MailStone

MailStone is a blockchain-based email certification platform that provides cryptographic proof of email authenticity and timestamp. Learn more at mailstone.io.


Acknowledgments


Made with ❤️ by the MailStone team

About

MailStone Autonomous Evidence Verifier

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors