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

Update distribution with dashboard documentation #84

Open
wants to merge 6 commits into
base: main
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
Binary file added docs/03-originate/images/002-create_new_auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/03-originate/images/003-join_identity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/03-originate/images/01-assign-key2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/03-originate/images/03-CEO2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/03-originate/images/04-ACME-context2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/03-originate/images/30-three-keys2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/03-originate/originate-introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ Let's see how this looks in the Token Studio exercise where you originate your v
## Links

- [Asset Documentation](/polymesh-docs/primitives/assets/)
- For developers, the [asset pallet documentation](https://docs.polymesh.live/pallet_asset/index.html)
- For developers, the [asset pallet documentation](https://docs.polymesh.live/pallet_asset/index.html)
35 changes: 19 additions & 16 deletions docs/03-originate/secondary-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ sidebar_position: 4
title: Secondary Keys
description: Assigning authority
---

<YoutubePlayer videoId="Osb4Dnf8rvI" />

## ACME Corporation

So far we have seen that obtaining the wallet software, verifying your ID and issuing a security token are surprisingly simple. However, the examples given were somewhat simplistic to avoid complicating matters with adjacent concerns.
Expand All @@ -20,29 +17,29 @@ Let's resolve this.

The goal is that ACME should be an **identified organisation** that has passed customer due diligence and Alice has, in addition to her personal wallet, a **signing key** to use when she represents ACME in her capacity as CEO.

There is more than one way to do this. Alice, can, for example, create another key for ACME. With that key in focus (click the blue circle to the left of the unassigned key), complete [customer due diligence](/docs/quickstart/verification-with-cdd). This will create a new primary key and a new account. Then, create a secondary key for the CEO and assign it to the new account.
There is more than one way to do this. Alice, can, for example, create another key for ACME. With that key in focus (click on the top of the portal and choose the unassigned key from the dropdown), complete [customer due diligence](/docs/quickstart/verification-with-cdd). This will create a new primary key and a new account. Then, create a secondary key for the CEO and assign it to the new account.

![Alice and secondary keys](images/primary_secondary_keys.png)

Why would you do that? Key management policy is unique to each organisation, but it is anticipated that organisations will not want to use their primary keys for ordinary operations even for the CEO. That is to say, the CEO should use a secondary key known only to the CEO, and not the primary key that can assign and unassign secondary keys to the account and set permissions.

Alice could dismiss the preceding suggestion and do it all from one wallet, i.e. wearing all of the hats and the end result would look approximately like the illustration below, which is perfectly acceptable for practice and learning. Alice has primary keys for herself, for ACME Corp, and a CEO key she would use for most ACME-related activities.

![all three keys](images/30-three-keys.png)
![all three keys](images/30-three-keys2.png)

Let's instead proceed as though ACME and Alice are indeed **separate entities**. Possibly ACME existed before Alice became CEO and ACME's keys are managed by separate personnel. How would that work?

## Use another computer or browser

Let's suppose that the ACME account is managed by someone other than Alice. We can simulate this by using a different computer. This procedure closely matches a real-world scenario where these activities would indeed occur separately. For this, the following is necessary:

1. Create a [wallet](/docs/quickstart/wallet/) and PID for ACME;
1. Create a [wallet](/docs/quickstart/wallet/) and a key for ACME;
2. Complete [customer due diligence](/docs/quickstart/verification-with-cdd);
3. [Get some POLYX](/docs/quickstart/quickstart-polyx) (ACME will need some too).

Below, you can see ACME has been verified and has some POLYX.

![assign key](images/01-assign-key.png)
![assign key](images/01-assign-key2.png)

## Create a secondary key

Expand All @@ -68,31 +65,37 @@ In case that is unclear, the flow would be:

As we will see below, Alice's consent will be required for step 5 in the business process.

Now that ACME has the key Alice provided, return to ACME's wallet and dashboard, navigate to the `Account` tab and press `Assign a key`. You will see that the UI permits the operator to paste _any_ Polymesh key into the form. Paste Alice's key there, give the account a nickname, e.g. Alice (our CEO), and verify the transaction.
Now that ACME has the key Alice provided, return to ACME's wallet and portal, navigate to the `Authorizations` tab and click on `Create New Auth`.

![create new auth](images/002-create_new_auth.png)

Select 'Join Identity' as the authorization type. You will see that the UI permits the operator to paste _any_ Polymesh key into the form. Paste Alice's key there, and an expiry date for the authorization in case it's needed, then click on 'Create' and verify the transaction.

![join identity](images/003-join_identity.png)

Of course, ACME cannot do that without Alice's consent. After all, it is Alice's key.

Back to Alice's wallet, dashboard, and `Accounts` tab, see that Alice is informed that ACME wants to assign _her key_ to _their account_.
Back to Alice's wallet, portal, and `Authorizations` tab, see that Alice is informed that ACME wants to assign _her key_ to _their account_.

:::tip

Press the icon to the left of Alice's secondary key to bring the correct account into focus. This is how Alice chooses the key to use for signing at any given time. The header information in the wallet changes to reflect this and the web UI senses the change and refreshes to display the new context.
Click on the dropdown icon at the top right of the page then select the key to bring the correct account into focus. This is how Alice chooses the key to use for signing at any given time.

:::

![images](images/02-approve-assignment.png)
![images](images/02-approve-assignment2.png)

Since Alice is the CEO and gave ACME her key for this purpose, she expects this and, after checking the requesting account, approves the assignment.

![ceo](images/03-CEO.png)
![ceo](images/03-CEO2.png)

Alice's wallet will now have **two signing keys**, one for her personal concerns and one to use in her capacity as CEO. The wallet will change as she switches between these roles. Here, her personal signing key is in focus. The header and the accounts page on the dashboard reflect this context - this is Alice's personal account.

![alice's ceo key](images/03-CEO.png)
![alice's ceo key](images/03-CEO2.png)

She can change context by clicking on the little blue circle to the left of ACME CEO. This brings the CEO signing key into focus. Notice that the header region of the wallet updates to reflect this, and the accounts website refeshes immediately to show the ACME account where she is a signer.
She can change context by clicking on the dropdown icon at the top right of the page then select the relevant key. This brings the CEO signing key into focus. Notice that the header region of the wallet updates to reflect this, and the accounts website refeshes immediately to show the ACME account where she is a signer.

![ceo context](images/04-ACME-context.png)
![ceo context](images/04-ACME-context2.png)

## Transfer token ownership

Expand Down Expand Up @@ -144,4 +147,4 @@ ACME will need some POLYX to pay transaction fees. If they don't already have so

## Summary

Accounts can delegate authority to other users using secondary keys. Users can generate secondary keys for each area of responsibility and safely provide others with the public-facing identifiers. Users can assign keys that belong to other users to their own account, but only if the owners of those keys (who exclusively have the private keys) consent to the assignment.
Accounts can delegate authority to other users using secondary keys. Users can generate secondary keys for each area of responsibility and safely provide others with the public-facing identifiers. Users can assign keys that belong to other users to their own account, but only if the owners of those keys (who exclusively have the private keys) consent to the assignment.
Binary file added docs/04-distribute/images/18-incoming2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/04-distribute/images/19-to-portolio2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/04-distribute/images/24-accepting2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/04-distribute/images/28-unassigned2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/04-distribute/images/29-to-cold2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/04-distribute/images/30-stored2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 11 additions & 13 deletions docs/04-distribute/with-dashboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ title: Token Studio Dashboard
description: Distribute assets with no code
---

<YoutubePlayer videoId="IwyXvbk11nw" />

## Exercise

In _[Origination](/docs/originate/dashboard)_, ACME originated an asset. No shares exist yet.
Expand Down Expand Up @@ -89,39 +87,39 @@ Now, when the transaction has confirmed, ACME will see a _pending_ distribution.

Unlike most blockchains where transfers are final, a security token cannot be transferred without the consent of the recipient because the receipt may have legal or tax implications and the recipient may not agree. Therefore, the system waits for Alice to _accept_ the distribution.

Switch to Alice's personal Polymesh account by bringing her personal primary key into focus in the wallet. Navigate to the dashboard `Portfolios` tab where Alice's incoming transfer is displayed.
Switch to Alice's personal Polymesh account by bringing her personal primary key into focus in the wallet. Navigate to the portal `Transfers` tab where Alice's incoming transfer is displayed.

![incoming](images/18-incoming.png)

These shares are of upmost importance to Alice and she doesn't want to hold them in her default portfolio. Instead, she wants to create a special portfolio for them - **Portfolios** are _logical containers that help manage permission or organise holdings_.

Below holdings, click `Create Portfolio`.
Open the Portfolios tab on the portal and click `Add Portfolio`.

![create portfolio](images/19-to-portolio.png)
![create portfolio](images/19-to-portolio2.png)

Create a new portfolio called "cold store".

![create cold store](images/20-create-cold-store.png)
![create cold store](images/20-create-cold-store2.png)

Alice can now accept or reject the incoming transfer. Select `Accept` next to the incoming transfer, confirm, and sign.
Alice can now accept or reject the incoming transfer. Go back to the Transfers tab then select `Approve` to accept the incoming transfer, confirm, and sign.

![accept](images/24-accepting.png)
![accept](images/24-accepting2.png)

In a moment, the shares arrive in the default portfolio.

![accepted](images/28-unassigned.png)
![accepted](images/28-unassigned2.png)

Now, it is a simple matter of moving Alice's shares from her default portfolio to her cold store portfolio.

Click the `Send` button and specify that 20,000 ACME shares should be moved to Alice's cold store portfolio. This happens without the accept/reject flow because there is no change of ownership.
Click the `Move` button and specify that 20,000 ACME shares should be moved to Alice's cold store portfolio. This happens without the accept/reject flow because there is no change of ownership.

![to cold store](images/29-to-cold.png)
![to cold store](images/29-to-cold2.png)

**Success!**

Alice has 20,000 ACME shares in her cold store portfolio.

![success](images/30-stored.png)
![success](images/30-stored2.png)

## Summary

Expand All @@ -137,4 +135,4 @@ Let's briefly summarise:
## Links

- [Polymesh Portal](https://portal.polymesh.network)
- [Token studio](https://tokenstudio.polymath.network/)
- [Token studio](https://tokenstudio.polymath.network/)
Loading