Skip to content

Commit 9abc3a4

Browse files
authored
Merge pull request #3 from Ada40/copilot/add-opentimestamps-workflow
Add OpenTimestamps workflow and documentation for cryptographic commit proofs
2 parents 0b7dba7 + f95128a commit 9abc3a4

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

.github/workflows/ots-stamp.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create OpenTimestamps proof
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
stamp:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Install OpenTimestamps client
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install opentimestamps-client
24+
25+
- name: Create commit SHA file
26+
env:
27+
SHA: ${{ github.sha }}
28+
run: |
29+
echo -n "${SHA}" > commit-sha.txt
30+
ls -l commit-sha.txt
31+
echo "commit: ${SHA}"
32+
33+
- name: Stamp with OpenTimestamps
34+
run: |
35+
# create an ots proof for the commit-sha file
36+
ots stamp commit-sha.txt
37+
ls -l commit-sha.txt*
38+
39+
- name: Upload OTS proof artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: ots-proof-${{ github.sha }}
43+
path: |
44+
commit-sha.txt
45+
commit-sha.txt.ots

TIMESTAMPING-HOWTO.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Public timestamping and proof of existence
2+
3+
This repository includes an automated workflow that creates OpenTimestamps proofs for commits and releases. Below are recommended steps and background to create stronger, verifiable timestamps for your work.
4+
5+
## Why GitHub timestamps alone are not always sufficient
6+
- Git commit metadata includes author and committer dates, which can be changed locally before pushing.
7+
- GitHub release publish times are recorded by GitHub servers and are more trustworthy than local commit dates.
8+
- For cryptographic, tamper-evident proof, combine signed commits/tags with an external timestamping system such as OpenTimestamps or a commercial TSA (RFC3161).
9+
10+
## Recommended practice
11+
1. Create GPG-signed commits or tags
12+
- Configure GPG and git (example):
13+
- `git config user.signingkey <your-key-id>`
14+
- `git config commit.gpgsign true`
15+
- `git commit -S -m "Your signed commit message"`
16+
- For signed tags:
17+
- `git tag -s v1.0.0 -m "Release version 1.0.0"`
18+
19+
2. Use GitHub Releases for major milestones
20+
- Tag and sign a release version:
21+
- `git tag -s v1.0.0 -m "Release 1.0.0"`
22+
- `git push origin v1.0.0`
23+
- Create a GitHub Release from the tag with release notes.
24+
- The workflow will automatically stamp the release commit.
25+
26+
3. Manual OTS stamping (optional, for extra verification)
27+
- Export a commit SHA to a file:
28+
- `git rev-parse HEAD > sha.txt`
29+
- `ots stamp sha.txt`
30+
- Keep `sha.txt` and `sha.txt.ots` together as your proof.
31+
32+
4. Verifying an OTS proof
33+
- Install the OpenTimestamps client and run:
34+
- `ots verify sha.txt`
35+
- The proof will show that the SHA existed at or before the anchored blockchain time.
36+
37+
## Automation in this repo
38+
- The workflow `.github/workflows/ots-stamp.yml` stamps the commit SHA on push and publishes the proof as an artifact named `ots-proof-<commit-sha>`.
39+
- To download the proof:
40+
1. Go to the GitHub Actions tab
41+
2. Click on the workflow run for your commit
42+
3. Download the artifact from the artifacts section
43+
4. Extract and verify with `ots verify commit-sha.txt`
44+
45+
## More information
46+
- OpenTimestamps documentation: https://opentimestamps.org
47+
- GPG signing guide: https://docs.github.com/en/authentication/managing-commit-signature-verification
48+
- RFC3161 timestamping: https://www.ietf.org/rfc/rfc3161.txt

0 commit comments

Comments
 (0)