Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

cosmos-stdtx.rs: amino serializer for Cosmos SDK-formatted StdTx transactions #401

Merged
merged 5 commits into from
Jan 27, 2020

Conversation

tarcieri
Copy link
Contributor

This PR adds a new crate in the KMS workspace called cosmos-stdtx. The goal is to support generalized transaction signing across any Tendermint blockchain which uses the Cosmos SDK's StdTx format without requiring code changes in the KMS, in service of implementing #386: Cosmos transaction signing support (backed by KMS-managed keys).

To accomplish this, the crate defines a TOML-based schema definition language which describes the fields of the Msg type used in a particular StdTx, along with the Amino name(space) for a given StdTx. (In a future update which potentially replaces Amino with Protos, this could be replaced with a Protobuf schema definition).

Initial crate boilerplate + schema types (and TOML definition language)
for describing `sdk.Msg` types.
Support for programatically building messages from fields and values,
validating them against the schema, and encoding the resulting messages
as Amino.
The schema-based encoder is only for `Msg`. This adds a `StdTx` type
using `prost-amino-derive` to programatically declare it.
This commit contains the initial implementation of the `stdtx::Builder`
type with support for constructing, signing, and serializing `StdTx`
messages as Amino bytes.

Also includes a comprehensive usage example for how to build a
real-world transaction.
@tarcieri tarcieri changed the title [WIP] cosmos-stdtx.rs: amino serializer for Cosmos SDK-formatted StdTx transactions cosmos-stdtx.rs: amino serializer for Cosmos SDK-formatted StdTx transactions Jan 27, 2020
@tarcieri
Copy link
Contributor Author

Initial functionality is in place and confirmed working, so I'm going to go ahead and merge.

There's a few small things I'd like to fix up before an initial release, however.

@tarcieri tarcieri merged commit 86fc356 into master Jan 27, 2020
@tarcieri tarcieri deleted the cosmos-stdtx branch January 27, 2020 20:12
tarcieri pushed a commit to iqlusioninc/crates that referenced this pull request Jan 27, 2020
Originally developed here as the `cosmos-stdtx` crate:

tendermint/tmkms#401

This imports the code, renames it to the more convenient `stdtx` crate,
and updates links and path references to other crates in this repo.
@tarcieri
Copy link
Contributor Author

Ended up moving this over here and renaming it to stdtx: https://github.com/iqlusioninc/crates/tree/develop/stdtx

tarcieri pushed a commit that referenced this pull request Jan 27, 2020
This reverts commit 86fc356, reversing
changes made to 520727f.

Migrating this crate here instead:

https://github.com/iqlusioninc/crates/tree/develop/stdtx
tarcieri added a commit that referenced this pull request Jan 28, 2020
Revert "Merge pull request #401 from tendermint/cosmos-stdtx"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants