Skip to content
Merged
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
48 changes: 37 additions & 11 deletions spec/Transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum Action {
MintAsset { ..., },
TransferAsset { ..., },
ChangeAssetScheme { ..., },
IncreaseAssetSupply { ..., },
Pay { ..., },
SetRegularKey { ..., },
WrapCCC { ..., },
Expand All @@ -43,13 +44,18 @@ This kind of asset needs permission to be transferred.
A regulated asset is an asset that has an registrar.
The registrar can change the asset scheme and transfer the asset arbitrarily.

If the `allowed_script_hashes` is specified, this asset can be only locked with
the lock script hashes in the list. If the list is empty, any lock script hashes
can be used.

```rust
MintAsset {
network_id: NetworkId,
shard_id: ShardId,
metadata: String,
approver: Option<PlatformAddress>,
registrar: Option<PlatformAddress>,
allowed_script_hashes: Vec<H160>,

output: AssetMintOutput,

Expand Down Expand Up @@ -136,23 +142,42 @@ Only the registrar of the asset can use it.
```rust
ChangeAssetScheme {
network_id: NetworkId,
asset_type: H256,
shard_id: ShardId,
asset_type: H160,
seq: usize,
metadata: String,
approver: Option<PlatformAddress>,
registrar: Option<PlatformAddress>,
allowed_script_hashes: Vec<H160>,

approvals: Vec<Signature>,
}
```

## IncreaseAssetSupply

It increases the total supply of the asset.
Only the registrar of the asset can use it.

```rust
IncreaseAssetSupply {
network_id: NetworkId,
shard_id: ShardId,
asset_type: H160,
seq: usize,
output: AssetMintOutput,
approvals: Vec<Signature>,
}
```

## Pay

`Pay` sends `value` amount of CCC to the `receiver`.
`Pay` sends `quantity` amount of CCC to the `receiver`.

```rust
Pay {
receiver: Address,
amount: u64,
quantity: u64,
}
```

Expand All @@ -176,7 +201,8 @@ WrapCCC {
shard_id: ShardId,
lock_script_hash: H160,
parameters: Vec<Parameters>,
amount: u64,
quantity: u64,
payer: Address,
}
```

Expand All @@ -193,13 +219,6 @@ UnwrapCCC {
}
```

```rust
Custom {
handler_id: u64,
bytes: Bytes,
}
```

## Store

This is a special kind of transaction that allows a user to upload text onto the blockchain.
Expand Down Expand Up @@ -227,3 +246,10 @@ Remove {

`Custom` is a special transaction.
The types of transactions that may exist depends on the consensus engine.

```rust
Custom {
handler_id: u64,
bytes: Bytes,
}
```