To start the slide show, press ‘A’. Return to the index with ‘A’ or ‘Esc’. On a touch screen, use a 3-finger touch. Double click to open a specific slide. In slide mode, press ‘?’ (question mark) to get a list of available commands.

Leaving slide mode.

W3C MiniApps: Evolution and Challenges in the Standardization

Martin Alvarez-Espinar

ACM Workshop on
Secure and Trustworthy Superapps (SaTS)
Co-located with ACM CCS 2024
Salt Lake City, USA
14 October 2024

Me

#developer #interop #EU #w3c #huawei #standards

Contents

  1. How it all started
  2. MiniApp standardization
  3. Status of the specs
  4. Challenges

Light apps ecosystem

Several MiniApp versions depending on SuperApps

Light apps ecosystem

Incremental image from previous one, plus PWAs and Isolated Web Apps

Light apps

Incremental image from previous one, plus some other apps like KaiOS apps

Light apps

Incremental image from previous one, plus App Clips for iOS

Light apps

Incremental image from previous one, plus Atomic Services for HarmonyOS

Light apps

Incremental image from previous one, plus several for Android, including WebAPKs, Instant Apps, Quick Apps...

Challenges

I wish...

coding ~once, run everywhere...

Based on Web

<template>
  <div class="main-page">
    <text class="title">{{title}}</text>
    <input type="button" onclick="changeText" />
  </div>
</template>

Based on Web

<template>
  <div class="main-page">
    <text class="title">{{title}}</text>
    <input type="button" onclick="changeText" />
  </div>
</template>

But... we don't interact directly with DOM

<script>
  export default {
    private: {
      title: 'This is a quick app'
    },
    changeText () {
      this.title = 'hello world'
    }
  }
</script>

But... we don't interact directly with DOM

<script>
  export default {
    private: {
      title: 'This is a quick app'
    },
    changeText () {
      this.title = 'hello world'
    }
  }
</script>

And... Wait!

<template>
  <div class="main-page">
    <text class="title">{{title}}</text>
    <input type="button" onclick="changeText" />
  </div>
</template>

Architecture

Different blocks in a layer from bottom to the top: OS and Hardware, a bridge, two engines and front-end framework

Execution environment

Services and APIs

Contents

  1. How it all started
  2. MiniApp standardization
  3. Status of the specs
  4. Challenges

We decided to create a homogeneous ecosystem

W3C

Standards to:

World Wide Web Consortium

Organization

Technical Reports, including Recommendations and Group Notes

How the work is done?

Members propose topics, work on them through

Liaisons with other SDOs

Ecma International, FIDO, ISO...

MiniApps @ W3C back in 2019

Timeline from incubation (starting in 2019) to standardization (in progress today)

WG Charter

Charter of MiniApps WG

WG Charter: background

Section in the charter about background

WG Charter: scope

Section in the charter about scope

WG Charter: deliverables

Section in the charter about deliverables

WG Charter: success

Section in the charter about success criteria

WG Charter: Patent Policy

Section about patents and IPR and usage of the specs

Deliverables: Working Drafts

Timeline with some specifications published in 2021 onwards

How do we create a new spec?

Always working in public

Github repository for a MiniApp specification

First step for a new proposal: explainer

Explainer document

Objectives, use cases, scope, first proposal...

Definitions, processing algorithms, WebIDL descriptions...

Section in the specifications with definitions

Also practical support

Section in the specifications with notes for developers

Notes for developers to help implementations

I18n and accessibility in every spec

Section in the specifications about Accessibility

Horizontal review to preserve the principle of a Web for everyone (i.e., independently of culture, physical, functional and cognitive capabilities of the users)

Security in every spec

Section in the specifications about Security

Horizontal review to minimize the threats in every specification (i.e., sandbox, threat model...)

Privacy in every spec

Section in the specifications about Privacy

Horizontal review to preserve user's privacy in every specification (i.e., keep sandboxed environment, avoid tracking users...)

Success criteria: we need tests

Timeline showing test suite at the end

Process (stages of a spec)

Specs are horizontally reviewed on i18n, a11y, privacy and security.

The Technical Architecture Group (TAG) plays an important role

Specification different stages

Contents

  1. How it all started
  2. MiniApp standardization
  3. Status of the specs
  4. Challenges

MiniApp Lifecycle

Specific events and an interface for the MiniApp object and its pages

MiniApp lifecycle:

launched, shown, hidden, error

Page lifecycle:

loaded, ready, shown, hidden, unloaded

Status: WD

MiniApp Addressing

URIs for MiniApps

platform://miniapp/foo;version=1.0.1/pages/index?k=v#bar

https://platform.org/miniapp/foo;version=1.0.1/pages/index?k=v#bar

Status: Group Draft Note

MiniApp Widgets Requirements

Scenarios and requirements for MiniApp Widgets (particular MiniApp pages)

Placed in a specific area of a device

Status: Group Note

MiniApp Manifest

JSON document to describe a MiniApp

Status: WD

Content Security Policy (CSP)

Increase security and integrity of MiniApps

Manifest CSP

Reuse of ongoing IWA proposal?

Content-Security-Policy: base-uri 'none';
      default-src 'self';
      object-src 'none';
      frame-src 'self' https: blob: data:;
      connect-src 'self' https: wss: blob: data:;
      script-src 'self' 'wasm-unsafe-eval';
      img-src 'self' https: blob: data:;
      media-src 'self' https: blob: data:;
      font-src 'self' blob: data:;
      style-src 'self' 'unsafe-inline';
      require-trusted-types-for 'script';
    

Open discussion

MiniApp Packaging

Describes the logical and physical structure of a MiniApp

Status: WD

Types of Resources

Breakout of components in miniapp package

Pages & Components

Current proposal: based on Web Components

File System

Filesystem structure of a miniapp package

Homogeneous structure:

Contents

  1. How it all started
  2. MiniApp standardization
  3. Status of the specs
  4. Challenges

Reviews raised concerns

Timeline highlighting challenges in security

#1: ZIP container

Raised concern of lack of efficiency

#2: Origin model preservation

How to keep track of the origin?

#2: (Origin model) discussions

???

#3: Guarantee secure context

How to guarantee integrity?

#3: (Integrity) ongoing discussions

Based on the existing solution:

Ongoing discussion.

Follow IWA approach?

New works on Isolated Web Apps (IWA)

integrity-block = [
    magic: h'F0 9F 96 8B F0 9F 93 A6',
    version: bstr .size 4, ; Version value is '2\0\0\0' for release.
    attributes: {
      "webBundleId" => tstr
    }
    signature-list: [ +integrity-signature ]]

Also, defining permissions in manifest and CSP

May we standardize a global security model for SuperApps?

Avoiding fragmentation

Secure and protecting user privacy

  1. Origin model preservation
  2. Secure context (integrity)
  3. Content security policy
  4. Permission management
  5. ...

Questions?

Thank you!

Join us

MiniApps Ecosystem CG, MiniApp WG

Martin Alvarez-Espinar @espinr