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 @@ -Client(e.g. Node.js,MetaMask)Oasis Web3GatewayOasis NodeSapphireParaTime ClientOasis NodeSapphire ParaTimeCompute 🔒Oasis NodeKey Manager🔒R is cacheduntil the endof epochopt[Encrypt Call]opt[Sign Call]opt[Encrypted Call]opt[EncryptedCall]opt[EncryptedCall]Create calldata1Get ephemeralpublic key R2Get ephemeralpublic key R3Get ephemeralpublic key R4Derive per-epochper-runtimekeypair R, R'5Ephemeral public key R6Ephemeralpublic key R7Ephemeralpublic key R8Generate X25519keypair C, C'9Derive shared keyK' = X25519(C', R)10Encrypt call datawith Deoxys-II usingshared key K'11Attach C12Sign callwith User'sSecp256k1/Ed25519key13eth_call14eth_call15Validate call16eth_call17Get ephemeralprivate key R'18Check runtimepolicy for caller19Derive per-epochper-runtimekeypair R, R'20Ephemeralprivate key R'21Derive shared keyK' = X25519(C, R')22Decrypt Deoxys-IIenvelope using K'23Get c10l contractstate keypair S, S'24Check runtimepolicy for caller25Derive per-contractper-runtimekeypair S, S'26Contract statekeypair S, S'27Fetch contract code28C10l contract executionusing S, S' to readstorage29Encrypt callresult with K'30Call result31Call result32Call result33Decrypt call resultusing K'34Client(e.g. Node.js,MetaMask)Oasis Web3GatewayOasis NodeSapphireParaTime ClientOasis NodeSapphire ParaTimeCompute 🔒Oasis NodeKey Manager🔒 \ 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 @@ -Client(e.g. Node.js,MetaMask)Oasis Web3GatewayOasis NodeSapphireParaTime ClientOasis NodeSapphire ParaTimeCompute 🔒Oasis NodeKey Manager🔒R is cacheduntil the endof epochopt[Encrypt Transaction]opt[Encrypted Transaction]alt[EncryptedTransaction][UnencryptedTransaction]Proposer node addstransaction, state andreceipt in new blockWait for new blockopt[EncryptedTransaction-]Create transactioncall data1Get ephemeralpublic key R2Get ephemeralpublic key R3Get ephemeralpublic key R4Derive per-epochper-runtimekeypair R, R'5Ephemeral public key R6Ephemeralpublic key R7Ephemeralpublic key R8Generate X25519keypair C, C'9Derive shared keyK' = X25519(C', R)10Encrypt call datawith Deoxys-II usingshared key K'11Attach C12Sign transactionwith User'sSecp256k1/Ed25519key13eth_sendRawTx14eth_sendRawTx15Validatetransaction16eth_sendRawTx17Get ephemeralprivate key R'18Check runtimepolicy for caller19Derive per-epochper-runtimekeypair R, R'20Ephemeralprivate key R'21Derive shared keyK' = X25519(C, R')22Decrypt Deoxys-IIenvelope using K'23Get c10l contractstate keypair S, S'24Check runtimepolicy for caller25Derive per-contractper-runtimekeypair S, S'26Contract statekeypair S, S'27Fetch contract code28C10l contract executionusing S, S' to read andwrite storage29Obtain newstate root30Transaction receipt:encrypt tx status with K',unencrypted logs31Transaction receipt:unencrypted tx statusand logs32Transactionreceipt33Decrypt tx statusfrom receiptusing K'34Client(e.g. Node.js,MetaMask)Oasis Web3GatewayOasis NodeSapphireParaTime ClientOasis NodeSapphire ParaTimeCompute 🔒Oasis NodeKey Manager🔒 \ 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",