Session event emits the customer's MAC address in the p tag — spec-invalid value on every payment response
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
Bắt đầu từ createSessionEvent trong src/merchant/merchant.go, nơi sự kiện kind-1022 đặt customerPubkey vào thẻ p, và tại nơi gọi duy nhất của nó trong PurchaseSession, hàm truyền địa chỉ MAC. Xóa thẻ p khỏi sự kiện phiên và giữ nguyên device-identifier. Trước khi chỉnh sửa, hãy dùng grep trong các bộ kiểm tra tuân thủ của portal và PRTA để tìm bất kỳ bên nào đọc thẻ p, vì issue nói rằng điều này hiển thị trên đường truyền. Hoàn thành khi sự kiện phiên không còn thẻ p và các bài kiểm thử của gói merchant vẫn chạy đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found while resolving the spec divergence tollgate#16 (spec PR: tollgate#26).
Evidence
createSessionEvent in src/merchant/merchant.go declares a customerPubkey parameter and puts it straight into the kind-1022 session event's p tag:
func (m *Merchant) createSessionEvent(session *CustomerSession, customerPubkey string) (*nostr.Event, error) {
deviceIdentifier := session.MacAddress
...
Tags: nostr.Tags{
{"p", customerPubkey},
{"device-identifier", "mac", deviceIdentifier},
Its only call site passes the MAC address (src/merchant/merchant.go, PurchaseSession):
sessionEvent, err := m.createSessionEvent(session, macAddress)
So every payment response carries the customer's MAC in p — a value that is not a Nostr pubkey. Consequences: #p relay-side filtering of session events can never match anything; any spec-conformant consumer validating p as a pubkey rejects our session events; and the MAC — which device-identifier already carries — is duplicated into a field whose contract says pubkey.
Why it happens
Pre-March-2026 the payment was a signed kind=21000 event, so a customer pubkey existed. The raw-token rework removed the identity source; the parameter was never revisited.
Suggested fix
In the raw-token flow there is no customer Nostr identity, so the spec-conformant behavior is to omit the p tag (the spec PR above makes p conditional and forbids non-pubkey values in it). If the legacy kind=21000 envelope ever carries a verified customer pubkey, that is the one case where p could be filled.
Note the change is wire-visible on every successful payment response (the shipped portal and PRTA conformance suites should be checked for anything reading the p tag — grep suggests the portal keys on allotment/metric, but that is worth confirming in review, not assuming).
Also noted there
The same function emits a start-time tag TIP-01 does not document — flagged on the spec PR as a separate documentation proposal, not part of this fix.
- Ngôn ngữ chính
- Go
- Star
- 12
- Fork
- 14
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 201
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenTollGate/tollgate-module-basic-go
-
changelog: dependency-security sweep missing from [Unreleased] [Amperstrand fork #105 review debt]Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
OpenTollGate/tollgate-module-basic-go#1055 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenTollGate/tollgate-module-basic-go#1027 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenTollGate/tollgate-module-basic-go#1026 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OpenTollGate/tollgate-module-basic-go#833 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của OpenTollGate/tollgate-module-basic-go
Issue tương tự
-
area: records fast-track-debt priority: normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
processor/genainormalizer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
open-telemetry/opentelemetry-collector-contrib#52328 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[tooling] Example acceptance runner reports ALL PASS for an unsupported program (tested patch)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
limitlessprojects/Go-Hybrid#1595 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
provider: hyper
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
charmbracelet/crush#4134 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AvengeMedia/DankMaterialShell#3912 ·