SkyOne Profile JPG

Near Named Account

Image


预备知识

Near的Account有两种

  • Named accounts, 可读的, 比如 alice.near

    • named account 类似于我们ETH上 account + domain 的模型 [key-pair + ens 一起生成]

      原生自带域名

    • 需要明确的是, named account 需要少量的near来初始化(资助), 如果这个账户下没有near, 那么你只是离线生成了而已[具体往下看操作流程] ⭐

  • Implicit account, 是64位的字符串 98793cd91a3f870fb126f662858....

    • lmplicit account 则有一点类似于我们ETH上的account [key-pair生成]

需要明白的两个点:

  1. near中不管哪种account, 都可以添加keypair, 也可以删除keypair (代表着可以交易)

  2. 任何一对keypair, 都对应着一个 implicit address,, 即只要你有一对keypair, 那么这对keypair就有一个对应的implicit account

  • 注意, 举个例子, 如果我注册了 6666.near, 对应的keypair是 pkxx666[公钥] -- skxx666[私钥], 那么这个时候其实是有两个account 对应着同一对keypair的, 一个named account (6666.near), 一个是原生的 implicit account(4b3fe936ff9a028e83caac803...)

  • 🍎 这是两个单独账户 这两个account是不通的, 即你给4b3fe936ff9a028e83caac803转账, 这个钱不会到6666.near中

  • 由于这俩账户的keypair是一样的, 所以会造成当你在插件钱包里import account的时候, 输入同一个私钥, 只出来某一个account, 解决办法是代码connect不同的account, 同一kaypair不同account的转账demo如下

const nearAPI = require("near-api-js");
const { keyStores, KeyPair, connect,Contract,utils } = nearAPI;

let accountName = 'xxx' //6666.near or 4b3fe936ff9a028e83caac803
let network = 'mainnet'
let myKeyStore = new keyStores.InMemoryKeyStore();
let PRIVATE_KEY = ""; // xx私钥部分, 不带ed25519, 大概是87位或者88位的字符串
let keyPair = KeyPair.fromString(PRIVATE_KEY);

async function main(){
    await myKeyStore.setKey(network, accountName, keyPair);
    const connectionConfig = {
        networkId: network,
        keyStore: myKeyStore, // first create a key store 
        nodeUrl: "https://rpc.mainnet.near.org",
        walletUrl: "https://wallet.near.org",
        helperUrl: "https://helper.near.org",
        explorerUrl: "https://explorer.near.org",
    };
    const nearConnection = await connect(connectionConfig);
    const account = await nearConnection.account(accountName);
    await account.sendMoney(
        "skyone.near", // receiver account
        utils.format.parseNearAmount("0.001")
      );
    console.log(account)
}

正文

由于named account 可以交易, 所以可以注册一批 有潜力的account, 教程如下[假设现在都是从0开始 没有接触过near的account]:

滑倒最后 有一批可用的4d named account

  1. 去 near [创建钱包的网址][https://wallet.near.org/create] 选第一个, 助记词的方式

  2. 生成一套助记词

  3. 验证通过, 你这个时候就有了一个Implicit account

  4. 从Cex转过来一点Near, 不用太多 一个就够

    到这一步, 你是有了一个implicit account, 但是和named account 没啥关系.

    需要用这个implicit account 去create 一个 named account [implicit account起到的作用就是资助 资助作用见上文⭐ ]

  5. 有了implicit account之后, 返回 https://wallet.near.org/ 点击右上角 , 创建新的账户

  6. 这时候, 你就可以注册你想要的named account了, 输入即可, 如果已经被注册的会红字显示, 没注册的是绿色通过

  7. 一切按照正常步骤走即可, 直到最后一步的这里,需要花0.1Near 资助一下你刚刚输入的named account, 如果你不资助, 那么你的这个named account其实 还不属于你, 只有你资助了 才属于你, 即不资助 一切没意义 💮

  8. 等待tx完成之后, 保存好助记词, 完成✅


碎碎念

  1. named account [skyone.near] 其实是 near 这个main account的一个 sub account, 就像我可以用 skyone.near 去注册 test.skyone.near, 那么teset.skyone.near 就是 skyone.near的一个sub account

  2. implicit account则是单独的account, 做了份示意图

  3. 通过上面正文的方式, 注册完之后, 你的account里面有两套keypair, 一套是助记词对应的, 另一套, 其实是 https://wallet.near.org/ 这个网站给你加的

    可以通过代码的方式, delete掉他给我们加的这个公钥, 只留下我们助记词的keypair

  4. near account marketplace 之前也有过, 只不过还没发展起来 https://gonear.name/#/

    我没有仔细研究他的过程, 但是肯定和普通域名NFT是不同的路子

  5. 成本很小, 一个named account也就0.1Near


4d可用named account

3d, 2d已经被注册完了

4d还有1200个, 都是7xxx,8xxx,9xxx, 前面的都被注册完了

7271,9348,7634,9504,9312,7484,9819,8253,8932,9719,7349,8146,9842,9412,
7409,9082,8962,7952,7195,9429,9148,9470,9715,7627,8137,9724,7917,9676,
7084,8916,7802,8594,8423,7431,8417,9180,8705,7106,9381,9079,8672,7196,
8064,7674,7538,7621,8963,9427,7136,8281,9037,9353,7570,8702,9727,8392,
9434,8362,8491,8162,7815,9125,9892,9032,9210,7343,9694,7327,8240,8197,
8525,8706,9145,8487,8975,7814,9274,8124,7504,7381,8264,9509,8936,9273,
8311,8793,8274,8921,9186,8904,9135,7505,7261,7938,8713,8377,7161,7392,
7359,9526,7347,9821,7513,7156,8796,9122,9479,9539,9156,7328,7906,9328,
7911,9241,7514,9460,7796,8562,8159,9260,8571,8516,8303,7820,8147,7651,
9403,9172,7153,7871,9219,8907,9722,9451,9579,7122,8291,8572,8203,7292,
9131,9247,9261,7101,9541,7874,9752,7287,9824,9461,9580,7087,8136,9576,
7318,7212,9743,8782,8915,9480,7164,9136,8910,7492,9522,9206,7162,7546,
9704,7286,9851,8191,8784,7606,8294,7157,9105,9843,8316,7296,8054,9039,
9154,7935,7615,9074,9162,8109,7230,7697,8140,8547,8695,7144,7948,7837,
7278,7926,7852,7548,7176,9242,9430,7806,7910,9301,7912,8216,7137,9106,
9419,7462,9474,7925,7453,7680,7182,9458,8372,8047,7082,8714,7840,7203,
9320,7348,9035,8925,9107,7131,9734,8052,9433,9140,7848,8313,8945,7927,
8145,9711,8730,9183,8464,8451,7264,9859,9805,9104,9583,7506,8750,9350,
9464,9857,8139,9820,7602,9065,7976,9147,7783,7148,8902,7248,7304,8427,
8310,7190,9503,9151,9827,7350,8539,7745,8747,9322,7982,9360,9467,9102,
7605,7738,8453,8507,9741,8346,9561,9305,8501,7394,8482,7127,9250,9594,
7601,9485,9232,8194,7644,7418,9762,9501,7397,7742,7933,7528,8155,7507,
8209,7735,7659,7351,8946,8943,9173,8527,8973,7746,7928,8985,9281,7239,
7612,7539,7213,9043,9051,8929,8151,9533,9767,9150,9283,7637,8692,9854,
9133,8949,8293,9680,7139,8411,9563,9835,9108,9161,7752,7355,9570,9160,
8511,7683,9806,7593,9141,9689,9157,9363,7607,9094,7167,7427,9342,9423,
7657,7932,9326,7830,8235,7121,7835,8727,9831,9291,9478,9519,9165,7920,
7691,9354,7452,8982,8694,8655,8296,7671,9834,8723,9750,9782,9152,7421,
9398,7294,7291,7638,9537,7210,7817,9194,8592,7934,7480,9276,9490,7091,
8312,9130,7907,9863,8421,9176,7957,7487,7419,8167,9228,8794,8948,7174,
7478,8231,8737,7303,8405,8905,9695,8202,7586,9344,7486,8107,9195,8506,
7626,7921,8315,7931,7739,9692,7622,7594,9055,9548,8697,7197,9238,8693,
7391,9370,7435,9713,8530,7205,8350,7902,8284,9828,7764,9361,8716,7135,
9270,9508,7792,7458,8476,8196,7132,9190,9254,9392,7403,9049,9275,8342,
9137,7805,8262,7853,8352,8690,9748,8583,9295,7945,8670,8454,8207,7246,
9491,7275,7163,7641,7240,8422,7964,7235,7922,7482,9314,9047,8489,8739,
7371,9063,8513,9248,9487,9207,9386,7201,7784,8671,8461,9790,9578,9034,
9685,7398,8424,8129,8971,9265,8356,9439,9524,9546,7598,9582,8265,9732,
9385,8587,8751,9486,7985,9177,8937,8479,7308,8473,9364,8125,8249,8659,
8201,8236,7495,8134,7430,9179,8575,9483,9155,9193,8561,7187,8393,8515,
9540,7411,9574,9507,7623,8317,7218,9542,7748,7193,7206,9073,8360,8452,
7251,9781,7519,9681,9402,7841,7525,9208,7346,9739,7372,8165,8419,8215,
9749,7673,9535,8232,7434,9175,7947,9718,7741,7826,9048,7258,7524,9417,
9257,7301,7819,8161,7191,7159,8717,8410,7410,8564,8381,9428,9103,8131,
9313,7461,8384,7694,7795,8752,9289,8374,7803,8711,8127,9810,9703,7617,
8142,7549,8792,7256,7572,8930,7473,8581,9785,9532,8531,7518,7592,7245,
7595,7936,7086,9407,9129,7387,9816,7402,8309,7314,8712,7684,7914,7924,
8701,9497,7844,7102,9585,9729,8175,9170,8726,8065,7302,7496,8923,7578,
9349,9710,7640,7850,7395,7536,8791,8359,7646,7259,8715,9089,7610,9262,
7401,8757,7762,7981,7816,8742,8524,9672,8272,7470,7425,7523,8257,8460,
7219,7095,7433,8736,7093,8920,7317,8370,8467,8710,9740,8233,8745,7515,
8536,9462,8984,8314,9848,9308,7247,8471,7284,7619,8967,7949,9747,7407,
7185,8263,7281,9318,7128,8105,8250,9721,8104,9233,9454,9597,8926,7587,
9709,9702,9677,7635,7316,9067,7165,8306,9149,7603,8213,9730,9138,8049,
9823,9347,9397,9284,9755,9306,8217,7198,7406,7681,7930,9072,9203,8529,
7581,9852,8122,7092,7151,8503,7437,9861,9064,9390,9310,7362,7974,9693,
9518,7083,9059,7849,9746,9045,9849,8349,9564,8954,7242,9531,9425,9528,
7390,9891,7682,9536,9120,8403,9375,7633,7950,8596,9317,8148,7693,8749,
8133,8429,8391,8379,7759,9411,8276,8463,8261,9737,7620,8239,9389,8193,
7479,9584,9514,9367,9840,7232,8439,7145,7804,9287,7831,7782,8412,9502,
9465,8189,7485,8185,9164,9182,7517,8212,7370,8731,7155,8396,8256,8472,
9894,7534,7436,9844,7687,9357,9808,9365,8279,8237,7298,9372,8241,7672,
7502,8759,9751,7383,8259,9171,7211,8347,9833,9174,7609,9139,9416,9484,
9127,9587,8120,9352,7825,7862,9380,9340,7260,8062,9259,7404,7451,8273,
9405,8170,8733,7503,7614,9791,7215,7951,8135,9359,7455,8179,9723,7386,
9378,9078,8375,9290,7204,7385,8753,9675,9197,7460,8126,8732,7124,7231,
9796,9244,9031,7529,7143,9343,8595,7839,9324,9839,7740,7374,9482,8522,
9185,9794,7464,7810,8150,7918,7750,7217,7341,8783,7426,7793,7913,7937,
7104,8057,8496,8493,9725,8322,8301,7363,9841,8397,8101,9307,9256,8056,
9864,9890,9304,8790,8735,7628,7126,9362,7085,7285,7941,9153,7537,9076,
7639,9591,8190,9489,8535,7522,7973,8319,7489,7257,9517,7208,7807,9802,
7636,7476,8722,9285,9033,7108,9853,9143,8130,9121,9572,8304,7736,8277,
8483,8144,9811,9712,9346,7630,9714,7564,8720,9787,8103,8211,8724,9144,
8947,9264,9512,9217,7262,7293,7364,7526,9472,9795,9830,9481,8976,7919,
9673,7962,9286,9132,7322,9297,9855,7971,8156,8367,8053,9209,9404,8934,
9513,7358,7953,8960,7540,7821,7180,7183,9463,7965,9728,8061,7216,8504,
9544,8059,9216,9052,7923,7236,9745,8952,9684,7590,9167,8653,9496,9893,
7175,7958,7412,7276,9214,7813,7530,8297,9538,8305,7376,9683,8785,9720,
8797,9316,8924,8545,7384,9205,7583,8143,9061,9505,8721,7915,9516,8979,
8160,7133,9384,8302,9415,9590,7439,7624,7604,7125,8570,8942,7380,7129,
9323,7751,7563,8494,7544,8743,9422,7244,9455,7873,8459,8495,9476,8957,
8106,9184,9272,7834,9895,9081,8184,9783,8270,8781,8214,8563,7761,8242,
7415,9280,8673,7574,7512,7562,9253,8795,7753,9435,7491,8433,9379,8435,
8164,9408,9792,8679,9325,9058,8285,9511,7943,8063,8390,9406,9204,8931,
9201,8387,7573,9426,8691,8548,7875,7967,7648,7267,8407,8275,8740,9196,
7940,9410,7307,8523,7533,9358,8406,8940,9296,8502,7360,7616,7184,7547,
7249,9804,8565,7829,7632,9687,7423,8343,7498,9202,9832,7233