Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: typos #225

Open
wants to merge 4 commits into
base: gitbook
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let secretPathAddress = "0x3879E146140b627a5C858a08e507B171D9E43139";

`numbers` is the amount of numbers you want to request

`max` is the the max range the numbers can be. So if you set `max` to 200, the largest random number that can be returned is 200
`max` is the max range the numbers can be. So if you set `max` to 200, the largest random number that can be returned is 200

{% code overflow="wrap" %}
```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Update the `routing_contract` and `routing_code_hash` to the contract address an
Next, update[ lines 73-77](https://github.com/SecretFoundation/Secretpath-tutorials/blob/63a1df61cab6b9e863989d779bc6b98665e73509/encrypted-payloads/evm-contract/scripts/encrypt.js#L73) with the EVM wallet address associated with the private key in your env file (`myAddress)`, a key (any `string` of your choosing), a value, (any `string` of your choosing), and a viewing\_key (any `string` of your choosing). 

{% hint style="info" %}
`value` is the the data that you want to encrypt, `key` and `viewing_key` are parameters you pass to encrypt the `value.`
`value` is the data that you want to encrypt, `key` and `viewing_key` are parameters you pass to encrypt the `value.`
{% endhint %}

```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Need help with using encrypted payloads with Snakepath or want to discuss use ca

## Install and import dependencies

First, install all of the the dependencies via NPM:
First, install all of the dependencies via NPM:

```bash
npm install @solar-republic/cosmos-grpc @solar-republic/neutrino ethers secure-random
Expand Down Expand Up @@ -69,7 +69,7 @@ const [myAddress] = await provider.send("eth_requestAccounts", []);

## Generating the encryption key using ECDH

Next, you generate ephermal keys and load in the public encryption key for the Secret Gateway that you can look up in [supported-networks](../../supported-networks/ "mention"). Then, use ECDH to create the encryption key:
Next, you generate ephemeral keys and load in the public encryption key for the Secret Gateway that you can look up in [supported-networks](../../supported-networks/ "mention"). Then, use ECDH to create the encryption key:

```typescript
//Generating ephemeral keys
Expand Down Expand Up @@ -103,7 +103,7 @@ const data = JSON.stringify({ numWords: Number(numWords) })

const callbackAddress = publicClientAddress.toLowerCase();
//This is an empty callback for the sake of having a callback in the sample code.
//Here, you would put your callback selector for you contract in.
//Here, you would put your callback selector for your contract in.
const callbackSelector = iface.getSighash(iface.getFunction("upgradeHandler"))
const callbackGasLimit = Number(callback_gas_limit)
```
Expand Down Expand Up @@ -149,7 +149,7 @@ const ciphertextHash = keccak256(ciphertext)
Next, we use Metamask to sign the `ciphertextHash` using `personal_sign`. Then, we recover the `user_pubkey` from this signed message, which will be also passed into the Public Gateway.

{% hint style="info" %}
Internally, Metamask takes the `ciphertextHash`, preprends the `"\x19Ethereum Signed Message:\n32"` string and then hashes it using Keccak256, which results the `payloadHash`. Metamask actually signs the `payloadHash` to get the signature. Keep this in mind when verifying the signature against the `payloadHash` and NOT the `ciphertextHash`.
Internally, Metamask takes the `ciphertextHash`, prepends the `"\x19Ethereum Signed Message:\n32"` string and then hashes it using Keccak256, which results the `payloadHash`. Metamask actually signs the `payloadHash` to get the signature. Keep this in mind when verifying the signature against the `payloadHash` and NOT the `ciphertextHash`.
{% endhint %}

```typescript
Expand Down Expand Up @@ -198,7 +198,7 @@ const amountOfGas = gasFee.mul(callbackGasLimit).mul(3).div(2);

## Packing the Transaction & Send

Lastly, we pack all the information we collected during previous steps into an `info` struct that we send into the Gateway contract. We the encode the function data. Finally, we set the tx\_params. Please make sure to set an approiate gas amount for your contract call, here we used 150k gas. For the value of the TX, we send over the estimated callback gas that we calculated above.
Lastly, we pack all the information we collected during previous steps into an `info` struct that we send into the Gateway contract. We then encode the function data. Finally, we set the tx\_params. Please make sure to set an appropriate gas amount for your contract call, here we used 150k gas. For the value of the TX, we send over the estimated callback gas that we calculated above.

```typescript
// function data to be abi encoded
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/secret-cli/fees-and-gas.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fees & Gas

On the Secret Network gas is a special unit used for tracking the the use of resources during code execution (usually paid by the transaction sender). Gas fees are normally paid to execute read / write commands, but can also be used to pay for more resource intensive computational tasks. 
On the Secret Network gas is a special unit used for tracking the use of resources during code execution (usually paid by the transaction sender). Gas fees are normally paid to execute read / write commands, but can also be used to pay for more resource intensive computational tasks. 

Gas primarily serves two purposes: 

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Blockchain technology is a complex base layer allowing open-source protocols and decentralized applications to be built on top of it. Secret is a sovereign layer 1 of the Cosmos ecosystem built with the Cosmos SDK.

This section will walk you through the Secret technology stack to get a better understanding of what’s under the hood of the privacy hub for Web3. This "Blockchain technology" section starts with a quick grasp of the different blockchain layers are and an explanation of the Cosmos stack 
This section will walk you through the Secret technology stack to get a better understanding of what’s under the hood of the privacy hub for Web3. This "Blockchain technology" section starts with a quick grasp of what the different blockchain layers are and an explanation of the Cosmos stack 

In this section we will explain in depth the components of the blockchain stack:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A virtual-machine interprets Smart Contracts to change the state of the underlyi

* Specific programming language accepted by the VM
* VM limited set of functions and lack of flexibility
* Smart Contracts are all run by the same virtual machine restraining performance as all application compete for block resources
* Smart Contracts are all run by the same virtual machine restraining performance as all applications compete for block resources
* Limited sovereignty, meaning that the application is dependent of the underlying blockchain governance decision

### Development framework
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following process is based on how Tendermint works to reach consensus in a s
* Outputs are encrypted
5. The block-proposing validator proposes a block containing the encrypted outputs and updated encrypted state
6. At least 2/3 of participating validators achieve consensus on the encrypted output and state following Tendermint BFT
7. The encrypted output and state is committed on-chain to the specific contract
7. The encrypted output and state are committed on-chain to the specific contract

![](<../../.gitbook/assets/image (2).png>)

Expand Down