# UnmarshalBinaryBare expected to read prefix bytes 75FBFAB8 (since it is registered concrete) but got 0A141DFA

**URL:** <https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664>\
**Category:** Cosmos-SDK\
**Created:** [August 1, 2018, 10:20am UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664 "2018-08-01T10:20:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gblue1223](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/gblue1223/32/120_2.png) [@gblue1223](https://forum.cosmos.network/u/gblue1223)\
**Post date:** [August 1, 2018, 10:20am UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/1 "2018-08-01T10:20:36Z")

</div>

I’m trying to transfer coins from Alice’s account to Bob’s account through Basecoin example. However at the first time, I couldn’t even send a Tx because of the error: `ERROR: Cannot encode unregistered concrete type auth.StdTx.`. So I’ve added this code: `cdc.RegisterConcrete(&auth.StdTx{}, "auth/StdTx", nil)` to `basecoin/app/app.go`. Afterward the Tx was succeded and Alice’s coin balance is shrinked. But I couldn’t find out Bab’s coin balance with below error.

```bash
$ basecli account cosmosaccaddr1rhavh905ytjwx8vqz5x8s8hxdsqfzcgrkyqdhe
panic: UnmarshalBinaryBare expected to read prefix bytes 75FBFAB8 (since it is registered concrete) but got 0A141DFA...

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/examples/basecoin/types.GetAccountDecoder.func1(0xc4209bc030, 0x29, 0x2a, 0x0, 0x0, 0x0, 0x1)
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/examples/basecoin/types/account.go:42 +0x18f
github.com/cosmos/cosmos-sdk/x/auth/client/cli.GetAccountCmd.func1(0xc4208be240, 0xc420133ee0, 0x1, 0x1, 0x0, 0x0)
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/x/auth/client/cli/account.go:63 +0x265
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).execute(0xc4208be240, 0xc420133eb0, 0x1, 0x1, 0xc4208be240, 0xc420133eb0)
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:698 +0x46d
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x164dcc0, 0xde28c0, 0x24, 0xc4208bc34f)
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:783 +0x2e4
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).Execute(0x164dcc0, 0xc4208ae8e0, 0x164dda0)
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:736 +0x2b
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli.Executor.Execute(0x164dcc0, 0xf2bf68, 0x2, 0xc4208b2cc0)
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli/setup.go:89 +0x4e
main.main()
	/home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/examples/basecoin/cmd/basecli/main.go:79 +0x558

```

Here is the commands that I’ve executed and `basecoind` and `basecli` version is 0.23.1-d27c5ee.

```bash
$ basecoind init
{
  "chain_id": "test-chain-w888j8",
  "node_id": "2c67250af4e7833c7b18fbccc4822203ed95806f",
  "app_message": {
    "secret": "come drum sheriff plug analyst rubber left exclude project basic whip flash web fade figure miss check symbol initial clay useful share pencil fold"
  }
}

```

```auto
$ basecli keys add alice --recover
Enter a passphrase for your key:
Repeat the passphrase:
Enter your recovery seed phrase:
come drum sheriff plug analyst rubber left exclude project basic whip flash web fade figure miss check symbol initial clay useful share pencil fold
NAME:	TYPE:	ADDRESS: PUBKEY:
alice	local	cosmosaccaddr169xee6hdmwxqtgjdyx3es9z3ca6lgnz6d80j0d	cosmosaccpub1addwnpepqv0xnw0uww22dzmejxqcjz499fxctxq3ma6glz2sdevm84uhrkez5h8szl4

```

```bash
$ basecli keys add bob
Enter a passphrase for your key:
Repeat the passphrase:
NAME:	TYPE:	ADDRESS: PUBKEY:
bob	local	cosmosaccaddr1rhavh905ytjwx8vqz5x8s8hxdsqfzcgrkyqdhe	cosmosaccpub1addwnpepq289873yatnzhfuph4xun6qsthe8rxxpw83ssuevd6t83slhdqssju3k5hn
**Important** write this seed phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

hotel whip course vendor syrup garment normal embody network height pluck option aim cricket awesome victory tooth cupboard room polar dumb doll kidney comfort

```

```bash
$ basecli keys list
NAME:	TYPE:	ADDRESS: PUBKEY:
alice	local	cosmosaccaddr169xee6hdmwxqtgjdyx3es9z3ca6lgnz6d80j0d	cosmosaccpub1addwnpepqv0xnw0uww22dzmejxqcjz499fxctxq3ma6glz2sdevm84uhrkez5h8szl4
bob	local	cosmosaccaddr1rhavh905ytjwx8vqz5x8s8hxdsqfzcgrkyqdhe	cosmosaccpub1addwnpepq289873yatnzhfuph4xun6qsthe8rxxpw83ssuevd6t83slhdqssju3k5hn

```

```bash
$ basecoind start

```

```bash
$ basecli account cosmosaccaddr169xee6hdmwxqtgjdyx3es9z3ca6lgnz6d80j0d
{
  "type": "basecoin/Account",
  "value": {
    "BaseAccount": {
      "address": "cosmosaccaddr169xee6hdmwxqtgjdyx3es9z3ca6lgnz6d80j0d",
      "coins": [
        {
          "denom": "mycoin",
          "amount": "9007199254740992"
        }
      ],
      "public_key": null,
      "account_number": "0",
      "sequence": "0"
    },
    "name": ""
  }
}

```

```bash
$ basecli send --from=alice --amount=10000mycoin --to=cosmosaccaddr1rhavh905ytjwx8vqz5x8s8hxdsqfzcgrkyqdhe --sequence=0 --chain-id=test-chain-w888j8
Defaulting to account number: 0
Defaulting to next sequence number: 0
Password to sign with 'alice':
Committed at block 30. Hash: D3CB40613CDF9619E53B92EF151A93AF0FC62D22

```

```bash
$ basecli tx D3CB40613CDF9619E53B92EF151A93AF0FC62D22
{
  "hash": "D3CB40613CDF9619E53B92EF151A93AF0FC62D22",
  "height": "30",
  "tx": {
    "type": "auth/StdTx",
    "value": {
      "msg": [
        {
          "type": "cosmos-sdk/Send",
          "value": {
            "inputs": [
              {
                "address": "cosmosaccaddr169xee6hdmwxqtgjdyx3es9z3ca6lgnz6d80j0d",
                "coins": [
                  {
                    "denom": "mycoin",
                    "amount": "10000"
                  }
                ]
              }
            ],
            "outputs": [
              {
                "address": "cosmosaccaddr1rhavh905ytjwx8vqz5x8s8hxdsqfzcgrkyqdhe",
                "coins": [
                  {
                    "denom": "mycoin",
                    "amount": "10000"
                  }
                ]
              }
            ]
          }
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "",
            "amount": "0"
          }
        ],
        "gas": "200000"
      },
      "signatures": [
        {
          "pub_key": {
            "type": "tendermint/PubKeySecp256k1",
            "value": "Ax5pufxzlKaLeZGBiQqlKk2FmBHfdI+JUG5Zs9eXHbIq"
          },
          "signature": {
            "type": "tendermint/SignatureSecp256k1",
            "value": "MEQCIEpcp4OHzuvBWj+CRrVYkfIaJzr6pU1/Ftb7GFT6j0OcAiAZEQBsiPrWemgojRRL4mBbP+RWxJ416Wd4F3zJ9Yj/9Q=="
          },
          "account_number": "0",
          "sequence": "0"
        }
      ],
      "memo": ""
    }
  },
  "result": {
    "log": "Msg 0: ",
    "gas_used": "3084",
    "tags": [
      {
        "key": "c2VuZGVy",
        "value": "Y29zbW9zYWNjYWRkcjE2OXhlZTZoZG13eHF0Z2pkeXgzZXM5ejNjYTZsZ256NmQ4MGowZA=="
      },
      {
        "key": "cmVjaXBpZW50",
        "value": "Y29zbW9zYWNjYWRkcjFyaGF2aDkwNXl0and4OHZxejV4OHM4aHhkc3FmemNncmt5cWRoZQ=="
      }
    ],
    "fee": {}
  }
}

```

Should I use another version of cosmos-sdk? If so please tell me the right version.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![jack](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/jack/32/98_2.png) [@jack](https://forum.cosmos.network/u/jack)\
**Post date:** [August 1, 2018, 6:09pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/2 "2018-08-01T18:09:10Z")

</div>

What version of the SDK are you using? Also I’m assuming this is `basecoin`?

---

<div class="post-metadata">

**Author:** ![gblue1223](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/gblue1223/32/120_2.png) [@gblue1223](https://forum.cosmos.network/u/gblue1223)\
**Post date:** [August 1, 2018, 11:25pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/3 "2018-08-01T23:25:22Z")

</div>

The version is `0.23.1-d27c5ee` and yes, it is `basecoin` example.

---

<div class="post-metadata">

**Author:** ![jack](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/jack/32/98_2.png) [@jack](https://forum.cosmos.network/u/jack)\
**Post date:** [August 2, 2018, 7:08pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/4 "2018-08-02T19:08:58Z")

</div>

We have been making a bunch of changes to the SDK in preparation for the hub launch. We have not kept `basecoin` up to date and won’t be fixing the incompatibilities until after we launch the hub.

---

<div class="post-metadata">

**Author:** ![gblue1223](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/gblue1223/32/120_2.png) [@gblue1223](https://forum.cosmos.network/u/gblue1223)\
**Post date:** [August 2, 2018, 11:17pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/5 "2018-08-02T23:17:42Z")

</div>

I see, it seems like I need to do my homework.

---

<div class="post-metadata">

**Author:** ![gblue1223](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/gblue1223/32/120_2.png) [@gblue1223](https://forum.cosmos.network/u/gblue1223)\
**Post date:** [August 3, 2018, 3:33pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/6 "2018-08-03T15:33:44Z")

</div>

I got it. The account mapper’s parameter was wrong.  
I’ve changed the problematic code:

```auto
	app.accountMapper = auth.NewAccountMapper(
		cdc,
		app.keyAccount, // target store
		auth.ProtoBaseAccount, // prototype
	)

```

to this:

```auto
	app.accountMapper = auth.NewAccountMapper(
		cdc,
		app.keyAccount, // target store
		func () auth.Account {
			return &types.AppAccount{}
		},
	)

```

So, now I can see Bob’s balance!  
Hope it helps someone.

---

<div class="post-metadata">

**Author:** ![valardragon](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@valardragon](https://forum.cosmos.network/u/valardragon)\
**Post date:** [August 3, 2018, 4:27pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/7 "2018-08-03T16:27:49Z")

</div>

If this makes basecoin work for you, want to submit a PR to the SDK?

---

<div class="post-metadata">

**Author:** ![jack](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/jack/32/98_2.png) [@jack](https://forum.cosmos.network/u/jack)\
**Post date:** [August 3, 2018, 9:17pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/8 "2018-08-03T21:17:13Z")

</div>

Yes please! We would love a PR for this!

---

<div class="post-metadata">

**Author:** ![gblue1223](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/gblue1223/32/120_2.png) [@gblue1223](https://forum.cosmos.network/u/gblue1223)\
**Post date:** [August 3, 2018, 11:01pm UTC](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/9 "2018-08-03T23:01:52Z")

</div>

I just submitted PR. 😃
