Skip to content

Commit

Permalink
fix: updated config to include bedrock; adding written specs-docs fro…
Browse files Browse the repository at this point in the history
…m develop (#459)

* docs: write spec (#406)

* start spec writing

* table formatting

* parameters

* state

* spec v1

* add new pages to contents

* concepts

* starting client

* cli

* client doc

* basic improvements

* direct editorial changes and comments for first review cycle

* address feedback

Co-authored-by: aljo242 <amj92@pitt.edu>
Co-authored-by: Barrie Byron <barriebyron.barriebyron@gmail.com>

* adding updated config.yml (#458)

* fix gentx issue

Co-authored-by: Alex Johnson <alex.johnson@tendermint.com>
Co-authored-by: aljo242 <amj92@pitt.edu>
Co-authored-by: Barrie Byron <barriebyron.barriebyron@gmail.com>
  • Loading branch information
4 people committed Oct 10, 2021
1 parent e0cc654 commit d601a68
Show file tree
Hide file tree
Showing 10 changed files with 2,201 additions and 22 deletions.
18 changes: 9 additions & 9 deletions app/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ func SetupDenomsAndPrefixes() {

func RegisterDenoms() {
// register pylon
err := sdk.RegisterDenom(PylonsHumanCoinUnit, sdk.OneDec())
if err != nil {
panic(err)
}
err = sdk.RegisterDenom(PylonsBaseCoinUnit, sdk.NewDecWithPrec(1, PylonsExponent))
if err != nil {
panic(err)
}
// err := sdk.RegisterDenom(PylonsHumanCoinUnit, sdk.OneDec())
// if err != nil {
// panic(err)
// }
// err = sdk.RegisterDenom(PylonsBaseCoinUnit, sdk.NewDecWithPrec(1, PylonsExponent))
// if err != nil {
// panic(err)
// }

// register bedrock
err = sdk.RegisterDenom(StakingHumanCoinUnit, sdk.OneDec())
err := sdk.RegisterDenom(StakingHumanCoinUnit, sdk.OneDec())
if err != nil {
panic(err)
}
Expand Down
21 changes: 17 additions & 4 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
genesis:
chain_id: "pylons"
app_state:
staking:
params:
bond_denom: "ubedrock"
crisis:
constant_fee:
denom: ubedrock
gov:
deposit_params:
min_deposit:
denom: ubedrock
accounts:
- name: alice
coins: ["20000000000upylon", "200000000stake"]
coins: ["20000000000upylon", "200000000ubedrock"]
- name: bob
coins: ["10000000000upylon", "100000000stake"]
coins: ["10000000000upylon", "100000000ubedrock"]
validator:
name: alice
staked: "100000000stake"
staked: "100000000ubedrock"
client:
vuex:
path: "vue/src/store"
openapi:
path: "docs/static/openapi.yml"
faucet:
name: bob
coins: [ "10000000000upylon", "100000000stake" ]
coins: [ "10000000000upylon", "100000000ubedrock" ]

70 changes: 69 additions & 1 deletion docs/spec/01_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,72 @@ order: 1
-->

# Concepts
TODO
_Disclaimer: This is work in progress. Mechanisms are susceptible to change._

An NFT acts like a deed of ownership to a digital item. The Pylons permissionless network for creating and trading virtual assets allows users to freely collect and display their digital assets.

## NFTs on Pylons

An "Item" is the pylons representation of an NFT.

Simple NFT representations are described in the [EIP-721: Non-Fungible Token Standard](https://eips.ethereum.org/EIPS/eip-721) where every NFT is identified by a unique uint256 ID inside the ERC-721 smart contract.

The `pylons` module moves beyond EIP-721 and uses the `Item` type with a variety of fields to describe arbitrary assets like images or in-game items.

Items provide flexible fields such as "doubles", "longs" and "strings" to allow creators to provide deeply customized on-chain digital assets.
A `json` example of an Item is shown below. This item represents a character in a fantasy role-playing game called LOUD:

```json
{
"owner": "pylo1dfk3zqq7ysmzd34wfrsqqfhsnqdekh8lwatqre",
"cookbookID": "cookbookLOUD",
"ID": "11111111",
"doubles": [
{"XP": "1351.000000000000000000"}
],
"longs": [
{"level": "11"},
{"giantKills": "0"},
{"special": "0"},
{"specialDragonKill": "0"},
{"undeadDragonKill": "0"}
],
"strings": [
{"entityType": "character"}
],
"mutableStrings": [],
"tradeable": true,
"lastUpdate": "81",
"transferFee": [],
"tradePercentage": "0.100000000000000000"
}
```

## Item Lifecycle

Items are created through executing Recipes. Recipes can be thought of as "blueprints" or "mini-programs" that can mint or modify items (NFTs). A collection of recipes is called a Cookbook. To bring this analogy full circle, executing a recipe is equivalent to "cooking" a recipe with the final
dish being the new or modified items.

An item is created with this workflow:
- Bob creates a Cookbook
- Bob creates a Recipe from their Cookbook that mints Items
- Alice *executes* the Recipe
- After the Execution finalizes, the minted Item is in Alice's wallet

Now that Alice owns an Item, they can send it to other users, use it in digital experiences, or even use it as an input to another recipe.
## Fees

Pylons uses a fee model that differs from most Cosmos SDK-based blockchains. There are no base gas fees on transactions. Instead, Pylons uses custom fee logic implementations with fees only for certain transactions. This fee model enables certain transactions to occur for free to provide a 0-barrier-to-entry experience for users.

Fees always exist on the following transactions:
- Send Items
- Trades
- Update Account
- Update Item String

Fees are optional on the recipe execution transaction.

## Accounts

Since there are no fees on the Pylons chain, accounts need to be created for users with no coins in their balances. Pylons exposes a custom free
transaction for account creation to bypass this restriction and allow free experiences for uses. See the *Messages* section for more details on transactions.
144 changes: 142 additions & 2 deletions docs/spec/02_state.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,146 @@
<!--
order: 1
order: 2
-->

# State
TODO

The `pylons` module tracks the state of these primary objects:

- Cookbooks
- Recipes
- Executions, pending and completed
- Items
- Trades
- PylonsAccounts

## Cookbooks

Cookbooks objects are containers for recipes. A cookbook could be a collection of recipes that make up a game experience or be a portfolio of recipes an artist uses to mint their NFTs from.

The definition of a cookbook can be found in [`cookbook.proto`](LINK).

```go
type Cookbook struct {
Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"`
NodeVersion string `protobuf:"bytes,3,opt,name=nodeVersion,proto3" json:"nodeVersion,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
Developer string `protobuf:"bytes,6,opt,name=developer,proto3" json:"developer,omitempty"`
Version string `protobuf:"bytes,7,opt,name=version,proto3" json:"version,omitempty"`
SupportEmail string `protobuf:"bytes,8,opt,name=supportEmail,proto3" json:"supportEmail,omitempty"`
CostPerBlock types.Coin `protobuf:"bytes,9,opt,name=costPerBlock,proto3" json:"costPerBlock"`
Enabled bool `protobuf:"varint,10,opt,name=enabled,proto3" json:"enabled,omitempty"`
}
```

## Recipes

Recipe objects are blueprints for digital experiences involving coins and NFT items. They can deterministically mint an NFT as users are familiar with from
other blockchains experiences like Ethereum, or specify mini-programs to probabilistically result in a variety of outcomes. The recipe structure contains
fields specifying the rules and logic of a recipe.

The definition of a recipe can be found in [`recipe.proto`](LINK).

```go
type Recipe struct {
CookbookID string `protobuf:"bytes,1,opt,name=cookbookID,proto3" json:"cookbookID,omitempty"`
ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"`
NodeVersion string `protobuf:"bytes,3,opt,name=nodeVersion,proto3" json:"nodeVersion,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
CoinInputs []CoinInput `protobuf:"bytes,7,rep,name=coinInputs,proto3" json:"coinInputs"`
ItemInputs []ItemInput `protobuf:"bytes,8,rep,name=itemInputs,proto3" json:"itemInputs"`
Entries EntriesList `protobuf:"bytes,9,opt,name=entries,proto3" json:"entries"`
Outputs []WeightedOutputs `protobuf:"bytes,10,rep,name=outputs,proto3" json:"outputs"`
BlockInterval int64 `protobuf:"varint,11,opt,name=blockInterval,proto3" json:"blockInterval,omitempty"`
Enabled bool `protobuf:"varint,12,opt,name=enabled,proto3" json:"enabled,omitempty"`
ExtraInfo string `protobuf:"bytes,13,opt,name=extraInfo,proto3" json:"extraInfo,omitempty"`
}
```

## Executions

Execution objects are instances created when a user actually runs a recipe. The data structure contains information about the specific coins, items,
recipe and outputs involved in the execution.

The definition of a recipe can be found in [`execution.proto`](LINK).

```go
type Execution struct {
Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"`
RecipeID string `protobuf:"bytes,3,opt,name=recipeID,proto3" json:"recipeID,omitempty"`
CookbookID string `protobuf:"bytes,4,opt,name=cookbookID,proto3" json:"cookbookID,omitempty"`
RecipeVersion string `protobuf:"bytes,5,opt,name=recipeVersion,proto3" json:"recipeVersion,omitempty"`
NodeVersion string `protobuf:"bytes,6,opt,name=nodeVersion,proto3" json:"nodeVersion,omitempty"`
BlockHeight int64 `protobuf:"varint,7,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"`
ItemInputs []ItemRecord `protobuf:"bytes,8,rep,name=itemInputs,proto3" json:"itemInputs"`
CoinInputs github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,9,rep,name=coinInputs,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coinInputs"`
CoinOutputs github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,10,rep,name=coinOutputs,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coinOutputs"`
ItemOutputIDs []string `protobuf:"bytes,11,rep,name=itemOutputIDs,proto3" json:"itemOutputIDs,omitempty"`
ItemModifyOutputIDs []string `protobuf:"bytes,12,rep,name=itemModifyOutputIDs,proto3" json:"itemModifyOutputIDs,omitempty"`
}
```

## Items

Item objects provide the core asset identity file for the `pylons` module. <!-- need general object description here, what is the file with this code? where does it live in the repo? -->.

The definition of a recipe can be found in [`item.proto`](LINK).


````go
type Item struct {
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
CookbookID string `protobuf:"bytes,2,opt,name=cookbookID,proto3" json:"cookbookID,omitempty"`
ID string `protobuf:"bytes,3,opt,name=ID,proto3" json:"ID,omitempty"`
NodeVersion string `protobuf:"bytes,4,opt,name=nodeVersion,proto3" json:"nodeVersion,omitempty"`
Doubles []DoubleKeyValue `protobuf:"bytes,5,rep,name=doubles,proto3" json:"doubles"`
Longs []LongKeyValue `protobuf:"bytes,6,rep,name=longs,proto3" json:"longs"`
Strings []StringKeyValue `protobuf:"bytes,7,rep,name=strings,proto3" json:"strings"`
MutableStrings []StringKeyValue `protobuf:"bytes,8,rep,name=mutableStrings,proto3" json:"mutableStrings"`
Tradeable bool `protobuf:"varint,9,opt,name=tradeable,proto3" json:"tradeable,omitempty"`
LastUpdate int64 `protobuf:"varint,10,opt,name=lastUpdate,proto3" json:"lastUpdate,omitempty"`
TransferFee []types.Coin `protobuf:"bytes,11,rep,name=transferFee,proto3" json:"transferFee"`
// The percentage of a trade sale retained by the cookbook owner. In the range (0.0, 1.0).
TradePercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=tradePercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"tradePercentage"`
}
````

## Trades

Trades objects are <!-- need general object description here, what is the file with this code? where does it live in the repo? -->.

The definition of a recipe can be found in [`trade.proto`](LINK).


```go
type Trade struct {
Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
ID uint64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"`
CoinInputs []CoinInput `protobuf:"bytes,3,rep,name=coinInputs,proto3" json:"coinInputs"`
ItemInputs []ItemInput `protobuf:"bytes,4,rep,name=itemInputs,proto3" json:"itemInputs"`
CoinOutputs github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=coinOutputs,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coinOutputs"`
ItemOutputs []ItemRef `protobuf:"bytes,6,rep,name=itemOutputs,proto3" json:"itemOutputs"`
ExtraInfo string `protobuf:"bytes,7,opt,name=extraInfo,proto3" json:"extraInfo,omitempty"`
Receiver string `protobuf:"bytes,8,opt,name=receiver,proto3" json:"receiver,omitempty"`
TradedItemInputs []ItemRef `protobuf:"bytes,9,rep,name=tradedItemInputs,proto3" json:"tradedItemInputs"`
}
```

## PylonsAccounts

The PylonsAccounts objects define a two-way map between a Cosmos SDK address and a username.

<!-- need general object description here, what is the file with this code? where does it live in the repo? -->.
The definition of a recipe can be found in [`accounts.proto`](LINK).


```go
type UserMap struct {
AccountAddr string `protobuf:"bytes,1,opt,name=accountAddr,proto3" json:"accountAddr,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
}
```
Loading

0 comments on commit d601a68

Please sign in to comment.