Dero Web Wallet derosuite. This repo contains changes required for webwallet. With this changes any Dero daemon can become web wallet. All changes are related to daemon rpc server and wallet to make it light and faster.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
3.8KB

  1. // Copyright 2017-2018 DERO Project. All rights reserved.
  2. // Use of this source code in any form is governed by RESEARCH license.
  3. // license can be found in the LICENSE file.
  4. // GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8
  5. //
  6. //
  7. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  8. // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  9. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  10. // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  11. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  12. // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  13. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  14. // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  15. // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16. package globals
  17. //import "github.com/vmihailenco/msgpack"
  18. import "github.com/deroproject/derosuite/crypto"
  19. import "github.com/deroproject/derosuite/crypto/ringct"
  20. // this structure is way blockchain sends outputs to wallet
  21. // this structure is also used internal by blockchain itself, when TXs are expanded and verified
  22. // this structure needs to be expandable without breaking legacy
  23. // This structure is the only information needed by wallet to decode previous and send new txs
  24. // This opens up the case for mobile wallets without downloading entire blockchain
  25. // Some of the fields get duplicated if a tx has multiple vouts
  26. type TX_Output_Data struct {
  27. BLID crypto.Hash `msgpack:"L" json:"blid,omitempty"` // the block id in which this was found, we are duplicating it for all
  28. TXID crypto.Hash `msgpack:"T" json:"txid,omitempty"` // the transaction id in which this was found, we are duplicating it for all vouts
  29. Tx_Public_Key crypto.Key `msgpack:"P" json:"publickey,omitempty"` // the public key of the tx , we are duplicating it for all vouts within the TX
  30. // this is extracted from the extra field
  31. // this data is consumed by the blockchain itself while expanding tx
  32. InKey ringct.CtKey `msgpack:"D" json:"inkey,omitempty"` // contains the vout key and encrypted commitment
  33. ECDHTuple ringct.ECdhTuple `msgpack:"E" json:"ecdhtuple,omitempty"` // encrypted Amounts, will be empty for miner tx
  34. SenderPk crypto.Key `msgpack:"K" json:"senderpk,omitempty"` // from the outpk
  35. Amount uint64 `msgpack:"A,omitempty" json:"amount,omitempty"` // amount used for miner tx
  36. SigType uint64 `msgpack:"S" json:"sigtype,omitempty"` // which ringct type the output was of
  37. Index_within_tx uint64 `msgpack:"W" json:"indexwithintx,omitempty"` // output index of vout within the tx
  38. Index_Global uint64 `msgpack:"G" json:"indexglobal,omitempty"` // position in global index
  39. Height uint64 `msgpack:"H" json:"height,omitempty"` // height to which this belongs
  40. Unlock_Height uint64 `msgpack:"U" json:"unlockheight,omitempty"` // height at which it will unlock
  41. TopoHeight int64 `msgpack:"TH" json:"Topoheight,omitempty"` // Topoheight
  42. Block_Time uint64 `msgpack:"B"` // when was this block found in epoch
  43. Key_Images []crypto.Key `msgpack:"KI,omitempty"` // all the key images consumed within the TX
  44. PaymentID []byte `msgpack:"I,omitempty" json:"paymentid,omitempty"` // payment ID contains both unencrypted (33byte)/encrypted (9 bytes)
  45. // TODO this structure must also keep payment ids and encrypted payment ids
  46. }