diff --git a/docs/dapp/diagrams/c10l-smart-contract-call.mmd b/docs/dapp/diagrams/c10l-smart-contract-call.mmd
deleted file mode 100644
index 274a7ad1e8..0000000000
--- a/docs/dapp/diagrams/c10l-smart-contract-call.mmd
+++ /dev/null
@@ -1,63 +0,0 @@
-sequenceDiagram
- autonumber
- participant Client as Client
(e.g. Node.js,
MetaMask)
- participant Web3 as Oasis Web3
Gateway
- participant ClientN as Oasis Node
Sapphire
ParaTime Client
- participant Compute as Oasis Node
Sapphire ParaTime
Compute 🔒
- participant KM as Oasis Node
Key Manager
🔒
-
- Client->>Client: Create call
data
-
- opt Encrypt Call
- Client->>+Web3: Get ephemeral
public key R
- Web3->>+ClientN: Get ephemeral
public key R
- ClientN->>+KM: Get ephemeral
public key R
- KM->>KM: Derive per-epoch
per-runtime
keypair R, R'
- KM-->>-ClientN: Ephemeral public key R
- Note over ClientN: R is cached
until the end
of epoch
- ClientN-->>-Web3: Ephemeral
public key R
- Web3-->>-Client: Ephemeral
public key R
-
- Client->>Client: Generate X25519
keypair C, C'
- Client->>Client: Derive shared key
K' = X25519(C', R)
- Client->>Client: Encrypt call data
with Deoxys-II using
shared key K'
- Client->>Client: Attach C
- end
-
- opt Sign Call
- Client->>Client: Sign call
with User's
Secp256k1/Ed25519
key
- end
-
- Client->>+Web3: eth_call
- Web3->>+ClientN: eth_call
- ClientN->>ClientN: Validate call
- ClientN->>+Compute: eth_call
-
- opt Encrypted Call
- Compute->>+KM: Get ephemeral
private key R'
- KM->>KM: Check runtime
policy for caller
- KM->>KM: Derive per-epoch
per-runtime
keypair R, R'
- KM-->>-Compute: Ephemeral
private key R'
- Compute->>Compute: Derive shared key
K' = X25519(C, R')
- Compute->>Compute: Decrypt Deoxys-II
envelope using K'
- end
-
- Compute->>+KM: Get c10l contract
state keypair S, S'
- KM->>KM: Check runtime
policy for caller
- KM->>KM: Derive per-contract
per-runtime
keypair S, S'
- KM-->>-Compute: Contract state
keypair S, S'
-
- Compute->>Compute: Fetch contract code
- Compute->>Compute: C10l contract execution
using S, S' to read
storage
-
- opt Encrypted Call
- Compute->>Compute: Encrypt call
result with K'
- end
-
- Compute-->>-ClientN: Call result
- ClientN-->>-Web3: Call result
- Web3-->>-Client: Call result
-
- opt Encrypted Call
- Client->>Client: Decrypt call result
using K'
- end
diff --git a/docs/dapp/diagrams/c10l-smart-contract-call.mmd.svg b/docs/dapp/diagrams/c10l-smart-contract-call.mmd.svg
deleted file mode 100644
index 7e419a2cda..0000000000
--- a/docs/dapp/diagrams/c10l-smart-contract-call.mmd.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/docs/dapp/diagrams/c10l-smart-contract-tx.mmd b/docs/dapp/diagrams/c10l-smart-contract-tx.mmd
deleted file mode 100644
index 33b86331a0..0000000000
--- a/docs/dapp/diagrams/c10l-smart-contract-tx.mmd
+++ /dev/null
@@ -1,63 +0,0 @@
-sequenceDiagram
- autonumber
- participant Client as Client
(e.g. Node.js,
MetaMask)
- participant Web3 as Oasis Web3
Gateway
- participant ClientN as Oasis Node
Sapphire
ParaTime Client
- participant Compute as Oasis Node
Sapphire ParaTime
Compute 🔒
- participant KM as Oasis Node
Key Manager
🔒
-
- Client->>Client: Create transaction
call data
-
- opt Encrypt Transaction
- Client->>+Web3: Get ephemeral
public key R
- Web3->>+ClientN: Get ephemeral
public key R
- ClientN->>+KM: Get ephemeral
public key R
- KM->>KM: Derive per-epoch
per-runtime
keypair R, R'
- KM-->>-ClientN: Ephemeral public key R
- Note over ClientN: R is cached
until the end
of epoch
- ClientN-->>-Web3: Ephemeral
public key R
- Web3-->>-Client: Ephemeral
public key R
-
- Client->>Client: Generate X25519
keypair C, C'
- Client->>Client: Derive shared key
K' = X25519(C', R)
- Client->>Client: Encrypt call data
with Deoxys-II using
shared key K'
- Client->>Client: Attach C
- end
-
- Client->>Client: Sign transaction
with User's
Secp256k1/Ed25519
key
- Client->>+Web3: eth_sendRawTx
- Web3->>+ClientN: eth_sendRawTx
- ClientN->>ClientN: Validate
transaction
- ClientN->>Compute: eth_sendRawTx
-
- opt Encrypted Transaction
- Compute->>+KM: Get ephemeral
private key R'
- KM->>KM: Check runtime
policy for caller
- KM->>KM: Derive per-epoch
per-runtime
keypair R, R'
- KM-->>-Compute: Ephemeral
private key R'
- Compute->>Compute: Derive shared key
K' = X25519(C, R')
- Compute->>Compute: Decrypt Deoxys-II
envelope using K'
- end
-
- Compute->>+KM: Get c10l contract
state keypair S, S'
- KM->>KM: Check runtime
policy for caller
- KM->>KM: Derive per-contract
per-runtime
keypair S, S'
- KM-->>-Compute: Contract state
keypair S, S'
-
- Compute->>Compute: Fetch contract code
- Compute->>Compute: C10l contract execution
using S, S' to read and
write storage
- Compute->>Compute: Obtain new
state root
-
- alt Encrypted Transaction
- Compute->>Compute: Transaction receipt:
encrypt tx status with K',
unencrypted logs
- else Unencrypted Transaction
- Compute->>Compute: Transaction receipt:
unencrypted tx status
and logs
- end
-
- Note over Compute: Proposer node adds
transaction, state and
receipt in new block
- Note over Web3: Wait for new block
- Web3-->>-Client: Transaction
receipt
-
- opt Encrypted Transaction
- Client->>Client: Decrypt tx status
from receipt
using K'
- end
diff --git a/docs/dapp/diagrams/c10l-smart-contract-tx.mmd.svg b/docs/dapp/diagrams/c10l-smart-contract-tx.mmd.svg
deleted file mode 100644
index 41b65a6f33..0000000000
--- a/docs/dapp/diagrams/c10l-smart-contract-tx.mmd.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/docs/dapp/sapphire/diagrams b/docs/dapp/sapphire/diagrams
new file mode 120000
index 0000000000..59ca8029ec
--- /dev/null
+++ b/docs/dapp/sapphire/diagrams
@@ -0,0 +1 @@
+../../../external/sapphire-paratime/docs/diagrams
\ No newline at end of file
diff --git a/package.json b/package.json
index 9c15c93b91..6e59476604 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
"docusaurus": "docusaurus",
"start": "docusaurus start --no-open",
"build": "docusaurus build",
- "diagrams": "find docs -name '*.mmd' -exec mmdc -i {} -c mermaid.config.json ';'",
+ "diagrams": "find -L docs -name '*.mmd' -exec mmdc -i {} -c mermaid.config.json ';'",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",