Following the locker and storage room analogy, we said that each locker has
On general blockchain cryptography
On Cardano
GameChanger Wallet assumes no standard, no address type and no credential type. Thanks to Workspaces, it will adapt to user’s needs as far as possible, making it not only a general purpose personal wallet, but also a multisig and script based wallet with a common user interface for all use cases. The universal wallet for Cardano
Let’s learn how to build the 3 type of addresses by creating a new workspaces called My Addresses.
{
"type": "script",
"title": "Building addresses statically ",
"description": "Exploring different ways to build addresses",
"args":{
// a key hash of an specific spend key someone owns
"spendKeyHash":"02b6e8e8a90561ae713c06065ade3e2305d98eab98c8021bef67327b",
// a key hash of an specific stake key someone owns
"stakeKeyHash":"fb141d9fc2787c63e0d72423747c129b1a18a2ac134825314d4960be"
},
"run": {
"usingWorkspaces": {
"type": "loadConfig",
"updateId": "addresses-exercise-1",
"layers": [
// a layer to define the new workspace
{
"type": "Workspace",
"items": [
{
"namePattern": "my_addresses",
"titlePattern": "My Addresses",
"descriptionPattern": "My custom addresses!"
}
]
},
// a layer of type Address to build address artifacts
{
"type": "Address",
//tagged under the "my_addresses" workspace
"workspaceIds": [
"my_addresses"
],
// each item is the recipe on how to build an address and it's linked name artifact
// namePattern is used to create it's linked name artifact
"items": [
{
// Example Base Address: 1 spend and 1 stake credentials
"namePattern": "BaseAddress",
"spendPubKeyHashHex": "{get('args.spendKeyHash')}",
"stakePubKeyHashHex": "{get('args.stakeKeyHash')}"
},
{
// Example Enterprise Address: 1 spend credential
"namePattern": "EnterpriseAddress",
"spendPubKeyHashHex": "{get('args.spendKeyHash')}"
},
{
// Example Reward Address: 1 stake credential
"namePattern": "RewardAddress",
"stakePubKeyHashHex": "{get('args.stakeKeyHash')}"
}
]
}
]
}
}
}
🔍 See also: loadConfig, script
On Workspaces page the new My Addresses workspace will look exactly like this:
When selecting the My Addresses workspace as current, Address Picker will look exactly like this:
Key findings:
</br>
On my wallet on desktop, on your wallet on mobile, and on a wallet on an International Space Station device we will always obtain these 3 addresses on Cardano Pre-Production Testnet:
Artifact Name | Address |
---|---|
BaseAddress | addr_test1qqptd68g4yzkrtn38srqvkk78c3stkvw4wvvsqsmaanny7lmzswelsnc0337p4eyyd68cy5mrgv29tqnfqjnzn2fvzlqy429lh |
EnterpriseAddress | addr_test1vqptd68g4yzkrtn38srqvkk78c3stkvw4wvvsqsmaanny7cxxu9gr |
RewardAddress | stake_test1ura3g8vlcfu8cclq6ujzxaruz2d35x9z4sf5sff3f4ykp0scj3du3 |
</br>
and these exact addresses on Cardano Mainnet:
Artifact Name | Address |
---|---|
BaseAddress | addr1qyptd68g4yzkrtn38srqvkk78c3stkvw4wvvsqsmaanny7lmzswelsnc0337p4eyyd68cy5mrgv29tqnfqjnzn2fvzlq8rh9ng |
EnterpriseAddress | addr1vyptd68g4yzkrtn38srqvkk78c3stkvw4wvvsqsmaanny7cawge8x |
RewardAddress | stake1u8a3g8vlcfu8cclq6ujzxaruz2d35x9z4sf5sff3f4ykp0slcm0cv |
</br>
Notice that Cardano uses an encoding algorithm known as Bech 32 to encode Shelley-Era addresses and other items, and these allow to add human-readable prefixes to items to mark what these are
Address Type | Mainnet Prefix | Testnet Prefix |
---|---|---|
Base & Enterprise | addr1 |
addr_test1 |
Reward | stake1 |
stake_test1 |
</br>
Let’s now adapt the static workspace design to became dynamic: to adapt automatically to the wallet that is running it, to it’s own point of view (pov).
For this matter, lets replace these statically-generated address artifacts into addresses built using key artifacts you can own.
Please wipe your workspaces to continue with a clean testing wallet setup.
{
"type": "script",
"title": "Building addresses dynamically ",
"description": "Exploring different ways to build addresses",
"run": {
"usingWorkspaces": {
"type": "loadConfig",
"updateId": "addresses-exercise-2",
"layers": [
{
"type": "Workspace",
"items": [
{
"namePattern": "my_addresses",
"titlePattern": "My Addresses",
"descriptionPattern": "My custom addresses!"
}
]
},
//let's derive 2 random child keys from your master private key
{
"type": "Key",
"workspaceIds": [
"my_addresses"
],
"items": [
{
"namePattern": "my_spend_key",
"pathPattern": "m/1852h/1815h/3h/0/123"
},
{
"namePattern": "my_stake_key",
"pathPattern": "m/1852h/1815h/5h/2/456"
}
]
},
//let's define these addresses using the key hashes of the previous keys, by artifact name reference!
{
"type": "Address",
"workspaceIds": [
"my_addresses"
],
"items": [
{
// Example Base Address: 1 spend and 1 stake credentials linked to your keys by name
"namePattern": "BaseAddress",
"spendPubKeyName": "my_spend_key",
"stakePubKeyName": "my_stake_key"
},
{
// Example Enterprise Address: 1 spend credential linked to your key by name
"namePattern": "EnterpriseAddress",
"spendPubKeyName": "my_spend_key"
},
{
// Example Reward Address: 1 stake credential linked to your key by name
"namePattern": "RewardAddress",
"stakePubKeyName": "my_stake_key"
}
]
}
]
}
}
}
🔍 See also: loadConfig, script
On your wallet, on Workspaces page, the new My Addresses workspace will look similarly to this one on my wallet:
When you select the My Addresses workspace as current, your Address Picker will look similarly to mine:
Key findings:
BaseAddress
name artifact connects to
74db436f6ef8...a5
address artifact, which connects to
6048bee2686c...e9
spend key artifactecfcf3aa90bf...be
stake key artifactOne same gcscript source code for all users. Static, wallet-agnostic source code dapp connection with dynamic, wallet-specific execution results based on user pov. No wallet-specific private nor secret data leaked hardcoded on code nor workspace parameters, safe for web transport or for serialization for backup and disaster-recovery purposes…
This is the GameChanger Wallet way, novel design principles made for modern web3 wallet management and dapp connections.
We define as Main Address the base address that is generated out of
On gcscript:
{
"type": "script",
"title": "My Main Address",
"description": "Generating an alias of your wallet's Main Address",
"run": {
"usingWorkspaces": {
"type": "loadConfig",
"updateId": "addresses-exercise-3",
"layers": [
{
"type": "Workspace",
"items": [
{
"namePattern": "my_addresses",
"titlePattern": "My Addresses",
"descriptionPattern": "My custom addresses!"
}
]
},
{
"type": "Key",
"workspaceIds": [
"my_addresses"
],
"items": [
{
"namePattern": "my_main_spend_key",
"pathPattern": "m/1852h/1815h/0h/0/0"
},
{
"namePattern": "my_main_stake_key",
"pathPattern": "m/1852h/1815h/0h/2/0"
}
]
},
{
"type": "Address",
"workspaceIds": [
"my_addresses"
],
"items": [
{
"namePattern": "MyMainAddress",
"spendPubKeyName": "my_main_spend_key",
"stakePubKeyName": "my_main_stake_key"
}
]
}
]
}
}
}
🔍 See also: loadConfig, script
GameChanger Wallet introduced on Cardano new non-custodial wallet types, two of them were created for fast and easy onboarding and testing purposes:
These 2 special types are not advised as long-term personal wallets as they are disposable, short-term wallets, marked as so by an ethical feature that triggers in-wallet suggestions to take a better course of action to users.
Default Address: is the address the user interface imports out-of-the-box for each wallet. On short-term types it is slightly different to Main Address to encourage users to avoid using these types as long-term personal wallets. It is generated this way:
In both scenarios users can still access their Main Address, Main Spend Key and Main Stake Key, only on short-term wallet types this default address uses a different stake credential to incentivize users to move into a personal wallet type. Only affected features are the stake-related ones, but users have always full spending control of the funds.
Here we can see one on a Gift Wallet:
Notice how the red missing stake key badge matches the lack of this specific staking key on these wallet types.
The Default workspace is a special one that you cannot remove, that will be always present on your Workspace Picker as first choice, and that only contains your Default Address.
Here we can see one on a Gift Wallet:
On next chapter we will learn security tips and how to differentiate across these workspace types.
Previous: Keys | Next: Personal Account Wallets |