ADR-289: Explorer Client Scenes Signed Fetch

More details about this document
Latest published version:
https://adr.decentraland.org/adr/ADR-289
Authors:
lpetaccio
pentreathm
nachomazzara
gonpombo8
Feedback:
GitHub decentraland/adr (pull requests, new issue, open issues)
Edit this documentation:
GitHub View commits View commits on githistory.xyz

Abstract

This document describes how the Signed Fetch functionality works in the Explorer Client for Decentraland scenes. It details the structure and purpose of the scene-specific metadata headers that are included when scenes perform HTTP requests. The Explorer Client extends the Signed Fetch mechanism defined in ADR-44 with additional contextual metadata including scene identity, parcel location, realm information and a specific signer, the decentraland-kernel-scene enabling external services to verify the origin and context of requests.

Context, Reach & Prioritization

Context

The Explorer Client runs scenes that interact with external HTTP services. When scenes make requests on behalf of users, additional context beyond the basic Signed Fetch mechanism is valuable for external services. The Explorer Client includes scene-specific metadata in signed requests to provide:

This additional metadata enables external services to verify not only the user's identity but also the scene context from which the request originates.

Important: The Explorer Client controls the entire signature generation process, ensuring that all metadata accurately reflects the true context of the request and cannot be forged by malicious scene code.

Reach

This specification impacts:

Specification

Overview

The Explorer Client Signed Fetch functionality extends ADR-44 by including scene-specific metadata in the signature. This metadata is included in the X-Identity-Metadata header and is part of the signed payload, ensuring its integrity and authenticity.

Signature Metadata Structure

The signature metadata includes contextual information about the scene making the request:

{
  "sceneId": "bafkreiabcdef...",
  "parcel": "52,68",
  "tld": "org",
  "network": "mainnet",
  "isGuest": false,
  "signer": "decentraland-kernel-scene",
  "realm": {
    "hostname": "peer.decentraland.org",
    "protocol": "v3",
    "serverName": "realm-1"
  },
  "hashPayload": "a3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}

Metadata Fields

Body Hashing

When a request includes a body, it MUST be hashed using SHA-256. The request body is encoded as UTF-8 bytes before hashing. The resulting hash is a lowercase hexadecimal string that is included in the signature metadata as hashPayload.

For example, an empty JSON object {} would produce:

44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a

Security Considerations

Trusted Execution Environment

The Signed Fetch process is implemented and executed exclusively within the Explorer Client's trusted environment. Scene code running within the client cannot access, modify, or forge any of the metadata headers that are included in the signature. This architectural boundary ensures that:

The Explorer Client validates and populates all metadata fields based on its internal state before generating the signature. This prevents malicious scenes from crafting fraudulent signed requests.

Request Replay Prevention

The signature metadata includes several fields that prevent request replay:

References

RFC 2119 and RFC 8174

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.

License

Copyright and related rights waived via CC0-1.0. Living