WalletSignMessage
gets called.
Here's an example Message type in json:
{
"To": "t1hvuzpfdycc6z6mjgbiyaiojikd6wk2vwy7muuei",
"From": "t1jdlfl73voaiblrvn2yfivvn5ifucwwv5f26nfza",
"Nonce": 0,
"Value": "1000",
"Method": 0,
"GasPrice": "1000",
"GasLimit": "0",
"Params": []
}
- The message cid is calculated (steps below):
- message gets serialized using
MarshalCBOR
. byte array returned. (Could use cbor javascript npm module?cbor.encode(message)
)). - cid is created using v1 prefix. (Could use js-multihash lib).
- new block is created via
NewBlockWithCid
. (Could useipfs.block.put
). - block's
cid
is returned.
-
Cid is converted into bytes.
-
WalletSign
is invoked with an address and message cid bytes, which invokes theWallet.Sign
method. -
Message is signed